An interactive web-based GRE quiz application built with FastAPI, HTML/CSS/JavaScript, and powered by Google Gemini Flash 2.5 to dynamically generate GRE-style questions.
- ✅ FastAPI backend serving quiz questions via Gemini Flash 2.5
- ✅ Clean static frontend (HTML, CSS, JavaScript)
- ✅ Category-based questions: Verbal, Quant, Analytical
- ✅ Score tracking using session storage (no database required)
- ✅ Seamless user interaction with Next/Start buttons
- ✅ No external frontend frameworks
QuizAI/
├── backend/
│ ├── main.py # FastAPI app
│ └── gemini_client.py # Gemini 2.5 Flash integration
├── frontend/
│ ├── index.html # Quiz UI
│ ├── styles.css # Stylesheet
│ └── app.js # Quiz logic
├── README.md
git clone https://github.com/yasir13001/QuizAI.git
cd QuizAI
Create a virtual environment and install required packages:
pip install fastapi uvicorn google-generativeai
Ensure your environment has the Gemini API key available.
# gemini_client.py
from google import genai
genai.configure(api_key="YOUR_API_KEY")
client = genai.Client()
From the project root:
uvicorn backend.main:app --reload --port 8080
Visit: http://localhost:8080
Here are some features you can implement to further improve the quiz app:
- Display a summary at the end of quiz.
- Option to reset session storage.
- Track how long the user takes for each question.
- Use
setTimeout()
and countdown logic inapp.js
.
- Save asked questions in
sessionStorage
. - Enable review mode for previous answers.
- Show performance in Verbal vs Quant.
- Display as simple text or graphs (if adding chart libs later).
- Let users download their quiz result as a
.txt
or.csv
file.
- Display a spinner while waiting for Gemini response.
Built by MoonAI — powered by OpenAI + Google Gemini.
MIT License. Feel free to use, modify, and share.