Skip to content

Latest commit

 

History

History
85 lines (65 loc) · 1.27 KB

README.md

File metadata and controls

85 lines (65 loc) · 1.27 KB

Base FastAPI project

Base FastAPI Project

alt text

Technology stack

  1. FastAPI
  2. SQLAlchemy + Alembic
  3. PostgreSQL
  4. Redis
  5. Docker

Run

Run local environment stack

docker-compose up -d --build

Export local envs

cat .env.example > .env.local

export $(grep -v "^#" .env.local | xargs)

Install poetry

pip install poetry

Install the project dependencies

cd src && poetry install

Spawn a shell within the virtual environment

poetry shell

Run the server

uvicorn main:app --reload

Migrations

Generate new migration

alembic revision --autogenerate -m "Migration Name"

Run migrations

alembic upgrade head

Downgrade last migration

alembic downgrade -1

Development

Make lint, tests

cd src && make lint
cd src && make test

Branch naming

feature/{feature-name-in-kebab-case}  # branch with new functionality, code
fix/{fix-name-in-kebab-case}  # branch with fix changes

Commit messages

+ {message}  # adding new functionality, code
- {message}  # removing functionality, code
! {message}  # changing functionality, code