A simple, beginner-friendly quiz application that uses Google Gemini AI to generate random quiz questions on various topics.
- 🎲 Random topic generation (History, Science, Sports, Movies, etc.)
- 🤖 AI-powered question generation using Google Gemini
- 📊 Score tracking
- 💡 Detailed explanations for each answer
- 📱 Fully responsive design with Bootstrap
- 🚀 No backend required - works as a static website
- ☁️ Can be hosted on AWS S3
- Go to Google AI Studio
- Click "Create API Key"
- Copy your API key
Note: The free tier gives you plenty of requests per day for personal use!
- Download all files (
index.html,script.js,style.css) - Open
index.htmlin your web browser - Paste your API key and click "Save & Start Quiz"
- Enjoy the quiz!
Your API key is saved in your browser's local storage, so you only need to enter it once.
index.html- Main webpage structurescript.js- All JavaScript logic (with comments)style.css- Custom stylingREADME.md- This file
- Log in to AWS Console
- Go to S3 service
- Click "Create bucket"
- Choose a unique bucket name (e.g.,
my-quiz-app-12345) - Uncheck "Block all public access"
- Click "Create bucket"
- Open your bucket
- Click "Upload"
- Add all files:
index.html,script.js,style.css - Click "Upload"
- Go to bucket "Properties" tab
- Scroll to "Static website hosting"
- Click "Edit"
- Select "Enable"
- Index document:
index.html - Click "Save changes"
- Go to "Permissions" tab
- Click "Bucket Policy"
- Add this policy (replace
YOUR-BUCKET-NAME):
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::YOUR-BUCKET-NAME/*"
}
]
}- Click "Save changes"
- Go back to "Properties" tab
- Scroll to "Static website hosting"
- Copy the "Bucket website endpoint" URL
- Open it in your browser!
Example URL: http://my-quiz-app-12345.s3-website-us-east-1.amazonaws.com
- User enters API key: Saved in browser's localStorage
- AI generates quiz: Sends request to Google Gemini API
- Random topic: AI picks a random interesting topic
- 5 Questions: AI creates 5 multiple-choice questions
- Instant feedback: Shows correct answer with explanation
- Final score: Displays results at the end
- HTML5
- CSS3
- JavaScript (Vanilla - no frameworks!)
- Bootstrap 5
- Google Gemini AI API
All code is written for absolute beginners:
- ✅ Lots of comments explaining each part
- ✅ Simple JavaScript (no complex patterns)
- ✅ Easy to read and understand
- ✅ No build tools or dependencies needed
- Your API key is stored only in your browser (localStorage)
- No data is sent to any server except Google Gemini
- No tracking or analytics
- Completely FREE!
- Google Gemini free tier: 60 requests per minute
- AWS S3 free tier: 5GB storage, 15GB transfer per month
Want to learn more?
This is a simple learning project. Feel free to modify and improve it!
Enjoy your quiz! 🎉