Basic env and description
This commit is contained in:
parent
b5261ba0f6
commit
246ef4c829
9 changed files with 237 additions and 163 deletions
78
README.md
78
README.md
|
|
@ -1,3 +1,79 @@
|
|||
# kronos
|
||||
|
||||
Share events between services.
|
||||
Share events between services.
|
||||
|
||||
## Setup
|
||||
|
||||
Nix is required.
|
||||
|
||||
- Set up environment.
|
||||
|
||||
```bash
|
||||
direnv allow
|
||||
```
|
||||
|
||||
- Set up pre-commit hooks.
|
||||
|
||||
```bash
|
||||
pre-commit install
|
||||
```
|
||||
|
||||
- Install as editable package.
|
||||
|
||||
```bash
|
||||
pip install -e .
|
||||
```
|
||||
|
||||
## Run
|
||||
|
||||
Once installed, run:
|
||||
|
||||
```bash
|
||||
kronos
|
||||
```
|
||||
|
||||
TODO: add parameters.
|
||||
TODO: add info on how to run as a Podman service.
|
||||
|
||||
## High level design
|
||||
|
||||
`kronos` is an application able to sync events from a single source of truth to multiple consumer services.
|
||||
E.g., an event defined by Mobilizon is modified -> Discord, Meetup, any other, are updated.
|
||||
|
||||
It is deployed as a Docker container, running as a service.
|
||||
Persistent storage is required for SQLite database.
|
||||
Secrets management is used to handle credentials.
|
||||
`systemd` timer is configured to trigger the app.
|
||||
E.g., `kronos` is being run every three hours to perform events update.
|
||||
|
||||
Each app run performs the following:
|
||||
- Request event data from source of truth service (e.g., Mobilizon).
|
||||
- Compare event data between received and stored in the database.
|
||||
- Update if new data available (last change date is later than known).
|
||||
- Stop execution otherwise.
|
||||
- Send updates event data to consumers.
|
||||
|
||||
```plain
|
||||
┌───────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
│ │
|
||||
│ CONTAINER │
|
||||
│ │
|
||||
│ ┌───────────────┐ ┌────────┐ │
|
||||
│ │ │ │ │ │
|
||||
│ │ systemd timer │ │ volume │ │
|
||||
│ │ │ │ │ │
|
||||
│ └───────┬───────┘ └────┬───┘ │
|
||||
│ │ │ │
|
||||
│ ┌────────────────────┴────────────────────────────┼─────────────────────────────────────────┐ │
|
||||
│ │ │ │ │
|
||||
│ │ APP │ │ │
|
||||
│ │ ┌───────────────┐ ┌────┴─────┐ ┌────────────────┐ │ │
|
||||
│ │ trigger │ │ event data │ │ event data │ │ │ │
|
||||
│ │ ──────────►│ data provider ├──────────────►│ database ├───────────────►│ data consumers │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
│ │ └───────────────┘ └──────────┘ └────────────────┘ │ │
|
||||
│ │ │ │
|
||||
│ └───────────────────────────────────────────────────────────────────────────────────────────┘ │
|
||||
│ │
|
||||
└───────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue