|
6 | 6 |
|
7 | 7 | ## Project Snapshot |
8 | 8 |
|
9 | | -- Product: **Bayan Flow** · client-side React SPA (`/`, `/app`, `/roadmap`) |
| 9 | +- Product: **Bayan Flow** · client-side React SPA (`/`, `/app`, `/roadmap`, `/privacy`, `/terms`) |
10 | 10 | - Repo: `https://github.com/ayoub3bidi/bayan-flow` · prod `main` → bayanflow.com · dev `develop` → dev.bayanflow.com |
| 11 | +- Hosting: **Cloudflare Workers** (static SPA via `wrangler.jsonc`); `netlify.toml` kept for rollback only — CI deploys through `.github/workflows/deploy-cloudflare.yml` |
11 | 12 | - Tooling: React 19, Vite 7, Tailwind 4, Vitest 3, Remotion 4, i18next (en/fr/ar RTL), Pyodide 0.27.5 in worker |
12 | 13 | - Engines: Node `>=24.11.1`, pnpm `>=8.15.9` · alias `@/` → `src/` |
| 14 | +- Version: `0.5.0` in `package.json` — algorithm categories (45 algos, 5 categories) shipped; optional Google sign-in when Supabase env vars are set |
13 | 15 | - **PRs target `develop`**, not `main` (gated by `ensure-pr-source-develop.yml`) |
14 | 16 |
|
15 | 17 | ## Source Of Truth (registries) |
@@ -57,6 +59,19 @@ Audit all three locales + pseudocode strings + export fallbacks when renaming ca |
57 | 59 |
|
58 | 60 | See reference doc for full checklists (JS, Python, pseudocode, sound, insight, tests, registries). Keep graph algorithm commits scoped to one algorithm when possible. |
59 | 61 |
|
| 62 | +## Auth contracts (non-negotiable) |
| 63 | + |
| 64 | +- **OIDC only** — Google sign-in via Supabase Auth; no email/password flows in v0.5.0 |
| 65 | +- **Service layer** — `src/services/authService.js`, `profileService.js`; components use `AuthContext` / `useAuth`, never import Supabase directly |
| 66 | +- **Postgres-portable schema** — `profiles` keyed to `auth.users`; RLS on public tables; client never writes `plan` (service role / webhook only, future) |
| 67 | +- **Session** — `getSession()`, `onAuthStateChange()`; `AuthProvider` in `src/main.jsx` |
| 68 | +- **OAuth UX** — Google Identity Services (One Tap + PKCE popup on `/auth/google/callback`); web uses `signInWithIdToken`, not `signInWithOAuth` |
| 69 | +- **i18n** — sign-in/out strings and legal copy in en/fr/ar; audit RTL for Header auth control |
| 70 | +- **Free by default** — unauthenticated users keep full access; auth PRs must not gate existing features |
| 71 | +- **Secrets** — publishable anon key via `VITE_*` only; service role key never in repo or client bundle |
| 72 | +- **CSP** — Supabase origin in `connect-src`; Google profile photos in `img-src`; assert via `scripts/cspHeaders.js` |
| 73 | +- **Tests** — mock Supabase in Vitest (`src/test/supabaseMock.js`, wired in `src/test/setup.js`) |
| 74 | + |
60 | 75 | ## Workflow rules |
61 | 76 |
|
62 | 77 | - Minimal diff; no unrelated edits; preserve user-authored changes |
|
0 commit comments