The FastAPI Boilerplate is a powerful framework for quickly creating web applications using FastAPI. It provides a range of features and functionalities to streamline the development process.
- Async SQLAlchemy session: Allows for asynchronous database queries using SQLAlchemy.
- Custom user class: Provides a customizable user class for authentication and authorization.
- Top-level dependency: Supports setting a callable function for initializing the FastAPI application.
- Dependencies for specific permissions: Includes pre-implemented permission dependencies such as IsAdmin, IsAuthenticated, and AllowAll.
- Celery integration: Supports running background tasks using Celery.
- Dockerize (Hot reload): Enables Dockerization of the application with hot reload functionality.
- Event dispatcher: Allows for event dispatching to handle specific actions or triggers.
- Cache: Provides caching functionality by prefix or tag, with support for custom key builders and backends.
- Multiple databases: Supports multiple databases with configuration options in the core/config.py file.
To install the FastAPI Boilerplate, follow these steps:
- Clone the repository:
git clone <repository_url>
- Navigate to the project directory:
- Install the project dependencies:
pip install -r requirements.txt
- Update the database URLs in the
core/config.py file under the
- Customize the custom user class by modifying the
authentication.py files in the
core/fastapi/middlewares directories, respectively.
The FastAPI Boilerplate is a comprehensive framework for building web applications using FastAPI. It offers features such as async SQLAlchemy session, custom user class, top-level dependencies, specific permissions, Celery integration, Dockerize, event dispatcher, cache, and support for multiple databases. With its ease of installation and extensive feature set, the FastAPI Boilerplate is an ideal choice for developers looking to accelerate their web application development process.