FastAPI Production Boilerplate

screenshot of FastAPI Production Boilerplate

A scalable and production ready boilerplate for FastAPI

Overview:

The FastAPI Production Template is a scalable and production-ready boilerplate for FastAPI. It follows a layered architecture with a model layer, a repository layer, a controller layer, and an API layer. The directory structure is designed to isolate boilerplate code within the core directory, making it easy for developers to quickly develop new features. The template also includes commonly used features such as authentication, authorization, database migrations, type checking, and more.

Features:

  • Python 3.11+ support: The template supports the latest version of Python.
  • SQLAlchemy 2.0+ support: It includes support for the SQLAlchemy ORM.
  • Asynchronous capabilities: FastAPI's async features can be utilized in the template.
  • Database migrations using Alembic: Database migrations are made easy with Alembic.
  • Basic Authentication using JWT: JWT-based authentication is provided out-of-the-box.
  • Row Level Access Control: Fine-grained permissions control can be implemented.
  • Redis for caching: Redis is integrated for caching purposes.
  • Celery for background tasks: Celery is included for running asynchronous background tasks.
  • Testing suite: A testing suite is available for writing unit tests.
  • Type checking using mypy: Mypy can be used for static type checking.
  • Dockerized database and redis: The template includes Docker configurations for setting up a database and Redis.
  • Readily available CRUD operations: Common CRUD operations are pre-implemented.
  • Linting using pylint: Pylint can be used for code linting.
  • Formatting using black: The code can be automatically formatted using Black.

Summary:

The FastAPI Production Template is a powerful and ready-to-use boilerplate for building scalable FastAPI applications. Its layered architecture and predictable directory structure make it easy to develop new features. The template includes a wide range of features commonly used in production applications, such as authentication, authorization, caching, background tasks, and more. With its comprehensive installation guide, developers can quickly set up and start using the template for their projects. Overall, the FastAPI Production Template aims to provide a better developer experience and facilitate the development of production-ready FastAPI applications.

template
Templates & Themes

A template or theme refers to a pre-designed layout or structure that provides a basic framework for building a specific type of application or website. It typically includes good design, placeholder content and functional features, allowing developers to customize and fill in the details according to their specific needs.