Skip to content

mchiang9/FastAPIAsyncPGSQL-

Repository files navigation

User Guide

This is a template project that should be forked to create your own FastAPI application.

The application includes:

  1. FastAPI
  2. Postgres support
    1. SQLModel
    2. AsyncPG
    3. Alembic
    4. PGAdmin
  3. Poetry - package management
  4. Docker-Compose
    1. Prod DockerFile
    2. Dev DockerFile
    3. Prod Traefik DockerFile
    4. Dev Traefik DockerFile
  5. Traefik - proxy server
  6. PyTest
  7. Black - for linting

Installation:

To setup this application, one must have installed:

  • Python 3.10 or above
  • Docker
  • Postgres

Python

Note

The recommended Approach is to use Brew

Using Brew:

brew install python@3.10

Using official website:

https://www.python.org/downloads/

Docker

Engine:

https://docs.docker.com/engine/install/

Compose:

https://docs.docker.com/compose/install/

Note

Optionally install Docker Desktop

Install Docker Desktop:

https://docs.docker.com/desktop/#download-and-install

Postgres

https://www.postgresql.org/download/

Developer's Cookbook

Note

WIP

Basic Setup

Always create a new branch before working on your changes

To bring down containers

docker-compose down -v

To build the containers and bring them up again

docker-compose up --build

Generating migrations

To generate a new migration to ballot_db. Don't forget to add your model to /app/alembic/env.py

docker-compose exec web alembic revision --autogenerate -m <message>

To apply migration

docker-compose exec web alembic upgrade head

Branch name guidelines

  1. For features: feature/feature-name
  2. For bugs: bug/bug-name

Optional Downloads:

Super charge your development by installing PyCharm.

https://www.jetbrains.com/pycharm/ Make your editor auto-lint with black by following the steps here:

https://black.readthedocs.io/en/stable/integrations/editors.html

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published