Skip to content

A simple SQLAlchemy/asyncpg/FastAPI application (Welltory test assignment)

License

Notifications You must be signed in to change notification settings

rabdulatipoff/welltory-assignment

Repository files navigation

Heart Rates Queries

This is a service which is able to store and query heart rate data for different categories of users (operating on randomly generated fixtures at this point).

Table of Contents

Python version

Please make sure that you are using Python 3.12+ for virtualenv and running the application (refer to the version used in Dockerfile).

Running locally

  1. Install dependencies:
# It is advised to create a virtualenv first
$ virtualenv -p python3.12 ./.venv
$ source .venv/bin/activate

$ pip install -r requirements.txt
  1. Provide a .env configuration & modify values if needed:
# Use .env.local to use DB available on `localhost`
$ cp .env.localhost .env
$ . ./.env
  1. Provide Postgres (skip if already running on the host):
$ docker compose up db -d
  1. Run the application:
$ fastapi prod main.py --port $APP_PORT

Running with Docker Compose

  1. Provide a .env configuration & modify values if needed:
$ cp .env.compose .env
$ . ./.env
  1. Build the Docker image and start Compose services in detached mode:
$ docker compose up --build -d
  1. Observe logs with:
$ docker compose logs app -f

Explore the API in a browser (APP_PORT is set to 8000 by default):

https://localhost:8000/docs

About

A simple SQLAlchemy/asyncpg/FastAPI application (Welltory test assignment)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published