How tsinjonantosoa/nexusai-platform works
NexusAI is a bilingual AI-character chat demonstration: users browse characters, access chat/conversation screens, and manage accounts and wallet purchases. The current backend is a modular foundation, not a functioning AI-chat or payment-fulfillment system: identity, wallet ledger, product catalogue, and Sandbox Checkout are implemented, while AI calls, conversation persistence, webhooks, and wallet fulfillment remain future work. The frontend supports mock and API modes. Edges below follow explicit router registration/imports and shown calls; unsampled feature internals and browser-to-API wiring are not asserted.
Main entry points: main.py FastAPI application · routeTree.gen.ts SPA routes · models.py PostgreSQL records · api.ts API client
Components 26
Web experience
- SPA routes
frontend/src/routeTree.gen.ts - Application shell
frontend/src/components/layout/Shell.tsx - Auth screens
frontend/src/features/Auth.tsx - Character discovery
frontend/src/features/Discovery.tsx - Chat and conversations
frontend/src/features/Conversations.tsx - Settings
frontend/src/features/Settings.tsx - Billing screens
frontend/src/features/Billing.tsx - API client
frontend/src/services/api.ts - Mock service
frontend/src/services/mock.ts
Identity and access
- Identity endpoints
backend/app/auth/router.py - Session lifecycle
backend/app/auth/service.py - Session and CSRF checks
backend/app/auth/dependencies.py - Current user
backend/app/users/router.py
Billing and wallet
- Wallet queries
backend/app/wallet/router.py - Wallet ledger operations
backend/app/wallet/service.py - Billing endpoints
backend/app/billing/router.py - Checkout and orders
backend/app/billing/checkout.py - Product catalogue
backend/app/billing/catalogue.py - Stripe Sandbox gateway
backend/app/billing/stripe_client.py
API and persistence
- FastAPI application
backend/app/main.py - Health and admin
backend/app/api/health.py - Runtime configuration
backend/app/core/config.py - Database sessions
backend/app/db/session.py - PostgreSQL records
backend/app/db/models.py
Other components
- Visitor
- Stripe
Connections 39
- Visitor → SPA routes: uses
frontend/src/routeTree.gen.ts - SPA routes → Application shell: renders
- SPA routes → Auth screens: routes to
- SPA routes → Character discovery: routes to
- SPA routes → Chat and conversations: routes to
- SPA routes → Settings: routes to
- SPA routes → Billing screens: routes to
- Auth screens → API client: requests
- Billing screens → API client: requests
- Chat and conversations → API client: requests
- Character discovery → API client: requests
- API client → FastAPI application: calls API
- Visitor → Mock service: uses demo
- FastAPI application → Health and admin: registers
backend/app/main.py - FastAPI application → Identity endpoints: registers
backend/app/main.py - FastAPI application → Current user: registers
backend/app/main.py - FastAPI application → Wallet queries: registers
backend/app/main.py - FastAPI application → Billing endpoints: registers
backend/app/main.py - FastAPI application → Runtime configuration: loads settings
backend/app/main.py - FastAPI application → Database sessions: builds sessions
backend/app/main.py - Health and admin → Database sessions: checks database
backend/app/api/health.py - Database sessions → PostgreSQL records: queries
- Identity endpoints → Session lifecycle: issues sessions
backend/app/auth/router.py - Identity endpoints → Wallet ledger operations: creates wallet
backend/app/auth/router.py - Identity endpoints → Session and CSRF checks: checks access
backend/app/auth/router.py - Session lifecycle → PostgreSQL records: persists sessions
backend/app/auth/service.py - Session and CSRF checks → PostgreSQL records: reads sessions
backend/app/auth/dependencies.py - Current user → Session lifecycle: formats user
backend/app/users/router.py - Current user → Session and CSRF checks: requires user
backend/app/users/router.py - Wallet queries → PostgreSQL records: reads wallet ledger
backend/app/wallet/router.py - Wallet queries → Session and CSRF checks: requires user
backend/app/wallet/router.py - Wallet ledger operations → PostgreSQL records: updates ledger
backend/app/wallet/service.py - Billing endpoints → Checkout and orders: creates orders
backend/app/billing/router.py - Billing endpoints → PostgreSQL records: lists products
backend/app/billing/router.py - Billing endpoints → Session and CSRF checks: requires user
backend/app/billing/router.py - Checkout and orders → Product catalogue: uses products
backend/app/billing/checkout.py - Checkout and orders → Stripe Sandbox gateway: requests checkout
backend/app/billing/checkout.py - Stripe Sandbox gateway → Stripe: calls
backend/app/billing/stripe_client.py - Checkout and orders → PostgreSQL records: stores orders
backend/app/billing/checkout.py