A FastAPI-based application for managing and browsing a movie catalog. Designed with scalability and developer experience in mind.
- FastAPI-powered backend
- REST API for movies
- Async support
- Integrated testing setup
- Pre-commit hooks for clean code
- Redis support (for caching or other async tasks)
- Clone the repository:
git clone https://github.com/your-username/movie-catalog.git cd movie-catalog
- Mark the
movie-catalog
directory as "Sources Root" in your IDE (for better imports).
Use uv
to install packages:
uv install
Install and activate pre-commit:
pre-commit install
This ensures formatting, linting, and other checks before each commit.
-
Ensure you're in the working directory:
cd movie_catalog
-
Make sure Redis is running:
docker run -d -p 6379:6379 redis
-
Start the FastAPI dev server:
fastapi dev
The server will be available at http://localhost:8000
.
-
Make sure that the Redis test container is running.:
docker run -d -p 6380:6380 redis
-
Set env variables: REDIS_PORT=6380;TESTING=1
-
Run the test suite:
python -m unittest -v
or with coverage
coverage run -m unittest
Generate a random secret key:
python -c "import secrets; print(secrets.token_urlsafe(16))"
- Use a virtual environment (
uv
,venv
, orpoetry
) to manage dependencies. - Follow PEP8 style guidelines (auto-enforced via
pre-commit
). - Use descriptive commit messages (consider Conventional Commits).
- Document public endpoints and services clearly with docstrings and OpenAPI schemas.