Goal: Create an API that lists and manages movie/TV show data from a dataset. Focus on CRUD operations and clean data modeling.
- FastAPI
- PostgreSQL
- SQLAlchemy
Use the IMDb Movie Dataset or generate a smaller version with:
- Title
- Genre(s)
- Release year
- Duration
- Director
- Average rating
- GET /movies β list all movies
- GET /movies/{id} β get movie by ID
- GET /movies/search?genre=Action&year=2020 β filter
- POST /movies β add new movie
- PUT /movies/{id} β update
- DELETE /movies/{id} β delete
- Normalize genres into a separate table (many-to-many)
- Write efficient queries
- Work with PostgreSQL joins
- Handle numeric filters (ratings, year range)
Β
city_events_api/
βββ app/
β βββ __init__.py
β βββ main.py # FastAPI app instance
β βββ config.py # DB and app settings
β βββ models/
β β βββ __init__.py
β β βββ event.py # SQLAlchemy Event model
β βββ schemas/
β β βββ __init__.py
β β βββ event.py # Pydantic schemas
β βββ crud/
β β βββ __init__.py
β β βββ event.py # DB logic (CRUD operations)
β βββ api/
β β βββ __init__.py
β β βββ routes_event.py # API route definitions
β βββ db/
β β βββ __init__.py
β β βββ session.py # DB connection
β β βββ base.py # Base class for models
β βββ utils/
β βββ populate.py # Script to load fake or real data
βββ alembic/ # DB migrations
β βββ ...
βββ alembic.ini
βββ requirements.txt
βββ README.md