GPTTutor is a full-stack AI tutor platform built with Next.js 14 and FastAPI, designed to help students learn faster through course-scoped AI tutoring, study tools, document understanding, and voice interactions.
The platform combines:
- AI-powered tutoring
- RAG-based document Q&A
- Study automation
- Voice AI
- Course-centric workflows
Built for scalable academic assistance and future AI-native education systems.
- Google OAuth login
- Secure cookie-based sessions
- Protected course workspaces
- SaaS-style onboarding flow
- Course-scoped navigation system
- Course-specific AI chat
- RAG pipeline architecture
- Context-aware tutoring
- Document-based Q&A
- Source-grounded responses
- PDF upload support
- Lecture material parsing
- AI embeddings + semantic retrieval
- Chroma vector database integration
- Course material management
- AI-generated summaries
- Flashcard generation
- Quiz generation
- Smart revision workflows
- Voice question support
- Text-to-speech responses
- ElevenLabs integration
- Real-time tutor interaction
- Vapi outbound calling integration
- AI tutoring call scaffolding
- Live tutoring workflow support
- Next.js 14 (App Router)
- React 18
- TypeScript
- TailwindCSS
- Zustand
- FastAPI
- Pydantic v2
- SQLAlchemy
- HTTPX / Requests
- OpenAI API
- Chroma Vector DB
- ElevenLabs
- Vapi
- Google OAuth
.
βββ frontend/ # Next.js frontend
β βββ app/
β βββ components/
β βββ lib/
β βββ middleware.ts
β
βββ backend/ # FastAPI backend
β βββ app/
β β βββ main/
β β βββ routes/
β β βββ services/
β β βββ models/
β β βββ config.py
β βββ requirements.txt
β
βββ docs/ # Architecture & API docs
β
βββ README.md
# π Product Roadmap
## β
Phase 1 β UI Foundation
- SaaS-style authentication flow
- Dashboard system
- Course onboarding
- Tutor workspace UI
- Materials interface
- Study tool pages
## π§ Phase 2 β File Processing
- PDF ingestion
- Parsing & chunking
- Metadata management
- Material versioning
## π§ Phase 3 β RAG Tutor Engine
- Embedding pipeline
- Semantic retrieval
- Course-specific AI responses
- Citation support
## π§ Phase 4 β AI Study System
- Lecture summarization
- Flashcard automation
- Quiz generation
## π§ Phase 5 β Audio Intelligence
- Speech-to-text
- AI voice responses
- Audio tutoring workflows
## π§ Phase 6 β Production Polish
- Session persistence
- Chat history
- Advanced loading states
- User feedback systems
---
# π Authentication Architecture
## Current Session Model (MVP)
The platform currently uses a cookie-based authentication system for simplicity and rapid iteration.
### Flow
1. User signs in with Google
2. Backend validates OAuth state
3. Session cookie is generated
4. Frontend middleware protects routes
### Session Cookies
```bash
fe524_session
fe524_user
fe524_name| Route | Description |
|---|---|
/ |
Sign-in page |
/landing |
Marketing page |
/onboarding |
Course setup |
/c/[courseSlug]/dashboard |
Main dashboard |
/chat |
AI tutor |
/materials |
Course materials |
/study/* |
Study tools |
GET /api/healthGET /auth/google
GET /auth/google/callback
GET /api/auth/me
POST /api/auth/logout/api/materials/*/api/chat/*/api/study/*/api/audio/*POST /api/calls/outboundcd backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python -m uvicorn app.main.server:app \
--reload \
--host 127.0.0.1 \
--port 8000- Swagger β
http://127.0.0.1:8000/docs - ReDoc β
http://127.0.0.1:8000/redoc
cd frontend
npm install
npm run devhttp://localhost:3000NEXT_PUBLIC_API_URL=http://127.0.0.1:8000GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REDIRECT_URI=http://127.0.0.1:8000/auth/google/callback
FRONTEND_URL=http://localhost:3000
SESSION_COOKIE_NAME=fe524_sessionOPENAI_API_KEY=
OPENAI_MODEL=gpt-4o-mini
OPENAI_EMBEDDING_MODEL=text-embedding-3-smallELEVENLABS_API_KEY=
ELEVENLABS_VOICE_ID=VAPI_API_KEY=
VAPI_ASSISTANT_ID=
VAPI_PHONE_NUMBER_ID=Sign In
β
Onboarding
β
Create / Select Course
β
Upload Materials
β
AI Tutor Chat
β
Generate Study Tools
β
Voice / Live Tutor Features
- Cookie-based auth for MVP
- Avoid committing
.envfiles - Rotate keys if exposed
- Use HTTPS in production
- Use
SameSite=None; Securecookies in production
pip install -r requirements.txtUse consistent hostnames:
- Either
localhost - Or
127.0.0.1
Do not mix both.
Check:
- Backend running
- Session cookie exists
- Middleware configuration
| File | Purpose |
|---|---|
START_HERE.md |
Initial repo guide |
QUICKSTART.md |
Quick setup |
docs/ARCHITECTURE.md |
System architecture |
docs/API_SPEC.md |
API reference |
GPTTutor is designed to evolve into a fully AI-native academic ecosystem where:
- Every course has its own AI tutor
- Every lecture becomes searchable knowledge
- Study workflows become automated
- Voice and real-time tutoring become seamless
The long-term goal is to create an intelligent learning infrastructure for modern education.
If you like the project, consider starring the repo β