Skip to content

puavo-org/ktp-controller

Repository files navigation

ktp-controller

Makefile CI

Connection diagram:

                            :                   +-------+
                   Internet : Device            |  CLI  |
                            :                   +-o-----+
                            :                     | |
                            :                  WS | | HTTP
                            :                     | v
                            :                   +-o-----+
                            :                   |       |
                            :                   |  API  |
                            :                   |       |
                            :                   +-------+
+-----------------------+   :                     o ^                      +---------+
|      Exam-O-Matic     |<------(HTTPS)---+       | |       +--(HTTPS)---->| Abitti2 |
+-----------------------+   :             |    WS | | HTTP  |              +---------+
                      o     :             |       o |       |                  o
                      |     :             +-----+-------+---+                  |
                      |     :                   |       |                      |
                      +---------(WSS)----------o| Agent |o--------(WSS)--------+
                            :                   |       |
                            :                   +-------+

KTP Controller consists of two main components:

  • Agent
  • API

Agent communicates with all components (Exam-O-Matic, Abitti2 and API) and is responsible for making them play well together. It uses API to store necessary data in a persistent database storage.

The API application is built on FastAPI (https://fastapi.tiangolo.com/).

Dependencies of this project are managed with UV (https://github.com/astral-sh/uv).

The database access is abstracted with SQLAlchemy (https://www.sqlalchemy.org/).

Database migrations are handled by Alembic (https://alembic.sqlalchemy.org/en/latest/).

Processes are launched and kept running with Supervisor (https://supervisord.org/).

Development

Install development tools:

make dev-install

This installs uv to ~/.local/bin.

All other packages are installed BY uv to a separate virtual env.

Build a production bundle:

make build-prodbundle

Update dependencies

To update the lock file with new releases of all dependencies, and to record the set of packages to uv.lock, run:

make update-deps

If the set of packages is ok, remember to commit the lock file:

git commit uv.lock -m 'Update dependencies'

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages