Skip to content

gumnutdev/dashboard

Repository files navigation

Gumnut monorepo for code. Manages projects, api keys, ... but also the collab endpoint.

Using This Repo

Requirements

This code runs on Mac only, and you should install tools via Homebrew.

You might need to check this repo out inside your $GOPATH. e.g., put it at "$GOPATH/src/github.com/gumnutdev/dashboard".

Install our required tools via brew this way:

$ brew install golang nodejs pnpm fswatch

(Gumnut needs Go 1.24+ and Node.js 23+ish).

The Node scripts and code in this package expect --experimental-transform-types enable so TypeScript "just works". Be sure to set something like this in your shell config:

export NODE_OPTIONS='--disable-warning=ExperimentalWarning --experimental-transform-types'

Setup instructions

Run "./setup.sh" to fetch the project's dependencies before running the code.

Run instructions

tl;dr: run "./dev.sh"

The dashboard is two parts during dev: the golang backend, and the JS frontend run with vite. You can run them separately if you like, but instead, run "./dev.sh" from this directory. This script will automatically reload the golang backend after a few seconds if a file changes.

This uses a local sqlite database, as there's an abstraction separating the database layer from the rest of the API code.

Test instructions

Run "go test ./...".

You can run "go clean -testcache" to clear the test cache.

You can also use a Firebase certificate to test on Firestore as a database, which creates data under the "Test/<randomId>" doc:

$ FIREBASE_CERT="/path/to/cert.json" go test -v ./...

Design docs

Look in docs for various notes.

Build tags

Allow test dashboard logins

Build the source code with -tags allow_test_dashboard_logins to allow unsigned JWTs to sign in. The left two parts of the JWT are trusted as normal, but the right-most signature must be the literal string "test". This is dangerous but can be used for e.g., UI tests.

Release

Make sure you're on the gumnut-dev project.

$ gcloud config set project gumnut-dev
$ gcloud builds submit --config cloudbuild.yaml
$ gcloud run deploy dashboard --region australia-southeast1 --image australia-southeast1-docker.pkg.dev/gumnut-dev/gumnut-project/dashboard:latest

About

Dashboard deploy

Resources

License

Stars

Watchers

Forks

Contributors