An environment-themed trivia quiz application for 4th and 5th grade students. Built with FastAPI, SQLite, and Vanilla JS — fully containerized with Docker and automated via GitHub Actions CI/CD.
| Layer | Technology |
|---|---|
| Backend | Python 3.12 + FastAPI |
| Database | SQLite (via stdlib sqlite3) |
| Frontend | Vanilla HTML / CSS / JS |
| Container | Docker + Docker Compose |
| CI/CD | GitHub Actions |
automated-quiz-engine/
├── .github/workflows/ci-cd-pipeline.yml
├── backend/
│ ├── app.py # FastAPI routes
│ ├── database.py # SQLite helpers + seed data
│ ├── models.py # Pydantic schemas
│ ├── requirements.txt
│ └── tests/
│ └── test_app.py
├── frontend/
│ ├── index.html
│ ├── styles.css
│ └── script.js
├── .gitignore
├── docker-compose.yml
├── Dockerfile
└── README.md
git clone <your-repo-url>
cd automated-quiz-engine
docker compose up --buildOpen http://localhost:8000 in your browser.
cd backend
pip install -r requirements.txt
uvicorn app:app --reload --port 8000Then open frontend/index.html in your browser, or visit http://localhost:8000 to serve it via FastAPI's static file mount.
cd automated-quiz-engine
pip install -r backend/requirements.txt
pytest backend/tests/test_app.py -v| Method | Endpoint | Description |
|---|---|---|
| GET | /api/questions |
List all questions (no answers) |
| GET | /api/questions/{id} |
Get a single question |
| POST | /api/sessions |
Create a new quiz session |
| POST | /api/sessions/{id}/answer |
Submit an answer, get feedback |
| GET | /api/sessions/{id}/results |
Get final score and result summary |
Interactive docs are available at http://localhost:8000/docs.
The GitHub Actions workflow (.github/workflows/ci-cd-pipeline.yml) runs on every push and pull request:
- Test — runs
pytestagainst the full test suite - Lint — runs
flake8for code quality - Build — builds the Docker image to verify integrity
- Deploy — on merges to
main, pushes the image to Docker Hub
| Secret | Description |
|---|---|
DOCKER_USERNAME |
Your Docker Hub username |
DOCKER_PASSWORD |
Your Docker Hub access token |
Five environment trivia questions are seeded on first launch covering:
- Atmosphere — Earth's atmospheric composition
- Energy — Renewable vs. fossil fuel energy sources
- Plants — Photosynthesis
- Atmosphere — The ozone layer
- Water Cycle — The hydrological cycle
MIT