frontend/— Next.js 16 app (App Router). Key files:app/page.tsx,app/layout.tsx,app/globals.css. Shared configs:eslint.config.mjs,tsconfig.json,next.config.ts.supabase/— database migrations and CLI setup (seesupabase/README.md); apply schema via Supabase CLI.docs/— contributor and process docs. Root files (PRD.md,Note_Sharer_Tech_Stack.md,project-charter.md) capture product intent.- UI system source of truth:
docs/ui-system.md. Follow its terminology and component rules before introducing new UI or copy changes. - Keep new UI/features in
frontend/app/<feature>; colocate helpers with components. Place future tests beside modules or underfrontend/__tests__.
- Install deps:
cd frontend && npm install. - Local dev:
npm run dev(Next.js with fast refresh). Uses.env.localfor env vars. - Build:
npm run build(ensures production readiness) thennpm run startto smoke-test the build. - Lint:
npm run lint(Next + ESLint rules). - Supabase:
cd supabase && supabase link --project-ref prwaxvxppcbnoqwcvcjnthensupabase db pushto apply migrations.
- TypeScript, React 19, Next App Router. Prefer server components unless client features are required.
- Functional components only; PascalCase for components/hooks, camelCase for helpers, kebab-case for files and routes.
- Keep styling in dedicated files (route-scoped CSS like
app/auth/auth.cssor shared globals); use class names instead of inline utility chains for new UI. - 2-space indentation; keep imports ordered (framework → libraries → project paths). Run
npm run lintbefore PRs.
- No automated suite yet. For new work, add component/route tests (e.g., Jest/Testing Library or Playwright) under
frontend/__tests__or alongside components. - Name tests after the unit or page they cover (
<component>.test.tsx). Ensure critical flows (auth, uploads, credit transfers) gain coverage as they land.
- Use Conventional Commits (
feat: add upload form,fix: handle expired token). Keep commits scoped and readable. - Branch from
main; keep changes small and focused. Reference issue IDs in commit bodies when applicable. - PRs: fill out the template, link related issues, and add before/after notes or screenshots for UI changes. Mention any migrations or env var changes explicitly.
- Copy
.env.local(not committed) and setNEXT_PUBLIC_SUPABASE_URL+NEXT_PUBLIC_SUPABASE_ANON_KEY; add server-only keys (SUPABASE_SERVICE_ROLE_KEY,SUPABASE_JWT_SECRET) if needed for server actions. - Protect secrets: never commit generated
.env*files. Rotate keys if leaked. - Before pushing schema changes, run
supabase db lint; for drift, usesupabase db pull. Document new migrations in PRs.