Skip to content

ONSdigital/sdx-fastapi-boilerplate

Repository files navigation

sdx-fastapi-boilerplate

A boilerplate for creating fastapi services

Prerequisites

  • Python 3.13
  • UV (a command line tool for managing Python environments)

Installing Python 3.13

If you don't have Python 3.13 installed, you can install it via brew:

brew install [email protected]

Install UV:

  • This project uses UV for dependency management. Ensure it is installed on your system.
  • If UV is not installed, you can install it using:
curl -LsSf https://astral.sh/uv/install.sh | sh

OR 

brew install uv
uv --version

Install dependencies

This command will install all the dependencies required for the project, including development dependencies:

uv sync

If you ever need to update the dependencies, you can run:

uv sync --upgrade

Generate .env

To use environment variables, you need to create a .env file in the root directory of the project. You can copy the .env.example file and rename it to .env:

cp .env.example .env

Running the service

make dev

Linting

make lint

Formatting

make format

Tests

make test

Dockerize

docker build -t myapp .

About

A boilerplate for creating fastapi services

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published