Skip to content

FastAPI template that include auth and user endpoints, corresponding SQLalchemy and Pydantic models, alembic migration, docker compose with API itself and PostreSQL database

License

Notifications You must be signed in to change notification settings

ZolotarevAlexandr/fast_api_hackathon_template

Repository files navigation

How to run

How to run locally

  1. Install Python 3.12+, uv, Docker.
  2. Install project dependencies with uv.
    uv sync
  3. Copy settings.example.yaml to settings.yaml and add token:
    cp settings.example.yaml settings.yaml
  4. Start Postgres:
    docker compose up db
  5. Start development server:
    cd backend
    uv run -m src.api

Important

For endpoints requiring authorization, click "Authorize" button in Swagger UI!

Tip

Edit settings.yaml according to your needs, you can view schema in settings.schema.yaml.

How to run in docker

  1. Copy the file with settings: cp settings.example.yaml settings.yaml.
  2. Change settings in the settings.yaml file according to your needs (check settings.schema.yaml for more info).
  3. Install Docker with Docker Compose.
  4. Build and run docker container: docker compose up --build.

Code generation

Tip

Project also includes simple CRUD code generator. See more in corresponding readme

About

FastAPI template that include auth and user endpoints, corresponding SQLalchemy and Pydantic models, alembic migration, docker compose with API itself and PostreSQL database

Topics

Resources

License

Stars

Watchers

Forks