README now covers site structure, storage buckets, admin user creation, and deployment. CLAUDE.md documents project conventions (French UI copy, styling tokens, data-fetching patterns, migration style) and working constraints (no git remote, manual deploys/db pushes require confirmation). Claude-Session: https://claude.ai/code/session_01NhxA4npAXAxmCDEJt6kxSH
2.6 KiB
2.6 KiB
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 callsupabase.from(...)directly. - Images:
src/lib/storage.tsholds upload helpers per bucket;src/lib/resolveImageUrl.tsresolves public URLs for thesalon-imagesbucket. 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.tsper component/hook, colocated. Supabase client is mocked per-test viavi.mock('../lib/supabase', ...). Run the full suite,tsc -b, andnpm run lintbefore 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 adminauth.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 listtalk 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-photosbucket +AdminBookingsdetail view as a reference shape).