How I created a modern quiz application that generates custom tests using Google's AI and deployed it to GitHub Pages.
Idea
Ever wanted to create quizzes on any topic instantly? That's exactly what I built - a React application that uses Google's Gemini AI to generate custom quizzes on any subject you can think of. Whether it's JavaScript programming, world history, or even obscure topics like "medieval cooking techniques," this app can create engaging multiple-choice questions in seconds.
What did I build?
The AI Quiz Generator is a modern web application that,
- Generates quizzes using Google's Gemini AI API.
- Offers customizable difficulty levels and question counts.
- Provides a beautiful, interactive quiz-taking experience.
- Shows detailed results with explanations for each answer.
- Works perfectly on both desktop and mobile devices.
Try it live →
The Tech Stack
I chose modern, reliable technologies that work well together.
Frontend Technologies
- React 19 with TypeScript for type safety
- Material-UI (MUI) v7 for beautiful, responsive components
AI and Deployment
- Google Gemini AI API for intelligent quiz generation
- GitHub Pages for free hosting and deployment
How does it work?
The app has three main sections.
- Quiz Generator: Enter any topic, choose difficulty (Easy/Medium/Hard), number of questions (3-15), and question type (Multiple Choice/True-False).
- Quiz Taker: Answer questions with a clean, intuitive interface that tracks your progress and time.
- Results: Get your score, see which answers were correct, and read explanations for each question.
The Development Process
Building this was surprisingly straightforward. The biggest challenge was effectively integrating the Gemini AI API. I had to craft the right prompts to ensure the AI generates well-structured questions with clear explanations.
The UI was built with Material-UI, which made creating a professional-looking interface much more straightforward than starting from scratch. The responsive design ensures the app works great on phones, tablets, and desktops.
Deployment on GitHub Pages
One of the best aspects of this project was its ease of deployment. GitHub Pages provides free hosting for static sites, and with the gh-pages package, deployment is just one command away.
npm run deploy
The app automatically builds and pushes the static files to a special gh-pages branch, which GitHub serves at https://gourav8jain.github.io/react_gemini-quiz.
Key Features
- AI-Powered: Uses Google's latest Gemini AI for intelligent quiz generation.
- Customizable: Choose topic, difficulty, question count, and type.
- Interactive: Beautiful UI with progress tracking and real-time feedback.
- Educational: Provides explanations for each answer to help users learn.
- Responsive: Works perfectly on all devices.
- Fast: Optimized build with modern React features.
What I Learned?
This project taught me several valuable lessons.
- AI Integration: Working with AI APIs requires careful engineering of prompts.
- Modern React: TypeScript and React 19's latest features make development much smoother.
- UI/UX Design: Material-UI's component library saves a significant amount of time while maintaining high quality.
- Deployment: GitHub Pages is perfect for React apps and completely free.
The Result
The final application is fast, beautiful, and genuinely helpful. You can create quizzes on literally any topic - from "React hooks" to "ancient Egyptian mythology" - and get well-structured questions with explanations.
The app has been deployed and is live at: https://gourav8jain.github.io/react_gemini-quiz.
Open Source
The entire project is open-source and available on GitHub: https://github.com/gourav8jain/react-gemini-quiz.
Feel free to fork it, contribute to it, or use it as a starting point for your own projects!
Next Steps
I'm planning to add more features like.
- Quiz sharing capabilities
- User accounts and quiz history
- More question types (fill-in-the-blank, matching)
- Quiz templates for popular subjects
This project demonstrates the power of modern web technologies when combined with AI. In just a few days, I was able to build something that would have taken months just a few years ago.
Built with ❤️ using React, TypeScript, and Google Gemini AI.
Links