This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
A collaborative family tree web app. Users can sign up, create family trees, add members with photos, and share them publicly. Built as a pnpm monorepo targeting web first, with mobile planned via React Native (Expo).
Live app: https://family-tree-chi-three.vercel.app/
- Web app (
apps/web/): Next.js 16, App Router, TypeScript, Tailwind CSS 4 - Backend: Supabase — Postgres, Auth (email/password), Storage, Real-time subscriptions
- Shared types (
packages/shared/):@family-tree/sharedworkspace package - Deployment: Vercel (auto-deploys from
main)
apps/web/ Next.js web app
packages/shared/ Shared TypeScript types (Member, Family, Profile)
supabase/ DB schema and migrations
Root package.json scripts delegate to apps/web via --filter.
| Route | Description |
|---|---|
/ |
Homepage — hero + public families grid |
/auth/login |
Login |
/auth/signup |
Signup |
/auth/callback |
Supabase OAuth/email confirmation callback |
/dashboard |
Protected — user's families, create new tree |
/tree/[id] |
Family tree viewer/editor |
/profile |
Edit display name and avatar |
nav.tsx— Server component; shows avatar →/profile, My trees, Sign out when logged intree-canvas.tsx— Main interactive client component: renders generation rows, SVG connector lines (cubic bezier viagetBoundingClientRect), real-time sync viapostgres_changesmember-modal.tsx— Add/edit/delete modal; uploads photos to Supabase Storageauth-form.tsx— Login/signup form; redirects to/dashboardon successcreate-family-form.tsx— Create family, redirects to/tree/[id]profile-form.tsx— Edit name + avatar; uploads toavatars/bucketsign-out-button.tsx— Client component for sign out
client.ts— Browser client (createBrowserClient)server.ts— Server client (createServerClient+ cookies)storage.ts—uploadFile(bucket, path, file)helper
src/proxy.ts— Session refresh on every request (Next.js 16 usesproxyexport, notmiddleware)
Three tables with RLS enabled: profiles, families, members.
Migrations live in supabase/migrations/. To apply:
supabase link --project-ref <ref>
supabase db pushStorage buckets: member-photos (per-family member photos), avatars (user profile photos).
buildGens()intree-canvas.tsxgroups members into generation arrays by walkingparent_idlinks (roots haveparent_id: null)- Deleting a member recursively deletes all descendants
- Real-time sync uses
supabase.channel().on('postgres_changes', ...)filtered byfamily_id - Tree layout is CSS flexbox rows — no graph algorithm; children appear under their parent's generation row
NEXT_PUBLIC_SUPABASE_URL
NEXT_PUBLIC_SUPABASE_ANON_KEY
pnpm install
pnpm dev # starts apps/web at localhost:3000See CONTRIBUTING.md for workflow, code style, and deployment guidelines.