How pepper-candy/milestone works
MILESTONE is a mentor–mentee study tracker: users enter via invitation codes, then mentees complete tasks and study sessions while mentors review work and manage rewards. The dashboard brings together task progress, sessions, and prize milestones; profiles support family links and invitations. The map preserves those documented product areas, with sampled API handlers and Supabase helpers shown as the internal service layer. Some UI-to-API wiring and unsampled routes are not visible in the excerpts, so those links are omitted.
Main entry points: server.ts Server client · DashboardClient.tsx Dashboard · admin.ts Admin client · TaskList.tsx Task workflow
Components 25
Access & family
- Invitation login
src/app/(auth)/login/page.tsx - Family profile
src/components/profile/ProfilePageClient.tsx
Progress dashboard
- Dashboard
src/components/dashboard/DashboardClient.tsx - Task workflow
src/components/tasks/TaskList.tsx - Task details
src/components/tasks/TaskCard.tsx - Study sessions
src/components/timer/SessionTimer.tsx - Prize path
src/components/progress/PrizePathEditor.tsx - Milestone display
src/components/progress/MilestonePath.tsx - Family live sync
src/lib/family-sync.ts
Application services
- Auth endpoints
src/app/api/auth/route.ts - First mentee setup
src/app/api/auth/first-child/route.ts - Family invitations
src/app/api/invite/route.ts - Profile API
src/app/api/profile/route.ts - Task operations
src/app/api/tasks/route.ts - Session operations
src/app/api/session/route.ts - Session updates
src/app/api/session/[id]/route.ts - Milestone operations
src/app/api/milestones/route.ts - EXP to Gems
src/app/api/gems/convert/route.ts - Community tasks
src/app/api/community/route.ts - Photo upload
src/app/api/upload/route.ts
Persistence
- Server client
src/lib/supabase/server.ts - Admin client
src/lib/supabase/admin.ts - Supabase database
Other components
- Mentors & mentees
- Vercel Blob
Connections 34
- Mentors & mentees → Invitation login: enter code
README.md - Invitation login → Auth endpoints: authenticate
- Auth endpoints → Server client: creates client
src/app/api/auth/route.ts - Auth endpoints → Admin client: provisions account
src/app/api/auth/route.ts - Mentors & mentees → Dashboard: track progress
README.md - Dashboard → Task workflow: renders
src/components/dashboard/DashboardClient.tsx - Task workflow → Task details: renders
src/components/tasks/TaskList.tsx - Task workflow → Task operations: manages tasks
- Dashboard → Study sessions: renders
src/components/dashboard/DashboardClient.tsx - Dashboard → Prize path: renders editor
src/components/dashboard/DashboardClient.tsx - Dashboard → Milestone display: renders path
src/components/dashboard/DashboardClient.tsx - Study sessions → Session operations: loads session
- Study sessions → Session updates: updates session
- Prize path → Milestone operations: edits path
- Family profile → Profile API: loads and saves
src/components/profile/ProfilePageClient.tsx - Family profile → Family invitations: manages invites
- Mentors & mentees → Family profile: manage family
README.md - First mentee setup → Server client: creates client
src/app/api/auth/first-child/route.ts - First mentee setup → Admin client: provisions mentee
src/app/api/auth/first-child/route.ts - Task operations → Server client: queries data
src/app/api/tasks/route.ts - Profile API → Server client: queries data
src/app/api/profile/route.ts - Family invitations → Server client: uses session
src/app/api/invite/route.ts - Family invitations → Admin client: uses admin
src/app/api/invite/route.ts - Session operations → Server client: queries data
src/app/api/session/route.ts - Session updates → Server client: queries data
src/app/api/session/[id]/route.ts - Milestone operations → Server client: uses session
src/app/api/milestones/route.ts - Milestone operations → Admin client: uses admin
src/app/api/milestones/route.ts - EXP to Gems → Server client: uses session
src/app/api/gems/convert/route.ts - Community tasks → Server client: uses session
src/app/api/community/route.ts - Photo upload → Server client: uses session
src/app/api/upload/route.ts - Server client → Supabase database: reads and writes
- Admin client → Supabase database: admin access
- Photo upload → Vercel Blob: stores photos
- Dashboard → Family live sync: subscribes
src/components/dashboard/DashboardClient.tsx