Fastapi Fullstack Boilerplate

screenshot of Fastapi Fullstack Boilerplate

A full stack (monolith) boilerplate for FastAPI

Overview:

The FastAPI Full-Stack Boilerplate is a modern, async Python web framework that combines the goodness of FastAPI with seamless Jinja2 templating, SQLAlchemy ORM and Alembic migrations for PostgreSQL, and Flask-Admin for easy administration. It provides a convenient way to set up a full-stack web application with features such as dependency injection, OpenAPI integration, and the ability to rapidly build server-side applications.

Features:

  • Modern, async FastAPI: The boilerplate utilizes the FastAPI framework, which provides dependency injection and excellent OpenAPI integration.
  • Seamless Jinja2 templating: Similar to Flask, the boilerplate includes Jinja2 templates for easy rendering of dynamic content.
  • SQLAlchemy ORM and Alembic migrations: The boilerplate integrates SQLAlchemy ORM for convenient database operations and Alembic migrations for seamless database schema management.
  • Flask-Admin: The famous admin panel from Flask is included in the boilerplate, allowing for easy administration of the application.
  • Pipenv for python dependency management: Pipenv is used for managing Python dependencies, ensuring a controlled environment for the application.
  • FASTAPI_STATICDIGEST_RELOAD environment variable: This variable enables automatic reloading of the application during development.
  • Configuration customization: The database configuration and credentials can be easily changed in the .env and docker-compose.yaml files.
  • DEBUG_ADMIN environment variable: Setting this variable to 1 disables authorization for the admin panel, allowing for easier development and testing.

Summary:

The FastAPI Full-Stack Boilerplate combines the modern features of FastAPI with additional libraries such as Flask-Admin and Jinja2 templates. It provides a convenient starting point for building full-stack web applications with FastAPI, offering seamless integration with SQLAlchemy ORM and Alembic migrations for database management. With easy customization options and dependency management through Pipenv, the boilerplate offers a powerful foundation for building robust web applications.