|
4 | 4 |
|
5 | 5 | ## System context |
6 | 6 |
|
7 | | -DebateLab is a browser application with an optional Capacitor iOS shell. The client uses Supabase for sessions, persisted user data, database RPCs, and Edge Functions. Edge Functions keep privileged credentials server-side and integrate with AI providers, research services, Stripe, and Google APIs. |
| 7 | +DebateLab is a browser application. The client uses Supabase for sessions, persisted user data, database RPCs, and Edge Functions. Edge Functions keep privileged credentials server-side and integrate with AI providers, research services, Stripe, and Google APIs. |
8 | 8 |
|
9 | 9 | ```text |
10 | | -Browser or Capacitor |
| 10 | +Browser or PWA |
11 | 11 | -> React routes, feature components, stores |
12 | 12 | -> Supabase Auth, PostgreSQL, RPCs, Edge Functions |
13 | 13 | -> AI providers, research, Stripe, Google Docs |
14 | 14 | ``` |
15 | 15 |
|
16 | 16 | ## Client startup and routing |
17 | 17 |
|
18 | | -[`src/bootstrap.ts`](../src/bootstrap.ts) imports the application entry immediately, then schedules Jam after window load and idle time. [`src/main.tsx`](../src/main.tsx) mounts the application before starting native runtime handling, observability, native URL handling, and service-worker registration. Vercel browser telemetry is disabled inside the native shell and loaded behind a separate Suspense boundary. |
| 18 | +[`src/bootstrap.ts`](../src/bootstrap.ts) imports the application entry immediately, then schedules Jam after window load and idle time. [`src/main.tsx`](../src/main.tsx) mounts the application before starting observability and service-worker registration. Vercel browser telemetry is loaded behind a separate Suspense boundary. |
19 | 19 |
|
20 | 20 | [`src/App.tsx`](../src/App.tsx) owns routes and top-level providers. Pages are lazy loaded. Public routes cover marketing, legal pages, login, sources, and shared content. `/app/*` routes pass through `RequireAuth` and include the main tools, the Current Debate dashboard (`/app/debate`), history, library, timer, sparring, flowchart, settings, and administration. The header holds only Home, the Current debate menu, Library, History, and the language, theme, and Settings controls; tools are launched from Home and the dashboard. |
21 | 21 |
|
@@ -138,12 +138,6 @@ CI and staging must not upload authenticated browser captures. Logging must not |
138 | 138 |
|
139 | 139 | The service worker and manifest provide installable web assets and an offline app shell. It precaches only the navigation shell and static identity assets; route chunks enter the runtime cache when a user visits them. On first registration, the client also reports same-origin `/assets/` resources that loaded before the worker took control so the first visited route works offline without a forced reload. Updates wait for the normal service-worker lifecycle instead of reloading an active page. Offline support does not make unvisited routes, authenticated Supabase, or AI operations available without a network. |
140 | 140 |
|
141 | | -## iOS shell |
142 | | - |
143 | | -[`capacitor.config.ts`](../capacitor.config.ts) owns the native app identifier, build directory, schemes, and native plugin settings. The iOS app wraps the same Vite output using a relative asset base. |
144 | | - |
145 | | -OAuth still travels through the provider and Supabase HTTPS callback before returning to the app callback scheme. Native URL handling lives in the client startup path. |
146 | | - |
147 | 141 | ## Deployment boundary |
148 | 142 |
|
149 | 143 | Vercel builds `dist/` with Node 22 and serves it. [`vercel.json`](../vercel.json) owns SPA fallback, cache policy, crawler restrictions, and response security headers. Merging to `main` deploys the frontend to production; Supabase migrations and Edge Functions deploy separately. GitHub workflow files own quality, live-provider, staging, and canary automation. |
|
0 commit comments