PocketBase — Dependencies#
Module info#
- Module:
github.com/pocketbase/pocketbase - Go version: 1.25.0
- Direct dependencies: 20
- Indirect dependencies (go.mod): 18 (listed explicitly in go.mod
// indirect) - Total go.sum entries: ~71 unique (module, version) pairs (143 lines / 2)
Dependency categories#
Core infrastructure#
| Dependency | Purpose |
|---|---|
github.com/spf13/cobra v1.10.2 | CLI framework — drives the serve, migrate, admin sub-commands via RootCmd *cobra.Command in the PocketBase launcher |
github.com/fatih/color v1.19.0 | Colored console output for startup banners, JSVM warnings, and the dev-mode logger; the only UI in the terminal |
github.com/fsnotify/fsnotify v1.7.0 | File-system watcher used exclusively by the jsvm plugin to hot-reload JS hook files without restarting the server |
golang.org/x/sync v0.20.0 | errgroup / singleflight used internally for concurrent safe initializations and query batching |
Networking/HTTP#
| Dependency | Purpose |
|---|---|
golang.org/x/net v0.52.0 | Low-level networking utilities (HTTP/2, websocket upgrade helpers) used by the custom router and SSE real-time layer |
golang.org/x/oauth2 v0.36.0 | OAuth2 client used by the 25+ social auth providers in tools/auth/; each provider wraps BaseProvider which calls golang.org/x/oauth2 for the token exchange |
Data/Storage#
| Dependency | Purpose |
|---|---|
modernc.org/sqlite v1.48.0 | Pure Go SQLite driver registered as _ "modernc.org/sqlite" in core/db_connect.go — the single most impactful dependency enabling zero-CGo builds |
github.com/pocketbase/dbx v1.12.0 | First-party query builder (maintained by the same author) used in 69 source files — the primary abstraction over the SQLite database; builds SELECT, INSERT, UPDATE and handles parameter quoting |
github.com/ganigeorgiev/fexpr v0.5.0 | First-party filter expression parser (same author) powering the REST API’s ?filter= parameter — parses a mini query language and converts it into safe dbx.Expression subtrees |
github.com/spf13/cast v1.10.0 | Safe type coercion used in tools/search/filter.go to convert user-supplied filter token values to the right Go type before building SQL |
github.com/disintegration/imaging v1.6.2 | Image resizing and cropping in tools/filesystem/filesystem.go — handles thumbnail generation for uploaded images |
golang.org/x/image v0.38.0 | Extended image format decoding (TIFF, BMP, WebP) required by imaging |
github.com/gabriel-vasile/mimetype v1.4.13 | Content sniffing to detect MIME type from raw bytes — used in file uploads (tools/filesystem/), mailer attachments, and the file field validator |
Security / Auth#
| Dependency | Purpose |
|---|---|
github.com/golang-jwt/jwt/v5 v5.3.1 | JWT signing and parsing in tools/security/jwt.go — used for auth tokens, password-reset links, email-verification links, and impersonation tokens |
golang.org/x/crypto v0.49.0 | bcrypt for password hashing; argon2 for refresh-token generation; TLS helpers |
github.com/go-ozzo/ozzo-validation/v4 v4.3.0 | Declarative struct validation used across 70+ files — defines rules for record fields, settings, forms, and API input; accessed via the validation alias |
JS Runtime#
| Dependency | Purpose |
|---|---|
github.com/dop251/goja v0.0.0-20260106131823-651366fbe6e3 | ECMAScript 5.1+ runtime — the heart of the plugins/jsvm package; executes user hook scripts, migrations, and route handlers in-process |
github.com/dop251/goja_nodejs v0.0.0-20260212111938-1f56ff5bcf14 | Node.js compatibility layer for Goja (require(), console, process, buffer modules) enabling Node-style JS idioms in user scripts |
github.com/pocketbase/tygoja v0.0.0-20250812183945-97ffe055281f | First-party TypeScript definition generator used at build time to produce pb_hooks/types.d.ts, giving JS users IDE autocompletion for the PocketBase JS API |
Email#
| Dependency | Purpose |
|---|---|
github.com/domodwyer/mailyak/v3 v3.6.2 | SMTP client with TLS, AUTH LOGIN/PLAIN, and multipart MIME support; used in tools/mailer/smtp.go as the concrete mailer backend |
Stdlib reliance#
PocketBase leans heavily on the Go standard library. The net/http package is used directly — PocketBase ships a custom HTTP router in tools/router/ built on net/http rather than adopting a third-party framework like Echo or Gin. Other heavily used stdlib packages:
encoding/json— JSON encode/decode throughoutnet/smtp— SMTP foundation undermailyakcrypto/...— Supplemented bygolang.org/x/cryptodatabase/sql— The standard DB interface (bridged to SQLite viamodernc.org/sqlite)io/fsandembed— Used extensively to embed the Admin UI, JS type definitions, and migration SQL into the binarylog/slog— Standard structured logger (Go 1.21+) adopted for the internal batch log handler instead of a third-party logger
The net effect is that PocketBase imports zero general-purpose third-party logging, observability, or middleware libraries. Its dependency graph is intentionally minimal.
Shared dependencies#
Compared to the broader set of 50 analyzed projects, PocketBase shares several high-frequency dependencies:
github.com/spf13/cobra— near-universal CLI framework (also: Vault, Nomad, Helm, K3s, Dapr, …)golang.org/x/crypto— ubiquitous for any project handling auth (Vault, Consul, …)golang.org/x/net— baseline for modern Go networkinggithub.com/golang-jwt/jwt/v5— common JWT library replacing the olderdgrijalva/jwt-gogithub.com/google/uuid(indirect) — UUID generation; present in most web backends
Notably absent compared to its peers: github.com/gorilla/mux, github.com/gin-gonic/gin, github.com/go-chi/chi, go.uber.org/zap, github.com/sirupsen/logrus, any ORMs.
Vendoring#
No vendor directory. PocketBase uses the standard Go module proxy and relies on go.sum checksums for reproducibility. This is typical for a project that is also distributed as a Go library — vendoring would complicate embedding by downstream users.
Notable dependency decisions#
modernc.org/sqliteinstead ofmattn/go-sqlite3: The single most consequential choice in the dependency graph.mattn/go-sqlite3requires CGo and a C compiler, breaking cross-compilation and Docker FROM-scratch builds.modernc.org/sqliteis a transpiled pure-Go implementation that enablesGOARCH=arm64 GOOS=linux go buildwithout any host toolchain beyond the Go compiler. This is the architectural enabler of the “single portable binary” promise.First-party
pocketbase/dbxinstead of an ORM: Rather than pulling in GORM or sqlx, the project uses its own thin query builder (pocketbase/dbx). This keeps the SQL layer predictable, avoids N+1 footguns from ORM magic, and allows the author to add PocketBase-specific features (like JSON field operators) without waiting for upstream.ganigeorgiev/fexprinstead of raw SQL exposure: Exposing a custom filter DSL rather than a SQL subset prevents SQL injection by construction, and the parser is maintained by the same author — meaning PocketBase controls the entire stack from HTTP request to SQLite query.dop251/gojafor scripting instead of a WASM runtime or subprocess model: Embedding a JS engine in-process gives sub-millisecond hook latency with full access to the Go API surface via JS bindings, at the cost of a heavier binary. The tradeoff is explicitly chosen for developer experience — JS users get native PocketBase objects, not an RPC layer.No test framework dependency: The entire test suite uses
testingfrom the standard library only. Zerotestify, zerogomock. This makes the dependency graph even leaner and demonstrates confidence in table-driven tests with stdlib assertions.