joaoflaviosantos / fastapi-async-sqlmodel-boilerplate

A fully asynchronous FastAPI boilerplate. Built for extensibility and speed, it incorporates FastAPI, SQLModel, Alembic, PostgreSQL, Redis, and ARQ. ๐Ÿš€
MIT License
18 stars 1 forks source link
alembic api-rest api-restful arq asynchronous backend fastapi postgresql pydantic pydantic-v2 pytest python redis sqlalchemy sqlalchemy2 sqlmodel tasks uvicorn worker

FastAPI Async SQLModel Boilerplate

Supercharge your FastAPI development. A backend for perfectionists with deadlines and lovers of asynchronous programming.

White and blue rocket with FastAPI text on it. A Python logo floating next to the rocket.

Python FastAPI SQLModel Pydantic SQLAlchemy PostgreSQL Redis Docker NGINX

๐Ÿ” Project Overview

This FastAPI boilerplate for high-performance APIs leverages async programming alongside libraries such as SQLModel, Redis, ARQ, NGINX, and Docker. It follows a Django-inspired folder structure for a clear, modular codebase. Key areas like system/tiers, admin/users and blog/posts showcase the optimal balance between modularity and clarity.

It aims to provide a robust structure while serving as an excellent tool for quick POC (Proof of Concept) validations and MVP (Minimum Viable Product) launches. Crafted to attract enthusiasts who appreciate how Django operates, this project offers a solid foundation for API development, incorporating a blend of cutting-edge technologies and structural principles.

๐ŸŒŸ Key Features

This project seeks to provide a strong foundation for API development, incorporating a blend of cutting-edge technologies and structural principles:

๐ŸŽฏ Project Goals

๐Ÿ“‹ Prerequisites

Before you begin, ensure you have the following prerequisites installed and configured:

Note: Soon, there will be an additional option for development using Docker containers.

Installing Poetry

Poetry is a dependency manager for Python. Follow the steps below to install Poetry:

  1. Open a terminal.

  2. Run the following command to install Poetry using pip:

    pip install poetry
  3. Verify the installation by running:

    poetry --version

    This should display the installed Poetry version.

Now that the requirements are met, you can begin working on your project.

๐Ÿค– Running the Project CLI

To streamline the usage of this boilerplate, we've provided a convenient CLI tool. From the root project directory, execute the following steps:

  1. Clone the repository, running the following command:
git clone https://github.com/joaoflaviosantos/fastapi-async-sqlmodel-boilerplate.git
  1. Navigate to the cloned repository:
cd fastapi-async-sqlmodel-boilerplate
  1. Run the setup (CLI tool) command:
python3 setup.py

This command automates various setup tasks, making it easier to get started with the project.

For more details for a manual setup, please refer to the Backend README section.

๐ŸŒ Reference Projects

Feel free to use this boilerplate as a starting point for your own projects, and adapt it based on your specific requirements and use cases. Happy coding! ๐ŸŒŸ