scc

module
v0.0.0-...-06561dd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2025 License: MIT

README

Screen Cammie Chat

A terminal based dashboard for viewing the Cammie chat messages and other Zeus related data.

Overview

The project has 2 main parts:

1. TUI

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.

2. Backend

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.

Development

Prerequisites
  1. Download the golang version .tool-versions.
  2. Install make.
  3. Install the go tools: make setup.
  4. (Optional) Install the pre-commit hooks: git config --local core.hooksPath .githooks/.
Configuration
  1. Copy .env.example to .env, set ENV=development and populate the remaining keys.
  2. (Optional) Edit the config file. The defaults work.
Database

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.

Run
  1. Migrate the database make migrate.
  2. Start the backend make backend.
  3. Start a TUI make tui and enter the desired screen name (if you're not using the makefile use the -screen flag to specify the screen).
Logs
  • Backend: written to ./logs/backend.log and to stdout.
  • TUI: only written to ./logs/{screen}.log.
Useful commands
  • 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.

Production

  1. Set ENV=production in .env.
  2. Provide a Postgres database.
  3. Populate the production config file.
  4. Build the binaries make build.
  5. Run both binaries with the desired flags.

Directories

Path Synopsis
cmd
backend command
Main entry point for the backend
Main entry point for the backend
tui command
Main entry point for the tui
Main entry point for the tui
internal
buzzer
Package buzzer provides all interactions with the buzzer
Package buzzer provides all interactions with the buzzer
cmd
Package cmd provides all the commands to start parts of the application
Package cmd provides all the commands to start parts of the application
database/repository
Package repository interacts with the databank and returns models
Package repository interacts with the databank and returns models
server
Package server starts the API server
Package server starts the API server
server/dto
Package dto forms the bridge between the api data and the internal models
Package dto forms the bridge between the api data and the internal models
tap
Package tap provides all tap related logic
Package tap provides all tap related logic
zess
Package zess provides all zess related logic
Package zess provides all zess related logic
pkg
config
Package config lets you retrieve config variables
Package config lets you retrieve config variables
date
Package date makes working with dates without timezones easier
Package date makes working with dates without timezones easier
db
Package db connects with the databank
Package db connects with the databank
logger
Package logger initiates a zap logger
Package logger initiates a zap logger
lyrics
Package lyrics provides a way to work with both synced and plain lyrics
Package lyrics provides a way to work with both synced and plain lyrics
utils
Package utils contains various util functions
Package utils contains various util functions
tui
Package tui provides utilities for working with the terminal.
Package tui provides utilities for working with the terminal.
components/bar
Package bar provides an animated progress bar
Package bar provides an animated progress bar
components/stopwatch
Package stopwatch provides a simple stopwatch component
Package stopwatch provides a simple stopwatch component
screen
Package screen contains the interface for a screen
Package screen contains the interface for a screen
screen/cammie
Package cammie returns the screen containing the cammie messages and other stats
Package cammie returns the screen containing the cammie messages and other stats
screen/song
Package song contains the screen displaying the song view
Package song contains the screen displaying the song view
theme
Package theme contains the tui theme variables
Package theme contains the tui theme variables
view
Package view contains all the different views for the tui
Package view contains all the different views for the tui
view/event
Package event provides the functions to draw all the upcoming zeus events on a TUI
Package event provides the functions to draw all the upcoming zeus events on a TUI
view/gamification
Package gamification provides the functions to draw an overview of gamification on a TUI
Package gamification provides the functions to draw an overview of gamification on a TUI
view/message
Package message provides the functions to draw all the cammie messages on a TUI
Package message provides the functions to draw all the cammie messages on a TUI
view/song
Package song provides the functions to draw an overview of the song integration
Package song provides the functions to draw an overview of the song integration
view/tap
Package tap provides the functions to draw an overview of the recent tap orders on a TUI
Package tap provides the functions to draw an overview of the recent tap orders on a TUI
view/zess
Package zess provides the functions to draw an overview of the zess scans on a TUI
Package zess provides the functions to draw an overview of the zess scans on a TUI

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL