FastAPI project Template generator to make your life easier 🧬 🚀
Simple FastAPI project template with Docker, Alembic, PostgreSQL, Poetry and pre-commit to kickstart your new projects.
Go to the directory where you want to create your project and run:
pip install cookiecutter
cookiecutter https://github.com/Lolomgrofl/fastapi-genesis.git
├── .github <- GitHub deployment workflow
│
├── alembic <- Alembic migrations
│
├── app <- Source code of the application (the main package)
│ ├── daos <- Data Access Objects (DAOs) to interact with the database
│ ├── models <- SQLAlchemy models (the database schema)
│ ├── routers <- FastAPI routers (endpoints)
│ ├── schemas <- Pydantic schemas for request and response models
│ ├── services <- Business logic layer (services)
│ ├── db.py <- Database initialization and session management code
│ ├── main.py <- FastAPI application instance and startup code
│ └── settings.py <- Settings management code (using pydantic settings)
│
├── scripts <- Scripts to perform various tasks like alembic migrations, etc.
│
├── static <- Static files like images, documents, etc.
│
├── tests <- Unit tests, one subdirectory per application module
│
├── .env <- Environment variables. Should not be committed to VCS
│
├── .gitignore <- Files and directories to be ignored by git
│
├── .pre-commit-config.yaml <- Configuration of pre-commit hooks (see https://pre-commit.com/)
│
├── alembic.ini <- Alembic configuration file
│
├── docker-compose.yml <- Docker compose configuration file
│
├── Dockerfile <- Dockerfile for building the image of the application
│
├── Makefile <- Makefile with useful commands for development and project setup
│
├── pyproject.toml <- Python dependencies for Poetry (see https://python-poetry.org/)
│
├── README.md <- File with useful information about the project and how to use it
- Register a new user
- Login with the new user
- Change password
- Get all users
- Delete user by id
- Delete all users
repo_name
: Name of the project repository (e.g. my_project
)app_container_name
: Name of the Docker container for the FastAPI application server inside docker-compose.yaml
fileapp_service_port
: Port on the host machine to which the FastAPI application will be exposed inside docker-compose.yaml
file and Dockerfile
db_container_name
: Name of the Docker container for the PostgreSQL database server inside docker-compose.yaml
filedb_service_port
: Port on the host machine to which the PostgreSQL database server will be exposed inside docker-compose.yaml
filepgadmin_container_name
: Name of the Docker container for the pgAdmin web interface inside docker-compose.yaml
filepgadmin_service_port
: Port on the host machine to which the pgAdmin web interface will be exposed inside docker-compose.yaml
filenetwork_name
: Name of the Docker network that will be created inside docker-compose.yaml
fileThis project is licensed under the terms of the MIT license.