BB Manager is a client-side React + TypeScript single-page app for managing Boys' Brigade members, marks, and settings across the company and junior sections.
The app is deployed as a static SPA on Vercel. The browser talks directly to Supabase for authentication and data access. There is no custom application server in this repo.
- React 19 + TypeScript
- Vite for development and production builds
- Tailwind CSS via PostCSS
- Supabase Auth + Postgres
- Vercel for deployment
Verified on 2026-03-21:
profilessettingsmembersmarks
RLS is enabled on the current app tables.
flowchart LR
Browser["Browser SPA"]
UI["React components"]
Hooks["Custom hooks"]
Services["services/*"]
Supabase["Supabase Auth + Postgres"]
Vercel["Vercel static hosting"]
Vercel --> Browser
Browser --> UI
UI --> Hooks
Hooks --> Services
Services --> Supabase
App.tsxorchestrates auth state, active section, view switching, and modal/toast state.components/*implements pages and shared UI.components/reports/*contains the branded session PDF document used by the dashboard export flow.- Navigation is app-state driven rather than router-driven.
useAuthAndRolesubscribes to Supabase auth and loads the current user's role fromprofiles.useSectionManagementpersists the active section inlocalStorage.useAppDataloads members and section settings for the active section.useUnsavedChangesProtectionguards navigation while forms are dirty.useToastNotificationsowns transient toast state.
services/supabaseClient.tscreates the shared Supabase client.services/supabaseAuth.tswraps auth operations.services/db.tsmaps app models to the live tables:profilesfor app roles and user metadatamembersfor member recordsmarksfor per-member attendance and scores
services/reporting/sessionReport.tsderives PDF-ready session reporting aggregates from loaded section data.services/settings.tshandles section-level settings, updating the seededcompanyandjuniorrows in place.
Sources of truth:
- Supabase Auth session for authentication
- Supabase Postgres for application data
localStorage['activeSection']for the selected section- React component and hook state for loaded records and view state
The app does not maintain an offline cache or a separate backend API. The branded session PDF generator also runs fully client-side in the browser.
- The browser only receives public client credentials (
VITE_SUPABASE_URL,VITE_SUPABASE_ANON_KEY). - Authorization is enforced in Supabase, not in the client.
- Manual account provisioning is handled directly in Supabase; the app no longer exposes signup or recovery flows.
- New-user onboarding is documented in
docs/user-guide.md. - Client-side role checks remain UX guardrails only.
See docs/10-database-security-model.md for the current security summary.
- Local development uses the Vite dev server.
- Production uses
npm run buildand Vercel static hosting. vercel.jsonhandles SPA rewrite-to-root behavior.
See docs/03-getting-started.md and docs/04-deployment.md.
- Keep Supabase table names and docs aligned with the live schema.
- Do not add server-only deployment paths unless they are actually used in production.
- Prefer deleting dead runtime files and dependencies over documenting them as optional.
- Update docs in the same change when setup, schema, auth flow, or deployment behavior changes.