Thunder is a dual-stack platform that mirrors the aesthetic and experience of suffix.events while adding a production-ready backend for managing premium sporting experiences.
- Backend (
/backend) — Golang + Echo API that surfaces events and captures leads. It authenticates admin-only routes with Keycloak-issued JWTs and persists content through PocketBase. - Frontend (
/frontend) — Next.js 14 + Tailwind single-page experience that borrows the dark, neon aesthetic from suffix.events and consumes the backend API. - PocketBase — Acts as the headless database for
eventsandleadscollections. The backend uses the REST API through Resty. - Keycloak — Provides OAuth2/OpenID Connect flows and token introspection for the
/api/eventswrite endpoints.
frontend (Next.js) <---> backend (Echo) <---> PocketBase
| \
└-------------- Keycloak ------------\
- Go 1.21+
- Node.js 20+ and npm
- PocketBase instance with
eventsandleadscollections - Keycloak realm + confidential client for the API
cp backend/.env.example backend/.env
# edit backend/.env with your values
cd backend
go run ./cmd/serverEnvironment variables:
| Variable | Purpose |
|---|---|
SERVER_PORT |
Port Echo listens on (default 8080) |
CORS_ALLOWED_ORIGINS |
Comma-separated list for the frontend origin |
KEYCLOAK_* |
Base URL, realm, client credentials used for token introspection |
POCKETBASE_* |
PocketBase REST endpoint, admin API token, and public files URL |
Create collections named events and leads with fields that match the payloads in internal/domain. Files (cover + gallery) should use PocketBase file fields so the API can construct public URLs.
- Create a confidential client (e.g.,
thunder-api) in your realm. - Enable service accounts and client credentials.
- Copy the client ID and secret into
backend/.env. - Protect the POST
/api/eventsroute by sendingAuthorization: Bearer <token>from a Keycloak client.
cp frontend/.env.example frontend/.env
# update NEXT_PUBLIC_API_BASE_URL if backend runs elsewhere
cd frontend
npm install
npm run devThe homepage (/) is a server component that fetches live events. If the API is unavailable it falls back to seeded concept events to preserve the marketing experience.
- Run
go test ./...insidebackendto make sure the API compiles. - Run
npm run lintinsidefrontendto keep the UI clean. - Update both
.envfiles before deploying; neither is committed to git.
backend/
cmd/server/main.go # Echo bootstrap
internal/
config/ # env parsing
domain/ # core models
http/handler # Echo handlers
http/middleware # Keycloak JWT validation
http/router # route + middleware wiring
repository/pocketbase # PocketBase REST integration
service/ # business logic
frontend/
app/ # Next.js App Router pages
components/ # Client-side widgets
public/ # (optional) static assets
- Script PocketBase schema migrations for automated provisioning.
- Add integration tests that stub PocketBase and Keycloak.
- Expand the frontend into additional routes (case studies, insights) and connect to real event detail pages.