Production-ready scaffold for AP Biology planning and focus tracking.
- Responsive multi-screen app:
- Dashboard
- Curriculum (8 units, 35 chapters)
- Topic detail (notes/resources/flashcard hook)
- Study plan calendar
- Active pomodoro timer
- Session complete screen
- Stats/history
- Settings
- Chapter-based curriculum progress (not unit-only)
- Seasonal daily goals editable in settings
- Lagging / On Track / Ahead shown together with active state highlighted
- Timer controls: start, pause, reset, mode switch
- Focus-only time accounting:
- Daily totals only count active focus time
- Break time is excluded
- Streak based on consecutive study days using system date boundaries
- Local persistence in browser storage
- Google login page + Supabase auth integration hooks
- Cloud save/load API via
/api/sync
- Frontend: Next.js (App Router) + TypeScript + Tailwind
- Backend: Supabase (Postgres + Auth)
- Sign-on: Google OAuth through Supabase Auth
This machine did not have Node tooling at implementation time (node, npm, npx missing).
Install Node 20+ first, then continue.
- Install dependencies:
npm install- Create env file:
cp .env.example .env.local- Fill
.env.local:
NEXT_PUBLIC_SUPABASE_URL=...
NEXT_PUBLIC_SUPABASE_ANON_KEY=...
NEXT_PUBLIC_BASE_URL=http://localhost:3000- In Supabase SQL editor, run:
supabase/schema.sqlsupabase/seed.sql
- In Supabase dashboard:
- Enable Google provider in Auth > Providers
- Set OAuth redirect URL to:
http://localhost:3000/auth/callback- your production URL later
- Cloud sync endpoint:
- The app sends authenticated bearer tokens to
/api/sync. /api/syncstores full state inuser_stateand also writes normalized tables:user_settingsuser_chapter_progressdaily_statsnotesstudy_sessions
- Start app:
npm run devsrc/components/focus-app.tsxmain app logic/UIsrc/app/api/sync/route.tscloud state save/load endpointsrc/lib/apbio-data.tsAP Bio units/chapters datasupabase/schema.sqlrelational schema + RLS policiessupabase/seed.sqlcurriculum seed data
/api/synccurrently stores full client state inuser_state.state_json.- You can evolve to normalized table sync using
study_sessions,daily_stats,user_chapter_progress, andnotes. - RLS policies are included in schema.