Go + Echo + SQLite (Embedded, Self-Hosted Tools)
Architecture guidelines for single-binary Go services using the Echo framework, embedded SQLite, and minimal-JS server-rendered UI.
- Formats
- 4 files
- AGENTS.md
- 38 lines
- CLAUDE.md
- 15 lines
- Languages
- Go
- Updated
- Oct 2026
- Used by
- 4 projects
Writes .claude/skills/go-echo-sqlite/SKILL.md
$ curl -s --create-dirs -o .claude/skills/go-echo-sqlite/SKILL.md https://stackitfast.com/rules/go-echo-sqlite/SKILL.mdRule files
Works with Cursor · Claude Code · Windsurf · AGY
Architecture notes
Architecture Overview
Standardized production guidelines for Go, the Echo web framework, and embedded SQLite — the pattern behind small, single-binary, self-hosted tools that a user can run with one command and no external database server.
Verified Real-World Adoption
PocketBase is the canonical example of this exact stack (Go + Echo + embedded SQLite, single binary). Gitea and Gatus follow the same single-binary, embeddable-SQLite philosophy, offering PostgreSQL as an opt-in upgrade path for larger deployments rather than a requirement.
Key Architectural Nuances
- Zero External Dependencies by Default: The database ships inside the same process as the application, so “installing” the tool is copying one binary and pointing it at a data directory.
- WAL Mode as a Non-Negotiable Default: Without it, SQLite’s exclusive write lock turns any concurrent access pattern into a source of “database is locked” errors under real usage.
Frequently asked questions
Does this AGENTS.md work with Cursor, Claude Code, and Windsurf?
Yes — AGENTS.md is the open, cross-tool standard read by Cursor, Claude Code, Windsurf, and 30+ other agents. A dedicated .mdc file is also included for Cursor's native .cursor/rules format.
How is this different from the Go + PostgreSQL + React rule?
That rule targets a full-throughput web dashboard with a separate React frontend and a managed PostgreSQL server. This rule targets single-binary, self-hostable tools -- status pages, git servers, embedded backends -- where the entire application, including its database, ships as one file an operator runs with zero external dependencies.
Why WAL mode instead of the SQLite default?
SQLite's default rollback-journal mode takes an exclusive lock on the whole database file for the duration of a write, so any concurrent read blocks until it finishes. WAL (write-ahead log) mode lets readers continue against the last-committed state while a write is in progress, which is the difference between a tool that handles a handful of concurrent requests and one that locks up under them.
Used in production
Explore all stacksGotify
6Gotify keeps the server one deployable Go binary by embedding its Vite/React web UI, using Gin and gorilla/websocket for the REST and streaming API, and swapping SQLite, MySQL or PostgreSQL through GORM, while a compiled Go plugin system handles extensibility instead of a scripting layer.
Grafana
6Grafana splits its backend into a growing set of independently versioned Go modules under apps/, tied together by a go.work workspace and modeled with Kubernetes-style APIs (pkg/apiserver, CUE-defined kinds), so individual product areas like alerting or dashboards can evolve without one monolithic backend module.
MindsHub (formerly MindsDB)
1Splitting the client, API and agent into separately versioned git submodules lets each ship on its own cadence (a signed desktop app, a PyPI server package, an agent package), while one Makefile and one docker-compose.yml still bring the whole stack up together.
SeaweedFS
1Decoupling directory metadata from physical volume storage eliminates central metadata bottlenecks, enabling massive horizontal scaling for small and large files alike.