An open API service indexing awesome lists of open source software.

https://github.com/niklas-schmidt-dev/shipable-template-dashboard-go-workos-postgres-redis

A Go service dashboard with WorkOS AuthKit, Postgres reporting tables, and Dragonfly or Redis caching.
https://github.com/niklas-schmidt-dev/shipable-template-dashboard-go-workos-postgres-redis

business dashboard-go-workos-postgres-redis shipable shipable-template

Last synced: 29 days ago
JSON representation

A Go service dashboard with WorkOS AuthKit, Postgres reporting tables, and Dragonfly or Redis caching.

Awesome Lists containing this project

README

          

# React + Go + WorkOS + Postgres + Dragonfly/Redis Dashboard

A React/Vite dashboard backed by a Go service with WorkOS AuthKit routes, Postgres reporting tables, and a Redis-compatible cache that works with Dragonfly or Redis.

## Run locally

Use Go 1.25 or newer and Node.js 24 or newer.

```bash
cp .env.example .env
npm install
npm run dev:api
npm run dev
```

Open `http://localhost:5173`. Vite proxies `/api` and `/auth` to the Go service on port 8080. Without `DATABASE_URL`, `REDIS_URL`, or WorkOS values, the app shows preview data and clear runtime status.

## Configure data

Apply the SQL files in `db/migrations` to your Postgres database, then set `DATABASE_URL`.

Set `REDIS_URL` to either Redis or Dragonfly. Dragonfly is Redis-compatible, so the same `github.com/redis/go-redis/v9` client and URL shape work for both.

## Configure WorkOS AuthKit

Set these variables:

```bash
WORKOS_API_KEY=sk_...
WORKOS_CLIENT_ID=client_...
WORKOS_REDIRECT_URI=http://localhost:5173/auth/callback
WORKOS_COOKIE_PASSWORD=replace-with-32-plus-random-characters
```

Routes:

- `/auth/login` redirects to WorkOS AuthKit.
- `/auth/callback` verifies the OAuth state, exchanges the code, and seals a local session cookie.
- `POST /auth/logout` clears the local session.
- `/api/dashboard` returns the Postgres-backed dashboard, cached through Dragonfly or Redis.

The service sets conservative security headers, no-store API responses, strict method guards, bounded server timeouts, and `HttpOnly` session cookies. Keep `WORKOS_COOKIE_PASSWORD` at 32+ random characters in every environment.

## Verify

```bash
env GOWORK=off go test ./...
env GOWORK=off go vet ./...
npm run typecheck
npm run build
```