A RESTful API built with FastAPI and SQLite for managing a personal video game collection. Developed as part of XJCO3011 Web Services and Web Data module at the University of Leeds.
- Full CRUD operations for game entries (Create, Read, Update, Delete)
- Filter games by platform and play status
- Title keyword search across the collection
- Collection statistics endpoint
- Genre and platform analytics
- 50 pre-loaded game entries across PC, PS5, Switch and Xbox
- Input validation with Pydantic v2
- Auto-generated interactive API documentation via Swagger UI
- Framework: FastAPI 0.115.0 (Python 3.13)
- Database: SQLite via SQLAlchemy ORM
- Validation: Pydantic v2
- Server: Uvicorn
game-collection-api/
├── main.py # App entry point, stats and analytics endpoints
├── database.py # Database engine and session management
├── models.py # SQLAlchemy Game model
├── schemas.py # Pydantic request/response schemas
├── seed_data.py # 50-entry sample dataset loader
├── routers/
│ ├── __init__.py
│ └── games.py # CRUD and search route handlers
├── docs/
│ └── api_documentation.pdf
├── requirements.txt
└── README.md
git clone https://github.com/CyrDuck/game-collection-api.git
cd game-collection-apipython -m venv venv
venv\Scripts\activatepip install -r requirements.txtuvicorn main:app --reloadpython seed_data.py- Swagger UI: http://127.0.0.1:8000/docs
- Base URL: http://127.0.0.1:8000
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
API info and version |
| GET | /health |
Server health check |
| GET | /stats |
Collection statistics (total, by status) |
| GET | /stats/genres |
Game count grouped by genre |
| GET | /stats/platforms |
Game count grouped by platform |
| POST | /games/ |
Add a new game to the collection |
| GET | /games/ |
List all games (supports filtering) |
| GET | /games/{id} |
Get a specific game by ID |
| PUT | /games/{id} |
Update a game entry |
| DELETE | /games/{id} |
Delete a game entry |
| GET | /games/search/title |
Search games by title keyword |
| Status | Meaning |
|---|---|
wishlist |
Games you want to play |
playing |
Currently playing |
completed |
Finished |
dropped |
Stopped playing |
# Add a new game
curl -X POST http://127.0.0.1:8000/games/ \
-H "Content-Type: application/json" \
-d '{
"title": "Elden Ring",
"platform": "PC",
"genre": "RPG",
"release_year": 2022,
"status": "completed",
"rating": 9.5,
"notes": "Masterpiece open world RPG"
}'
# Filter games by platform and status
GET http://127.0.0.1:8000/games/?platform=PC&status=completed
# Search by title
GET http://127.0.0.1:8000/games/search/title?q=ringFull API documentation including all endpoints, parameters, request/response examples and error codes:
See technical_report.pdf submitted via Minerva for full design justification, architecture decisions, testing approach, and Generative AI declaration.