Skip to content
/ fastapi-template Public template

Quick start development with FastAPI, SQLAlchemy, Alembic and Pre-commit.

Notifications You must be signed in to change notification settings

yulio94/fastapi-template

Repository files navigation

FastAPI Template

Directory explanation:

├── config
├── migrations
│   └── versions
├── src
│   ├── entrypoints
│   ├── models
│   ├── routes
│   └── services
│   └── repositories
└── tests

config:

This folder is responsible to save configuration files like project constants or environment variables .

├── config
│   ├── conts.py
│   └── envs.py

migrations:

Alembic's migrations directory.

├── migrations
│   ├── README
│   ├── env.py
│   ├── script.py.mako
│   └── versions
│   └── 3034f17c14fe_.py

src:

Project source code.

├── src
│   ├── entrypoints
│   ├── models
│   ├── routes
│   └── services
│   └── repositories

entrypoints:

This directory is to split possible entrypoints to your application; i.e. http, cli, etc.

models:

Save sqlalchemy models.

routes:

FastAPI routes and dependencies, also you can add directories for versioning your API.

services:

Save files for handle interaction between routes and repositories.

repositories:

Save repositories that interact with models and the database.

tests:

Base code tests.

└── tests
└── conftest.py