FastAPI Boilerplate

screenshot of FastAPI Boilerplate

An extendable async API using FastAPI, Pydantic V2, SQLAlchemy 2.0, PostgreSQL and Redis.

Overview:

FastAPI boilerplate is designed to create an extendable async API using FastAPI, Pydantic V2, SQLAlchemy 2.0, and PostgreSQL. It incorporates various technologies and features such as user authentication with JWT, Redis caching, ARQ job queues, Docker Compose, NGINX for reverse proxy and load balancing, and more. It aims to provide a flexible and efficient solution for building APIs.

Features:

  • Fully async: The boilerplate is designed to be fully asynchronous, leveraging the benefits of async programming in Python.
  • Pydantic V2 and SQLAlchemy 2.0: It utilizes Pydantic V2 for data validation and SQLAlchemy 2.0 as a SQL toolkit and Object Relational Mapper.
  • User authentication with JWT: It provides user authentication functionality using JSON Web Tokens (JWT).
  • Cookie based refresh token: The boilerplate allows for cookie-based refresh token authentication.
  • Easy redis caching: It provides easy integration with Redis for caching purposes.
  • Easy client-side caching: The boilerplate supports easy client-side caching.
  • ARQ integration for task queue: It integrates ARQ, a job queue and RPC library, with asyncio and Redis.
  • Efficient querying with support for joins: The boilerplate supports efficient querying by only retrieving the necessary data, with support for joins.
  • Out of the box pagination support: It includes support for pagination out of the box.
  • Rate Limiter dependency: The boilerplate includes a rate limiter dependency to limit the number of requests.
  • FastAPI docs behind authentication: It allows for securing FastAPI documentation behind authentication and hiding it based on the environment.
  • Easily extendable: The boilerplate is designed to be easily extendable, allowing developers to add their own custom functionality.
  • Flexible: It offers flexibility in terms of configuration and customization.
  • Easy running with Docker Compose: It provides a simple way to run all the services using Docker Compose.
  • NGINX Reverse Proxy and Load Balancing: The boilerplate includes NGINX for reverse proxy and load balancing, ensuring high performance and low resource consumption.

Summary:

FastAPI boilerplate is a comprehensive solution for building extensible async APIs using FastAPI, Pydantic V2, SQLAlchemy 2.0, and PostgreSQL. It offers a range of features including user authentication, caching, job queues, rate limiting, and more. The boilerplate aims to provide a flexible and efficient framework for developing APIs and can be easily customized and extended to meet specific requirements. With its support for Docker Compose and NGINX, it simplifies the deployment and scalability of the API.

fullstack
Fullstack

A fullstack boilerplate provides a starter application that includes both frontend and backend. It should include database, auth, payments, user roles and other backend services to build a fully featured saas or webapps.

docker
Docker

A website that uses Docker for containerization to streamline development, testing, and deployment workflows. This includes features such as containerization of dependencies, automated builds and deployments, and container orchestration to ensure scalability and availability.