one-zero-eight / rooms

API of InNoHassle Rooms
MIT License
2 stars 0 forks source link
fastapi innohassle python

Rooms API in InNoHassle ecosystem

Development

Getting started

  1. Install Python 3.12

  2. Install Poetry

  3. Install dependencies

    poetry install
  4. Set up pre-commit hook

    poetry run pre-commit install
  5. Set up settings file.

    cp example.env .env
  6. Create postgres database or via Docker.

    docker-compose -f docker-compose-local-db.yaml up -d --build

Run

poetry run fastapi dev src/main.py

Via Docker

Check the DB_URL setting in .env file.

docker build . -t innohassle-rooms-api
docker run --rm -ti -d -p 80:80 --env-file .env innohassle-rooms-api

Usage

Send requests with X-Token header (generated by src.api.auth.utils.create_jwt({'sub': 'tgbot'})) to verify you are the bot.

docker-compose-global.yaml is used to set up all Rooms services.