Skip to content

eduardomatoss/fastapi-simple-starter-project

Repository files navigation

fastapi-simple-starter-project

Simple API project starter with FastAPI

Python 3.10 PEP20 PEP8 bandit Code style: black

Technology and Resources

Please pay attention on pre-requisites resources that you must install/configure.

API Docs

Routes

  • /: The root path is a redirect to /docs
  • /docs: Swagger
  • /redoc: Redoc
  • /health-check: Verify sure the application is up
  • /metrics: Get prometheus metrics data

How to Install

make local/install

How to Build

make docker/build

Running Migrations

Generating migrations

make docker/migrations/generate

Applying changes on the database

make docker/migrations/upgrade

If you want to know more about migrations, please read the alembic) docs.

How to Run

make local/run
make docker/run

The project will be running at http://localhost:8000/

The entrypoint of this project is the run.py file on the root path.

How to Test

make local/test
make docker/test

How to lint

make docker/lint or make local/lint to lint

make docker/bandit or make local/bandit to execute the bandit check

make docker/check-packages or make local/check-packages to check for packages vulnerabilities

Helpful commands

Please, check all available commands in the Makefile for more information.

Extras infos

  • If you use the vscode editor we have some examples of launch.json to speed up your tests.

    Note: When you run the install command (using docker or locally), a .env file will be created automatically based on env.template