Skip to content

Latest commit

Β 

History

History
124 lines (81 loc) Β· 2.92 KB

File metadata and controls

124 lines (81 loc) Β· 2.92 KB

🎞️ Movie Catalog

A FastAPI-based application for managing and browsing a movie catalog. Designed with scalability and developer experience in mind.

CI FastAPI Python version mypy: strict code style: ruff uv: managed codecov


πŸš€ Features

  • 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)

πŸ§‘β€πŸ’» Getting Started

πŸ› οΈ Setup

  1. Clone the repository:
    git clone https://github.com/your-username/movie-catalog.git
    cd movie-catalog
    
    
  2. Mark the movie-catalog directory as "Sources Root" in your IDE (for better imports).

πŸ“¦ Install Dependencies

Use uv to install packages:

uv install

βš™οΈ Configure Pre-commit Hooks

Install and activate pre-commit:

pre-commit install

This ensures formatting, linting, and other checks before each commit.


πŸš€ Run Development Server

  1. Ensure you're in the working directory:

    cd movie_catalog
  2. Make sure Redis is running:

    docker run -d -p 6379:6379 redis
  3. Start the FastAPI dev server:

    fastapi dev

The server will be available at http://localhost:8000.


βœ… Running Tests

  1. Make sure that the Redis test container is running.:

    docker run -d -p 6380:6380 redis
  2. Set env variables: REDIS_PORT=6380;TESTING=1

  3. Run the test suite:

    python -m unittest -v

    or with coverage

    coverage run -m unittest

πŸ§ͺ Useful Snippets

Generate a random secret key:

python -c "import secrets; print(secrets.token_urlsafe(16))"

πŸ‘¨β€πŸ”§ For Developers

  • Use a virtual environment (uv, venv, or poetry) 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.