Skip to content

Light-it-labs/fastapi-template

Repository files navigation

fast-api-template

Auth Service in FastAPI

Install dependencies

  1. Install Poetry. pip install poetry
  2. Access Poetry shell. poetry shell
  3. Install dependencies. poetry install

Run dockerized project

Run cp .env.example .env Run docker-compose up -d

Migrations

Migrations can be autogenerated using the generate_migrations.sh script.

Linters

We use ruff as linter, to run them on pre-commit please run pre-commit install.

Tests

  • You can run tests locally by running ./tests-start.sh (this will use your local database).
  • Tests can also run in docker container with the following command: docker-compose exec api ./tests-start.sh.

Emails

For local development we use mailpit. With the application running, you can access it through localhost:8025 by default. If needed, the port can be configured via the FORWARD_MAILPIT_DASHBOARD_PORT env variable.

The email client is instantiated during app bootup in main.py via app.emails.set_client, and the EmailService will use that instance by default.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages