Python server that receives door events, sends Telegram messages based on them and exposes SpaceAPI endpoints. There was a need for a centralized information system about the student associations spaces being open - and available to visit. The information should be easily accessible, that's why there is integration with Telegram available.
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
alembic upgrade head
fastapi dev main.py
OpenAPI docs will be at http://localhost:8000/docs
You can use manage.py to add a new space to the database:
python manage.py create-space --help
python manage.py delete-space --help
curl -X POST "http://localhost:8000/space_events/1/open" -u ModeemiDummySpace:dummy_password
curl -X POST "http://localhost:8000/space_events/1/close" -u ModeemiDummySpace:dummy_password
pytest
podman build -t doors:latest .
mkdir -p ~/.config/containers/systemd/
cp doors.container ~/.config/containers/systemd/
systemctl --user daemon-reload
systemctl --user start doors
journalctl --user -u doors
sudo loginctl enable-linger $USER
And put it behind your favorite TLS enabled reverse-proxy.
alembic revision --autogenerate -m "Description of changes"
alembic upgrade head
Downgrade one step:
alembic downgrade -1