Opinionated starter for Go backend + React frontend products. The template is optimized for short local feedback loops, minimal framework lock-in on the backend, and a frontend structure that stays readable as features accumulate.
- Go API scaffold under
server/with explicit config loading, health endpoints, request logging, graceful shutdown, and a small handler test suite. - React + Vite app under
app/with React Router, React Query, a typed API client, feature service/query-key conventions, a/apidev proxy, env examples, and an opinionatedapp / features / sharedsource layout. - Optional SQLite infrastructure under
server/internal/sqlite/with WAL mode, migrations, integrity checks, backups, and corrupt-file quarantine. It is enabled only whenSQLITE_PATHis set. - Root VS Code tasks and launch configs for the current workspace instead of the old nested-only setup.
- Shell helpers in
cmd/for local development and optional SQLite or Garage workflows.
- Install Go 1.23+, Node 22.14+, and pnpm 10.6.1.
- Copy the example env files.
- Update the Go module path in
server/go.modfor your real repository. - Install frontend dependencies with
pnpm --dir app install. - Start the stack with
./cmd/dev.sh.
If go is not available on PATH, point the helper script at a local binary:
GO_BIN=/absolute/path/to/go ./cmd/dev.shYou can also run each side independently:
cd server && go run ./cmd/api
pnpm --dir app devOpen http://localhost:3000. The frontend proxies /api to http://localhost:8080 during local development.
To build and run the application as a single container with Nginx serving the frontend and proxying the API, see docker/README.md:
docker compose -f docker/docker-compose.yml up --buildapp/
src/
app/ # bootstrap, router, shared app shell
features/ # product slices own their UI and data hooks
shared/ # truly cross-cutting code only
server/
cmd/api/ # application entrypoint
internal/
config/ # environment and runtime configuration
httpapi/ # handlers, middleware, and HTTP tests
cmd/
dev.sh # run backend + frontend together
sqlite.sh # lightweight sqlite3 wrapper
garage.sh # optional Garage passthrough helper
- Put product behavior in
app/src/featuresfirst. Promote code tosharedonly when multiple features truly need it. - Keep API transport in
shared/api, endpoint services and query keys beside their owning feature, and use the sharedQueryClient. - Keep the backend stdlib-first until concrete pressure justifies adding a framework.
- Treat
/api/healthzas the first integration seam; the starter app already exercises it. - Use the root VS Code tasks
workspace:devandworkspace:checkwhen working from the repo root.
./cmd/sqlite.shopens a local SQLite database atserver/.tmp/app.dbby default../cmd/garage.shforwards arguments to a local Garage binary when you need object storage during development.
To enable the optional application SQLite package, set SQLITE_PATH in server/.env. Supply app-specific migrations to sqlite.Migrate; the template does not impose a product schema.