An open API service indexing awesome lists of open source software.

https://github.com/one-zero-eight/rooms

API of InNoHassle Rooms
https://github.com/one-zero-eight/rooms

fastapi innohassle python

Last synced: 4 months ago
JSON representation

API of InNoHassle Rooms

Awesome Lists containing this project

README

          

# Rooms API in InNoHassle ecosystem

## Development

### Getting started

1. Install Python 3.12

2. Install Poetry

3. Install dependencies
```bash
poetry install
```

4. Set up pre-commit hook
```bash
poetry run pre-commit install
```

5. Set up settings file.
```bash
cp example.env .env
```

6. Create postgres database or via Docker.
```bash
docker-compose -f docker-compose-local-db.yaml up -d --build
```

## Run

```bash
poetry run fastapi dev src/main.py
```

### Via Docker

Check the `DB_URL` setting in `.env` file.
```bash
docker build . -t innohassle-rooms-api
```
```bash
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](https://github.com/one-zero-eight/rooms-bot/).

[docker-compose-global.yaml](docker-compose-global.yaml) is used to set up all Rooms services.