# TeacherAI Ghana — Project Reference
Built across 12 phases, mentor-style, from Phase 1 (Planning) through Phase 12
(Admin Dashboard). This file is your map back through everything.
## What this app does
A Ghanaian teacher signs up, picks a NaCCA curriculum indicator, and gets an
AI-generated lesson note, assessment, or scheme of learning — grounded in
real curriculum data, not AI guesswork. A general-purpose teaching assistant
chat helps with everyday classroom questions. Admins see platform-wide usage.
## Setup, from zero
1. `npm install`
2. **Supabase project:** create one at supabase.com. Run the SQL files in
`supabase/` **in order** (phase3 → phase4 → phase9 → phase10 → phase11 →
phase12 — phase5's curriculum data is a script, not SQL, see below).
3. **Environment variables:** copy `.env.local.example` to `.env.local` and
fill in real values:
```
NEXT_PUBLIC_SUPABASE_URL=...
NEXT_PUBLIC_SUPABASE_ANON_KEY=...
SUPABASE_URL=... # for the seed script only
SUPABASE_SERVICE_ROLE_KEY=... # for the seed script only — keep secret
OPENAI_API_KEY=...
```
4. **Google OAuth:** configure in Google Cloud Console + Supabase Dashboard →
Authentication → Providers (see Phase 4 notes).
5. **Seed curriculum data:** `npm run seed:curriculum`
6. **Make yourself an admin:** in Supabase Table Editor, set your own
`teachers.is_admin` to `true`.
7. `npm run dev` and visit `localhost:3000`
## Deploying to Vercel
1. Push this project to a GitHub repository (`.gitignore` already excludes
`node_modules` and `.env.local`).
2. Import the repo at vercel.com — Next.js is auto-detected.
3. Add `NEXT_PUBLIC_SUPABASE_URL`, `NEXT_PUBLIC_SUPABASE_ANON_KEY`, and
`OPENAI_API_KEY` in Vercel's Environment Variables (not the service role
key — that's local-only, used by the seed script).
4. In Supabase → Authentication → URL Configuration, add your Vercel domain
to both Site URL and Redirect URLs.
5. Deploy, then repeat the Phase 6 end-to-end test on the live URL: sign up …