Skip to content

dev-rvk/starter

Repository files navigation

starterpack: The Go + React SaaS Starter

CI

starterpack is a production-ready, deployable Turborepo SaaS starter template. It combines a blazing-fast Vite + TanStack Router (React) frontend with a robust Go hexagonal backend. Featuring a shadcn/ui design system and feature-toggled integrations (Clerk, Stripe, analytics, email, error tracking). A powerful re-platform of next-forge onto Vite + Go.

Scaffold with create-go-starter

You can scaffold a new app from the starterpack monorepo template using our CLI:

bun create go-starter my-app     # via bun's create-* resolver
bunx create-go-starter my-app    # via npm/bunx
npm create go-starter@latest my-app

If you omit the name it will prompt for one. The CLI downloads the template from GitHub, renames the root package.json, reinitialises git, and prints the make setup next steps.

CLI Flags

Flag Meaning
[name] Target directory / project name (prompted if omitted)
--ref <branch|tag> Template ref to fetch (default: repo default branch)
--no-git Skip git init + initial commit

STARTERPACK_TEMPLATE overrides the source repo (default github:dev-rvk/starter).

Because the template is fetched from GitHub at run time, you only republish this CLI when its own logic changes — template updates ship by pushing to the template repo.

Quick start

make setup      # install deps + tools, generate code
make deps-up    # start local PostgreSQL (Docker)
make migrate    # apply database migrations
make dev        # run everything concurrently (bootstrapping)

Tip

While make dev boots the entire stack in one terminal, it is highly recommended to run them separately in two windows/panes for clean log visibility:

  • make client runs all JS applications under the Turborepo TUI.
  • make server runs the Go backend API with clean, un-obscured stdout logging.
URL App
http://localhost:3000 app — dashboard (Vite + TanStack Router)
http://localhost:3001 web — marketing site
http://localhost:3002 api — Go backend (Gin, hexagonal)
http://localhost:3003 email — React Email preview
http://localhost:6006 storybook — design system

Prerequisites: Bun ≥ 1.3, Go ≥ 1.24, GNU Make, and (optional) Docker for local PostgreSQL. make setup installs the Go CLIs (sqlc, swag) for you. Run make help to list every target.

Only Clerk (auth) and PostgreSQL are needed for the full experience — every other integration is a feature toggle that stays inert until its key is set. Without DATABASE_URL the API uses an in-memory store; without Clerk keys auth is bypassed in dev, so the stack always boots from a fresh clone.

Local dependencies (Docker)

Backing services run via Docker Compose. The flow is local ↔ hosted by URL: run a container locally and point the env var at localhost, or skip the container and point the same var at a managed provider — no code changes.

make deps-up        # start core services (postgres)
make deps-up-all    # also start redis + mailpit (opt-in profiles)
make deps-down      # stop (keep data)
make deps-reset     # stop and delete data volumes
make deps-logs      # tail logs
Service Local (compose) Hosted equivalent Status
PostgreSQL postgres :5433 Neon · Supabase · RDS wired today
Redis redis :6379 (profile cache) Upstash · Elasticache scaffold
Mailpit (SMTP) mailpit :8025 UI (profile mail) Resend (HTTP API) scaffold

To go hosted, e.g. swap Postgres: stop the local one (or just ignore it) and set DATABASE_URL in apps/api/.env.local to your Neon/Supabase connection string.

Configure features

Every integration is a feature toggle — set its key to enable it, leave it blank to keep it off. Copy the templates first:

cp apps/api/.env.example apps/api/.env.local
cp apps/app/.env.example apps/app/.env.local
cp apps/web/.env.example apps/web/.env.local
Feature What it does Get keys Env var(s) → file
PostgreSQL (needed) App database make deps-up (local) or Neon DATABASE_URLapps/api/.env.local
Clerk (needed) Authentication clerk.com → API Keys CLERK_SECRET_KEY → api · VITE_CLERK_PUBLISHABLE_KEY → app
Stripe Payments (planned) dashboard.stripe.com STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET → api
Sentry Error tracking sentry.io SENTRY_DSN → api · VITE_SENTRY_DSN → app
Resend Transactional email resend.com RESEND_TOKEN, RESEND_FROM → api
Google Analytics Web analytics (free tier) GA4 property VITE_GA_MEASUREMENT_ID → app/web
PostHog Product analytics (self-host) your PostHog instance VITE_POSTHOG_KEY, VITE_POSTHOG_HOST → app/web

Minimum to boot: nothing — the API falls back to in-memory and auth is bypassed in dev. For the full experience, set DATABASE_URL + the two Clerk keys.

Removed from next-forge (re-add as packages if you need them): Arcjet (security), BetterStack (use Prometheus/Grafana later), BaseHub (CMS).

See starterpack-docs/setup.md for the full matrix and per-service detail.

Documentation

Stack

  • Frontend: Vite, TanStack Router, TanStack Query, Tailwind v4, shadcn/ui
  • Backend: Go, hexagonal (ports & adapters), Gin, zerolog, pgx + sqlc, Atlas
  • Auth: Clerk (graceful when unconfigured)
  • Contract: Go OpenAPI (swag) → typed TS client (openapi-typescript + openapi-fetch)
  • Tooling: Bun, Turborepo, a single Makefile entrypoint (make help)

Layout

apps/       api (Go) · app · web · email · storybook
packages/   api-client · auth · design-system · email · typescript-config

Common commands

make dev          # run Go API + all JS apps concurrently (bootstrapping)
make client       # run JS apps via turbo (TUI mode)
make server       # run the Go API backend (clean logs)
make build        # build all JS apps + the Go binary
make migrate      # apply Atlas migrations (needs DATABASE_URL)
make db-diff name=... # generate an Atlas migration
make db-apply     # apply Atlas migrations
make db-status    # show migration status
make db-reset     # teardown DB volume and run all migrations
make generate     # regenerate sqlc + OpenAPI + typed client
make lint         # check JS (ultracite) and vet Go
make lint-fix     # auto-fix JS/TS formatting and linting
make lint-api-fix # auto-fix Go linting and import formatting (golangci-lint)
make test         # bun test + go test
make help         # list every target

About

Starter Application for SaaS, hobby project, etc. Uses Go Backend (Hexagonal Pattern) with Vite (React SPA), with everything configured.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors