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/).
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
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'