Skip to main content

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 by frontend/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 PostgreSQL web schema.

Main flows

FlowParts involvedKey constraint
AuthenticationFrontend API client, auth routes, refresh cookieThe access token is never stored as a long-lived secret in code.
Profile and settingsprofile routes/services, PrismaMutating requests require auth and CSRF.
PaymentsStripe routes/services, webhook, PrismaThe Stripe secret and webhook secret are backend env only.
Chat / LISlis route, frontend chat serviceThe LIS API key is never passed to the browser.
Avatarsws-agent proxy, avatar servicesThe backend adds the user ID and the service key itself.
Renderrender proxy, render workerThe backend forwards the user's JWT, not a render-service secret.
Live demodemo routes, WebSocket, Unreal servicesDepends on the demo config and an external Pixel Stream.