Automated daily quiz system for CLAT exam preparation. Generates adaptive quizzes based on performance analytics using Claude AI.
- Daily adaptive quizzes with 10 questions and 6-minute time limit
- Single comprehension passage format (matches CLAT exam)
- Performance tracking and weak area identification
- WhatsApp notifications via Twilio
- Google OAuth authentication with configurable authorized users
git clone <repo-url>
cd daily-quiz-agent
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install -r requirements.txtCopy .env.example to .env and fill in your credentials:
cp .env.example .envRequired environment variables:
GOOGLE_CLIENT_ID/GOOGLE_CLIENT_SECRET- Google OAuth credentialsAUTHORIZED_EMAILS- Comma-separated list of authorized user emails (leave empty to allow anyone)ANTHROPIC_API_KEY- Claude API keyTWILIO_ACCOUNT_SID/TWILIO_AUTH_TOKEN- Twilio credentials (optional)NOTIFICATION_PHONE- WhatsApp number to notify (optional)
- Go to Google Cloud Console
- Create a new project or select existing
- Enable the OAuth2 API
- Create OAuth 2.0 credentials (Web application)
- Add authorized redirect URI:
http://localhost:5000/auth/callback(for development) - Copy Client ID and Client Secret to
.env
python run.pyVisit http://localhost:5000
daily-quiz-agent/
├── app/
│ ├── models/ # Database models
│ ├── routes/ # Flask routes
│ ├── services/ # Business logic
│ ├── templates/ # Jinja2 templates
│ └── static/ # CSS/JS assets
├── scripts/
│ └── generate_quiz.py # Daily cron script
├── tests/ # Test files
└── wsgi.py # Production entry point
The scripts/generate_quiz.py script runs daily to:
- Analyze user's 7-day performance
- Build adaptive prompt focusing on weak areas
- Call Claude API to generate quiz
- Store quiz in SQLite database
- Send WhatsApp notification
Cron setup (7:30 AM IST = 2:00 UTC):
0 2 * * * cd /var/www/quiz && venv/bin/python scripts/generate_quiz.pypytest tests/GitHub Actions automatically deploys to Lightsail on push to main.
Required GitHub Secrets:
LIGHTSAIL_HOSTLIGHTSAIL_USERLIGHTSAIL_SSH_KEY