This guide sets up BB Manager locally against a Supabase project.
- Node.js 20+
- npm
- A Supabase project
npm installCreate .env in the repo root:
VITE_SUPABASE_URL="https://<your-project-ref>.supabase.co"
VITE_SUPABASE_ANON_KEY="<your-public-anon-key>"Smoke-test credentials for npm run check:db-contract and npm run test:e2e:
E2E_TEST_EMAIL="<test-user-email>"
E2E_TEST_PASSWORD="<test-user-password>"The live app expects these tables to exist:
profilessettingsmembersmarks
For local development, create users manually in Supabase Auth and make sure each user has a row in profiles with a valid role such as admin, captain, or officer.
Seed settings with one row for company and one row for junior before running the app; section settings are updated in place and are not created on demand.
The Playwright smoke suite depends on those seeded rows so it can verify settings writes and restore the original value after each run.
New-user handover material lives in docs/user-guide.md.
npm run devOpen the printed local URL, usually http://localhost:5173.
npm run check:db-contract
npm run typecheck
npm run test:coverage
npm run buildnpm run test:run is the same automated suite CI runs on each push and pull request. The suite is intentionally small and focuses on business-critical logic rather than browser automation.
npm run check:db-contract is the fast live-backend smoke check. It reads .env and .env.local, requires E2E_TEST_EMAIL and E2E_TEST_PASSWORD, signs in with that test user, verifies current_app_role() resolves to a valid app role, and confirms the seeded settings rows for company and junior are readable through the published client credentials.
npm run test:e2e also reads .env and .env.local and uses the same E2E_TEST_* credentials. It uses a real browser and real Supabase auth, so it requires a dedicated test user with a valid role, seeded settings rows, and at least one Company-section member already present.
Neither check proves the entire live RLS policy graph. They confirm only the client-visible contract the SPA depends on.