https://github.com/niklas-schmidt-dev/shipable-template-dashboard-go-clerk-postgres-redis
A backend-only Go API service with Clerk session verification, Postgres tables, and Dragonfly or Redis caching.
https://github.com/niklas-schmidt-dev/shipable-template-dashboard-go-clerk-postgres-redis
backend dashboard-go-clerk-postgres-redis shipable shipable-template
Last synced: 29 days ago
JSON representation
A backend-only Go API service with Clerk session verification, Postgres tables, and Dragonfly or Redis caching.
- Host: GitHub
- URL: https://github.com/niklas-schmidt-dev/shipable-template-dashboard-go-clerk-postgres-redis
- Owner: niklas-schmidt-dev
- Created: 2026-05-30T16:52:05.000Z (30 days ago)
- Default Branch: main
- Last Pushed: 2026-05-30T21:22:01.000Z (29 days ago)
- Last Synced: 2026-05-30T23:21:16.645Z (29 days ago)
- Topics: backend, dashboard-go-clerk-postgres-redis, shipable, shipable-template
- Language: Go
- Size: 19.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go + Clerk + Postgres + Dragonfly/Redis Dashboard
A single-binary Go dashboard with Clerk session verification, Postgres reporting tables, and a Redis-compatible cache that works with Dragonfly or Redis.
## Run locally
Use Go 1.25 or newer.
```bash
cp .env.example .env
go mod tidy
go run ./cmd/server
```
Open `http://localhost:8080`. Without `DATABASE_URL`, `REDIS_URL`, or Clerk 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 Clerk
Set these variables:
```bash
CLERK_SECRET_KEY=sk_...
CLERK_PUBLISHABLE_KEY=pk_...
```
The browser loads a pinned ClerkJS major version, gets a session token, and calls the Go API with `Authorization: Bearer `. The Go API uses Clerk's `RequireHeaderAuthorization` and `SessionClaimsFromContext` helpers for protected routes.
Routes:
- `/api/session` requires a Clerk bearer token.
- `/api/dashboard` requires a Clerk bearer token when Clerk is configured and returns preview data while Clerk is not configured.
- `/api/health` reports Postgres, Dragonfly/Redis, and Clerk configuration state.
The service sets conservative security headers, a Clerk-compatible content security policy, no-store API responses, strict method guards, and bounded server timeouts. Browser-rendered API data is written through DOM text nodes rather than HTML strings.
## Verify
```bash
go test ./...
go vet ./...
npm run build
```