A Next.js-based AI tutoring platform with student progress tracking and instructor analytics.
- Frontend: Next.js 15 with TypeScript
- Backend: API routes with Postgres integration
- Database: PostgreSQL with Row-Level Security (RLS)
- Auth: Clerk (Sprint 1 stubs, full integration in Sprint 2)
- Testing: Jest + Supertest for API route testing
- Node.js 18+
- PostgreSQL database (Supabase recommended)
- Environment variables configured
-
Clone and Install Dependencies
git clone <repository-url> cd ai-learning-tool npm install
-
Add Environment Variables
Create .env file and add all of the environment variables from the 'AI Fellows: ai-learning-tool' Notion page under '.env.local setup'
-
Run Tests
npm test # Tests use mock database for Sprint 1 - no real DB connection required
-
Start Development Server
npm run dev
-
Complete your ticket
-
Run tests:
npm test
- Follow the established patterns in
api/routes/andapi/tests/
-
Check linting:
npm run lintand resolve any errors before pushing and submitting a PR -
Ready to submit?- Point your PRs to the dev branch when you submit
-
Review process begins (all tests must pass before merging)
-
If you need an approval for your pull request, post the PR link in the #aifellows25 Slack channel, say that you need a +1, and tag the DevOps team member you’re assigned to (also shared in Slack, may change in the future).
-
When someone from DevOps reviews it, they’ll put a green checkmark if it has been approved or reply to your post and say they left a comment if it wasn't
- Other: If the Vercel bot comments on your PR that there's a build error, run
npm run lintandnpx tsc --noEmit(for TS errors) locally to see the errors
GET /api/me- Get current user's profile (student only sees own data)GET /api/users- Get all users (admin only)PATCH /api/me/progress- Update session counters (student only)
All endpoints require Authorization: Bearer <token> header.
Jest + Supertest is used for API route testing:
- Location:
api/tests/ - Run Tests:
npm test - Coverage: 10 comprehensive tests covering student/admin RLS behavior
- Mock Database: Sprint 1 uses mocked database for isolated testing
The dev branch will automatically deploy to Vercel, which is our QA/Testing environment. This is our temporary url for the QA env: https://ai-learning-tool-git-dev-sebastian-vivas-projects.vercel.app/ Anything that gets merged to dev will deploy here.
- ✅ Student self-access (RLS enforced)
- ✅ Admin access controls
- ✅ Input validation
- ✅ Authentication edge cases
- ✅ Progress tracking updates
See docs/USER_SCHEMA.md for complete schema documentation including:
profilestable structure- Row-Level Security policies
- Placeholder fields for Sprint 1
- JSON schemas for achievements
├── api/
│ ├── lib/
│ │ ├── auth.ts # Clerk integration (Sprint 1 stubs)
│ │ └── db.ts # PostgreSQL connection
│ ├── routes/
│ │ └── users.ts # User API endpoints
│ └── tests/
│ ├── helpers/
│ │ └── dbTestUtils.ts # Test utilities
│ └── users.test.ts # API route tests
├── docs/
│ ├── USER_SCHEMA.md # Database schema documentation
│ └── SEEDING_GUIDE.md # Data seeding instructions
├── db/
│ ├── migrations/ # Database migrations
│ └── seeds/ # Sample data scripts
└── tasks/ # Sprint planning documents
docs/USER_SCHEMA.md- Database schema and RLS policiesdocs/SEEDING_GUIDE.md- Data seeding for testingtasks/- Sprint planning and task breakdowns