Technical Architecture
A short map of the system, meant for safe orientation before making changes.
Source document updated 2026-07-21.
Top level
Browser
└─ React 19 + Vite frontend (:5173)
└─ /api proxy in development
└─ Node/Express backend (:3333)
├─ Neon Postgres / Prisma (schema: web)
├─ Stripe
├─ SMTP
├─ LIS gateway
├─ render worker
├─ ws-agent service
└─ WebSocket / Unreal live demo
Frontend
- Entry point:
frontend/src/main.tsx; routes:frontend/src/App/App.tsx. - Public routes: landing, sign in / sign up, verification, and legal pages.
- Protected area:
/app/*— profile/settings, plans, agents, study, chat, render, and studio. - One separate protected route:
/demo. - The landing page is assembled in
frontend/src/components/LandingPage/LandingPage.tsx; it contains the Three.js Earth scene and the product sections. - Locales:
frontend/src/locales/{en,uk,de,es,it}.json; parity is checked byfrontend/scripts/i18n-parity.mjs. - UI state: Zustand stores and React state. API client:
frontend/src/api/index.ts.
Backend
- Entry point:
backend/src/index.js. - Main route groups:
auth,profile,avatars,stripe,demo,lis,render,ws-agent,unreal-landing,health. - Protection: Helmet/CORS/rate limiting, JWT auth, an httpOnly refresh cookie, and CSRF on mutating routes.
- Prisma schema:
backend/prisma/schema.prisma; every application model lives in the PostgreSQLwebschema.
Main flows
| Flow | Parts involved | Key constraint |
|---|---|---|
| Authentication | Frontend API client, auth routes, refresh cookie | The access token is never stored as a long-lived secret in code. |
| Profile and settings | profile routes/services, Prisma | Mutating requests require auth and CSRF. |
| Payments | Stripe routes/services, webhook, Prisma | The Stripe secret and webhook secret are backend env only. |
| Chat / LIS | lis route, frontend chat service | The LIS API key is never passed to the browser. |
| Avatars | ws-agent proxy, avatar services | The backend adds the user ID and the service key itself. |
| Render | render proxy, render worker | The backend forwards the user's JWT, not a render-service secret. |
| Live demo | demo routes, WebSocket, Unreal services | Depends on the demo config and an external Pixel Stream. |