PocketBase — Overview#
Identity#
- Module path: github.com/pocketbase/pocketbase
- Go version: 1.25.0
- License: MIT
- Repository: https://github.com/pocketbase/pocketbase
Purpose#
PocketBase is an open source Go backend that ships as a single portable executable, embedding SQLite (via a pure-Go CGo-free driver), a REST-ish API, file and user management, real-time subscriptions over SSE, and an Admin dashboard UI. It targets solo developers, indie hackers, and small teams who need a self-hostable Firebase/Supabase alternative without the operational overhead of a distributed system. It can be used either as a standalone binary downloaded from GitHub Releases, or embedded as a Go library so developers can extend it with custom business logic while still shipping a single binary.
Significance#
PocketBase has earned significant mindshare in the “backend-in-a-box” space — it regularly trends on GitHub and has accumulated tens of thousands of stars since its 2022 launch. Its value proposition of zero infrastructure dependencies (just one binary, SQLite on disk) resonates strongly with the indie developer and small startup community. It is architecturally notable for demonstrating that a production-ready, feature-rich backend can be built on top of SQLite without sacrificing functionality. The decision to embed a JavaScript runtime (Goja) for plugin scripting without recompilation makes it accessible to non-Go developers while keeping the core in Go.
Key metrics#
- Go files: 442
- Top-level directories: apis, cmd, core, examples, forms, mails, migrations, plugins, tests, tools, ui
- Direct dependencies: 20
- First commit / age: Copyright 2022 – present (repository is a shallow clone; project launched publicly in 2022)
Notable characteristics#
- Single-binary, zero-dependency deployment: Embeds SQLite via
modernc.org/sqlite(pure Go, no CGo), the Admin UI as embedded static assets, and all supporting subsystems — making the compiled binary entirely self-contained. - Dual-mode distribution: PocketBase is simultaneously a standalone application and a Go framework; users can
import "github.com/pocketbase/pocketbase"and build their own binary with custom hooks and routes layered on top. - JavaScript extensibility via embedded runtime: The
plugins/jsvmpackage embeds the Goja JavaScript engine, allowing server-side JS scripts to define routes, hooks, and migrations without recompiling the Go binary — a rare and deliberate design choice. - Event-hook architecture: The core uses a typed hook/event system (
OnServe,OnRecordCreate, etc.) that allows both Go and JS code to intercept and modify lifecycle events, making the codebase highly extensible without inheritance or complex plugin protocols. - Custom filter expression language: The
ganigeorgiev/fexprpackage (maintained by the same author) provides a mini query language for REST API filtering (e.g.,?filter=status='active'&&created>='2024-01-01'), avoiding raw SQL exposure while still being expressive.