A terminal based dashboard for viewing the Cammie chat messages and other Zeus related data.
The project has 2 main parts:
A terminal interface built with bubbletea. It displays the Cammie chat messages and other Zeus data in a screen-based layout.
- Views: Reusable components responsible for rendering a single type of data (e.g. the TAP statistics).
- Screens: A combination of multiple views forming a single terminal screen.
Each view implements a shared interface, exposing methods for initialization, updating, and rendering. When a screen is loaded:
- Each view’s initial data is fetched automatically.
- Each view’s update loop runs in a goroutine, periodically checking for new data.
- The update loop communicates state changes back to the TUI.
This design allows each view to be self-contained and independently refresh its data.
However, not all data can be retrieved directly from persistent external services and that’s where the backend comes in.
The backend handles data aggregation and persistence.
- Exposes an API for incoming data.
- Maintaines websockets.
- Makes use of external API's.
Provides persistence data using Postgres for data that the external services do not retain.
- Download the golang version .tool-versions.
- Install make.
- Install the go tools:
make setup. - (Optional) Install the pre-commit hooks:
git config --local core.hooksPath .githooks/.
- Copy
.env.exampleto.env, setENV=developmentand populate the remaining keys. - (Optional) Edit the config file. The defaults work.
A Postgres database instance is provided via docker compose and started automatically when needed by the makefile. To use a custom database, update the config and edit the makefile.
- Migrate the database
make migrate. - Start the backend
make backend. - Start a TUI
make tuiand enter the desired screen name (if you're not using the makefile use the-screenflag to specify the screen).
- Backend: written to
./logs/backend.logand to stdout. - TUI: only written to
./logs/{screen}.log.
make create-migration: Create a new migration in the db/migrations directory.make query: Generate statically typed queries based on the .sql files in the db/queries directory. Add new queries to this directory as needed.make goose: Migrate one version up or down.make dead: Check for unreachable code.
- Set
ENV=productionin.env. - Provide a Postgres database.
- Populate the production config file.
- Build the binaries
make build. - Run both binaries with the desired flags.