1.6 KiB
1.6 KiB
Omukk FastAPI Template
Template repository for all FastAPI backend projects developed by Omukk.
Components
- Basic FastAPI dependencies
- Docker and Docker Compose for easier testing
- Alembic configuration for database migrations
- Initial codebase to start from
Using this template
-
Create a new repository from this template:
- In Omukk Repos, navigate to this repository
- Click the "Use this template" button at the top of the page
- Choose "Create a new repository"
- Fill in your new repository details and click "Create Repository"
-
Clone your new repository:
git clone git@git.omukk.dev/<username>/<repo>.git cd <repo>
Development and Testing
-
Install dependencies:
poetry install poetry run pre-commit install -
Run database server:
docker compose up db -d -
Run Dev Server:
poetry run fastapi dev -
Stop Database Server:
docker compose down db
Development Rules
-
Create a separate branch from
devand create a PR todevafter making changes -
Branch names must be meaningful. Check docs for more details
-
Always run
blackandisortto maintain code consistency (this is done automatically using pre-commit hooks)-poetry run isort app main.py poetry run black app main.py # Make sure to run isort first -
Use static type checking using
mypyif you feel like it (It is recommended but not mandatory). Static type checking might help you to identify critical bugs.