go-svelte-template Svelte Themes

Go Svelte Template

Opinionated template for building full-stack applications with a Go + Svelte, packaged as a single binary.

Go + Svelte Template

An opinionated template for building full-stack applications with a Go backend and Svelte frontend, packaged as a single binary.

Stack

  • Go: Echo server, SQLite/Turso, SQLC, urfave/cli
  • Svelte 5: SvelteKit SPA, shadcn-svelte, Tailwind CSS v4

Quick Start

Backend

make run

Starts the server on port 7400 with in-memory SQLite. Configure via local_config.yaml or environment variables.

Frontend

make ui-install   # first time only
make ui-dev       # start Vite dev server on port 5173

Build Single Binary

make ui-build-go  # build UI into Go embed dir
make build        # compile to bin/app

The resulting bin/app binary serves both the API and UI.

Configuration

Config is loaded from YAML and/or environment variables.

Setting YAML Env Default
Port port PORT 7400
SQLite directory sqliteDir SQLITE_DIR in-memory
Turso DSN tursoDSN TURSO_DSN
CORS origins corsOrigins CORS_ORIGINS
Serve UI ui UI true
Log level logger.level LOGGER_LEVEL info
Structured logs logger.structured LOGGER_STRUCTURED false

Development

make test    # run tests
make lint    # run golangci-lint
make gen     # regenerate sqlc after query/migration changes

Top categories

Loading Svelte Themes