Displays the cammie chat along with some other statistics.
- Go: Check the .tool-versions file for the required Go version.
- Pre-commit hooks:
git config --local core.hooksPath .githooks/
. - Goose (DB migrations):
go install github.com/pressly/goose/v3/cmd/goose@latest
. - SQLC (Statically typed queries):
go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
- Make (Optional)
- Create a
.env
file specifying
APP_ENV
. Available options are:development
production
BACKEND_SONG_SPOTIFY_CLIENT_ID
BACKEND_SONG_SPOTIFY_CLIENT_SECRET
- Configure the appropriate settings in the corresponding configuration file located in the config directory. you can either set them as environment variables or inside the configuration file.
This project uses a postgres database. SQLC is used to generate statically typed queries and goose is responsible for the database migrations.
make db
: Start the databasemake migrate
: Run database migrations to update your database schema (watch out, migrations might result in minor data loss).make create-migration
: Create a new migration in the db/migrations directory.make sqlc
: Generate statically typed queries based on the .sql files in the db/queries directory. Add new queries to this directory as needed.
The backend is responsible for fetching and processing external data, which is then stored in the database. Data can either received by exposing an API or by actively fetching them.
To build and run the backend, use the following commands:
make build-backend
: Build the backend binary.make run-backend
: Run the backend.
Backend logs are saved to ./logs/backend.log
(created on first start) and written to stdout
.
The TUI (Text User Interface) displays data retrieved from the database. This flexibility allows for running multiple instances of the TUI, each displaying different data.
To build and run the TUI, use the following commands:
make build-tui
: Build the TUI binary.make run-tui
: Run the TUI.
The TUI requires one argument: the screen name to display. You can create new screens in the screens directory, and you must add them to the startup command list in tui.go.
A screen is responsible for creating and managing the layout, consisting of various views.
TUI logs are written to ./logs/tui.log
and not to stdout
.