Complete full-stack application for AI-powered adaptive learning with dual AI tutor integration.
- Backend: NestJS + Prisma + PostgreSQL + OpenAI + Google Gemini
- Frontend: Next.js 14 + TypeScript + Tailwind CSS + Zustand
- JWT Authentication
- Dual AI-powered tutoring:
- OpenAI adaptive tutor with cognitive load monitoring
- Google Gemini tutor with structured responses
- Progressive curriculum unlocking
- Real-time mastery tracking
- Personalized learning paths
- Responsive UI with Tailwind CSS
cd backend
npm install
cp .env.example .env
# Configure DATABASE_URL, JWT_SECRET, OPENAI_API_KEY, and GEMINI_API_KEY in .env
npx prisma generate
npx prisma db push
npm run prisma:seed
npm run start:devBackend runs on http://localhost:3000
cd frontend
npm install
cp .env.example .env.local
# Configure NEXT_PUBLIC_API_URL in .env.local
npm run devFrontend runs on http://localhost:3000
- Email: student@apex.com
- Password: password
DATABASE_URL="postgresql://user:password@localhost:5432/apex_school"
JWT_SECRET="your-secret-key"
OPENAI_API_KEY="sk-your-openai-key"
GEMINI_API_KEY="your-gemini-key"
NODE_ENV="development"
PORT=3000NEXT_PUBLIC_API_URL=http://localhost:3000See backend/API.md for complete API documentation.
Authentication:
- POST /api/auth/login
- POST /api/auth/register
Curriculum:
- GET /api/curriculum/:subject
- POST /api/curriculum/mastery
AI Tutors:
- POST /api/ai/chat (OpenAI)
- POST /api/ai-tutor (Gemini)
Health:
- GET /health
curl -X GET http://localhost:3000/api/ai-tutor/test- Login at http://localhost:3000/login
- Navigate to Dashboard
- Click "Start" on any lesson
- Use the Gemini AI Tutor component in the lesson page
apex-school/
├── backend/ # NestJS API
│ ├── prisma/ # Database schema & seed
│ ├── src/
│ │ ├── ai/ # OpenAI tutor module
│ │ ├── ai-tutor/ # Gemini tutor module
│ │ ├── auth/ # Authentication
│ │ ├── curriculum/ # Curriculum management
│ │ ├── students/ # Student profiles
│ │ ├── health/ # Health checks
│ │ └── common/ # Shared utilities
│ └── test/ # E2E tests
└── frontend/ # Next.js app
├── app/ # App router pages
├── components/ # React components
└── lib/ # Utilities
| Feature | OpenAI Tutor | Gemini Tutor |
|---|---|---|
| Location | Right sidebar chat | Lesson content area |
| Response Type | Conversational | Structured (answer/hints/next step) |
| Adaptation | Cognitive load aware | Context aware |
| Use Case | Quick questions | Detailed explanations |
See backend/DEPLOYMENT.md for production deployment guide.
UNLICENSED - Private educational platform