Skip to content

Latest commit

 

History

History
69 lines (54 loc) · 1.74 KB

File metadata and controls

69 lines (54 loc) · 1.74 KB

Backend Service

Here you find all the important development information about the backend service.

Dependencies

Development:

Development

Backend Setup

  1. Install uv:
    curl -LsSf https://astral.sh/uv/install.sh | sh
  2. Install python version 3.13:
    uv python install 3.13
  3. Run the backend:
    uv run fastapi dev

The backend creates missing tables automatically on startup.

Linting (run inside service folder)

Use the following command to reformat the files:

uv run ruff format

Use the following command to show the lint results:

uv run ruff check

Use the following command to fix fixable mistakes:

uv run ruff check --fix

Testing

Here is a link to a fastapi tutorial link Here is a link to the pytest documentation link

Use the following command to run the tests:

uv run pytest

Coverage

The test coverage is generated using the pytest-cov plugin. To generate a coverage report, run the following command: The --cov-report=html option generates an HTML report. You can omit this option if you only want the terminal output.

uv run pytest --cov=app --cov-report=html

We need a coverage of at least 95% to be able to merge the PR. You can check the coverage with the following command:

uv run coverage report --fail-under=95