acupedia-api/app/features/auth
Urvish Prajapati 7afa8e1913 feat(api): modularize admin services, add storefront plans, and support country in profile update
- Auth:
  - Add `country` field to `ProfileUpdateRequest` schema
  - Update `AuthService.update_profile` and `AuthRepository.update_profile` to persist country changes to `auth.app_users`

- Storefront Parity:
  - Add public `GET /api/plans` endpoint in `app/features/plans.py` with dual-currency pricing (INR/USD), feature badges, and module slugs
  - Mount plans router and add `GET /` root health status endpoint in `app/main.py`
  - Update CORS allowed origins for backoffice port 3001

- Admin Architecture & Endpoints:
  - Refactor monolithic admin service into domain-driven sub-services under `app/features/admin/services/` (modules, plans, coupons, customers, payments, database, reports)
  - Retain backwards-compatible `AdminService` facade in `services/__init__.py`
  - Add full endpoint parity in `app/features/admin/api.py` for customer 360 drawer, streaming CSV reports, live DB stats, dump downloads, and HTML invoice preview
  - Add `created_at` timestamp to `AdminUserListResponse` and validation schemas in `app/features/admin/schema.py`
2026-09-11 14:51:15 +05:30
..
README.md Init Api 2026-09-05 19:29:21 +05:30
__init__.py Init Api 2026-09-05 19:29:21 +05:30
api.py Init Api 2026-09-05 19:29:21 +05:30
deps.py Init Api 2026-09-05 19:29:21 +05:30
domain.py Init Api 2026-09-05 19:29:21 +05:30
errors.py Init Api 2026-09-05 19:29:21 +05:30
repository.py feat(api): modularize admin services, add storefront plans, and support country in profile update 2026-09-11 14:51:15 +05:30
schema.py feat(api): modularize admin services, add storefront plans, and support country in profile update 2026-09-11 14:51:15 +05:30
security.py Init Api 2026-09-05 19:29:21 +05:30
service.py feat(api): modularize admin services, add storefront plans, and support country in profile update 2026-09-11 14:51:15 +05:30

README.md

AccuPedia Auth Feature

Bounded-context authentication/identity package for the four-schema database.

Routes

  • POST /auth/register
  • POST /auth/login
  • GET /auth/me
  • GET /auth/profile
  • PUT /auth/profile
  • POST /auth/change-password
  • POST /auth/forgot-password
  • POST /auth/reset-password

GET /auth/me and GET /auth/profile return identity + roles only.

Subscription, entitlement and unlocked-module state are intentionally excluded. Use GET /access/me for access state.

Persistence ownership

This package uses only auth-owned models:

  • auth.app_users
  • auth.roles
  • auth.user_roles
  • auth.password_reset_otps

No content/commerce query is performed by the auth repository.

Passwords

bcrypt only. No SHA/PBKDF2 backward compatibility.

OTP

  • cryptographically generated 6-digit code
  • 15 minute validity
  • previous unused OTPs invalidated
  • account-enumeration-safe forgot-password response
  • email adapter: app.services.email.send_password_reset_email