A professional, scalable, and production-ready template for backend applications built with FastAPI. This repository is designed to simplify development, ensure maintainability, and provide robust testing capabilities, making it an ideal starting point for your next project.
- FastAPI: A high-performance web framework for building APIs with Python, leveraging asynchronous features for speed and scalability.
- PostgreSQL: A robust relational database system supporting complex queries and transactions.
- Alembic: An efficient database migration tool to manage schema changes with version control.
- Docker: Ensures consistent application behavior across environments, simplifying development and deployment.
- Pytest: Enables comprehensive unit and integration testing for improved reliability.
- Async CRUD Operations: Provides fully asynchronous Create, Read, Update, and Delete operations for high-concurrency scenarios.
- Flower (Optional): Workflow monitoring and management for background tasks with Celery.
- Performance and Scalability: Asynchronous processing and robust database integration handle high-traffic applications effortlessly.
- Ease of Development: Dockerized setup ensures consistency across development, testing, and production environments.
- Enhanced Reliability: Comprehensive testing with Pytest reduces bugs and ensures code stability.
- Modern Architecture: Adheres to contemporary software development best practices, supporting scalability and maintainability.
- API-Driven Applications: Build RESTful APIs with FastAPI and PostgreSQL.
- Microservices: Create scalable and containerized microservices with Docker.
- Data-Intensive Systems: Handle high-concurrency data processing with async operations.
- Task Automation: Monitor and manage workflows for background tasks using Celery and Flower.
-
Clone the repository:
git clone https://github.com/your-username/fastapi-backend-starter-kit.git cd fastapi-backend-starter-kit
-
Set up the virtual environment:
export PIPENV_VENV_IN_PROJECT=1 pipenv shell
-
Install dependencies:
make install
-
Build Docker images:
make build
-
Apply migrations:
make makemigrations make migrate
-
Start the application:
make run
Access the application at http://localhost:8000
.
- PgAdmin4: Manage your PostgreSQL database at
http://localhost:5050
. - Flower: Workflow monitoring at
http://localhost:5556
.
Run tests using Pytest:
make test
- Swagger UI:
http://localhost:8000/docs
- ReDoc:
http://localhost:8000/redoc
Contributions are welcome! Please follow the guidelines below:
- Fork the repository.
- Create a feature branch.
- Commit your changes.
- Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
Start building your next scalable backend application with ease and confidence using this FastAPI Backend Starter Kit.