# CLAUDE.md Guidance for Claude Code when working in this repository. ## Project Braids by Mira — a salon marketing site + booking flow + admin panel. React 19/TypeScript/Vite frontend, Supabase backend (Postgres/RLS/Storage/Edge Functions), deployed to Vercel. See `README.md` for stack details, scripts, and site structure. ## Language All user-facing text (UI copy, error messages, admin labels) is **French** — this is a Québec-based salon. Code (variables, comments, commit messages) stays in English. ## Conventions - **Styling**: CSS Modules per component/page, using shared design tokens from `src/styles/tokens.css` (`--color-gold`, `--color-charcoal`, `--color-cream`, `--space-*`). Admin pages use a separate token set/shared stylesheet (`src/pages/admin/adminShared.module.css`, `--admin-*` tokens). - **Data fetching**: public pages fetch via typed helpers in `src/data/*.ts` (e.g. `fetchServices`, `fetchRules`); admin pages call `supabase.from(...)` directly. - **Images**: `src/lib/storage.ts` holds upload helpers per bucket; `src/lib/resolveImageUrl.ts` resolves public URLs for the `salon-images` bucket. Stored paths are always bucket-relative (not full URLs) so seeded and admin-uploaded rows use the same format. - **Tests**: Vitest + Testing Library, one `*.test.tsx`/`*.test.ts` per component/hook, colocated. Supabase client is mocked per-test via `vi.mock('../lib/supabase', ...)`. Run the full suite, `tsc -b`, and `npm run lint` before considering a change done. - **Migrations**: timestamped SQL files in `supabase/migrations/`, one concern per file, with a comment explaining *why* (not just what) at the top. RLS policies gate admin writes on a hardcoded admin `auth.uid()` — check existing migrations for the current UUID before writing a new admin-write policy. ## Working in this repo - **No git remote is configured.** Commits stay local; there is no CI and no push-to-deploy. Never assume a commit ships anything. - **Deploys are manual** (`vercel --prod`) and **database migrations are pushed separately** (`npx supabase db push`) — always confirm with the user before doing either; both affect the live production site/database. - The Supabase project is already linked (`supabase/.temp/project-ref`) — `npx supabase db push` / `migration list` talk to the real remote project, not a sandbox. - When adding a feature that touches booking or admin data, check whether it needs a new migration, a storage bucket/policy, and an admin-side view — this project's features tend to span all three (see the booking intake fields + `booking-photos` bucket + `AdminBookings` detail view as a reference shape).