PoolPay consists of encrypted storage (called “vault”), a Python backend, a tightly-coupled customer UI (shown on a display mounted to the Raspberry Pi) and an admin UI as well as admin tools.
## Backend
The backend is started automatically by a Systemd unit on boot. It has a database stored in the vault, and manages basically everything that happens: It listens for signals from the card reader or the touch screen, checks the database for the user, changes the stored amount, and tells the customer UI to show something (via the director).
One thing is somewhat tricky: If the vault is locked (i.e., the password is not currently available in RAM, so the data cannot be decrypted, so the database cannot be read), the backend cannot run regularly. This is the case at least after every reboot.
To fix this, we built the _wire_. The wire consists of an HTTP server started by the backend and an HTTP client in the admin tools. If the backend is started and the vault is still locked, it doesn't even try to run regularly, instead, it just sits there and waits. At some point, an admin will use the admin tools to send the password to the HTTP server over the wire. As soon as the backend receives the password, it can unlock the vault and run regularly.
### Things To Look At
-[🐍 `poolpay.model`](../poolpay/model/) to see the (rather simple) model
-[🐍 `poolpay.__main__`](../poolpay/__main__.py) to see how the backend is actually launched
-[🐍 `poolpay.wire`](../poolpay/wire/) for the wire over which the vault password is sent
## Vault
<!-- TODO -->
### Things To Look At
-[🐍 `poolpay.vault`](../poolpay/vault/)
-[🌐 Create an encrypted file vault on Linux](https://opensource.com/article/21/4/linux-encryption)
## Customer UI
<!-- TODO -->
## Admin UI & Admin Tools
<!-- TODO -->
### Things To Look At
-[🐍 `poolpay.admin`](../poolpay/admin/) which contains the (standalone runnable) admin UI and admin tools