Implement of a useless machine as an event-driven web app, which needs to comply to a fictitious overly bureaucratic process.
To quickly spool up the application, please use Docker Compose. E.g. on Ubuntu systems:
sudo apt install docker-compose-v2
docker compose up
This will expose a webserver on port 8000 on your host. The API will be
available via the /api
prefix (see also the docs):
curl http://localhost:8000/api/switch
{"name":"switch","state":"off"}
Have fun with the useless machine. 🤣🥳
An external operator can toggle the switch.
Internally, the responsibilities are split up into different roles:
Role | Responsibility |
---|---|
Observer | Observe switch and request counter-measure from Manager. |
Manager | Can make the decision whether the switch should be toggled. |
Worker | Operates the switch. |
Auditor | Keeps a record of the toggling of the switch. |