A full-stack AI-powered exam preparation assistant with a modern, responsive UI and FastAPI backend.
- Frontend: React + TypeScript (Vite), Tailwind CSS,
lucide-react - Backend: FastAPI, Pydantic,
python-dotenv
From the project root:
cd backend
python -m venv .venv
# Windows PowerShell
.venv\Scripts\Activate.ps1
pip install -r requirements.txtCreate a .env file in the backend directory:
gem=your_real_ai_key_optionalRun the backend on port 8000:
uvicorn main:app --reload --port 8000From the project root:
cd frontend
npm installCreate a .env file in frontend (optional, only if backend URL differs):
VITE_API_BASE_URL=http://localhost:8000Run the frontend on port 5173:
npm run devThen open http://localhost:5173 in your browser.
-
POST /generate-question- Input:
{ "subject": string, "difficulty": "easy" | "medium" | "hard" } - Output: Question object with type, options (for MCQ), correct answer, and explanation.
- Input:
-
POST /evaluate-answer- Input:
{ "question": string, "correctAnswer": string, "studentAnswer": string } - Output: Evaluation with
isCorrect,score,feedback,strengths, andimprovements.
- Input:
The backend includes a pluggable AI service that can be wired to a real LLM; when no key is set, it uses deterministic rule-based questions and evaluation.
