Main features
- Single executable for Linux, macOS and Windows, plus a Docker image
- Type-safe REST APIs over tables and views with JSON schemas
- Realtime subscriptions over SSE and WebSocket
- Auth with password, OAuth, email OTP, TOTP MFA and anonymous users
- ACLs plus SQL access rules for each API
- File uploads with S3 integration
- WebAssembly runtime for custom endpoints in JavaScript, TypeScript or Rust
- Admin dashboard with SQL access and logs
- Client libraries for eight languages
What TrailBase does
TrailBase is a backend in one executable, written in Rust and built on SQLite, with experimental PostgreSQL support. Its own FAQ describes the aim as combining Supabase’s flexibility with PocketBase’s low overhead. You define tables in SQL and expose them, or views over them, as Record APIs: REST endpoints for create, read, update, delete and filtered lists, plus realtime change subscriptions over server-sent events or WebSockets. Because tables must be strictly typed, TrailBase can publish JSON schemas and generate type-safe bindings for clients.
Custom server logic runs in a WebAssembly runtime based on Wasmtime: you drop compiled components into a folder and they register their own HTTP routes, written in JavaScript, TypeScript or Rust. You can also use TrailBase as a Rust framework, or keep your own backend next to it. Client libraries exist for JavaScript/TypeScript, Dart/Flutter, Rust, C#, Swift, Kotlin, Go and Python.
Security and access control
Each Record API has simple ACLs for anonymous and signed-in users. You can then add SQL access rules that see the request (_REQ_), the existing row (_ROW_) and the current user (_USER_). That makes rules such as “users can only edit their own rows” or group membership checks plain SQL conditions, and views can hide rows or columns. The production guide recommends checking the user ID on every create, update, read and delete.
Auth covers email or username with password, OAuth providers, email one-time codes, TOTP multi-factor authentication and anonymous users who can later be upgraded. Access tokens are short-lived JWTs signed with ed25519 keys, refresh tokens are opaque and long-lived, and native or cross-origin apps can use the authorization code flow with PKCE. A ready-made sign-in UI can be installed as a WebAssembly component.
Self-hosting TrailBase
Download the binary for Linux, macOS or Windows, or run the Docker image; there are no other services to install, and all data lives in a traildepot directory. The production guide lists what to set up yourself. TLS works from certificate files, but certificates are not renewed automatically yet, so use certbot or a reverse proxy. Configure SMTP rather than the default sendmail, and consider moving the admin interface to a private port. Built-in periodic backups exist, and the project suggests Litestream for continuous replication. Monitoring is basic: logs in the admin UI and a health check endpoint.
Hosted version
There is no hosted service; TrailBase is self-hosted only. A public demo instance shows the admin dashboard.
Limitations
By its own account TrailBase is well tested but young and has not seen much production use. PostgreSQL support is experimental, and like other SQLite-based tools it scales up rather than out, with read replicas as the main option. The Open Software License is less familiar than GPL or MIT, although the README explains its intended scope clearly. There is no importer for Firebase data, though SQLite’s standard tools handle import and export.
Who it suits
TrailBase suits developers who want PocketBase-style single-binary deployment, but with direct SQL, type-safe APIs and custom logic in TypeScript or Rust. It fits side projects, internal tools and apps where you are comfortable adopting a newer project and running it yourself.
License details
OSL-3.0. Client libraries are dual-licensed under Apache-2.0. The project states that copyleft covers only changes to TrailBase itself, not apps built on it.
Technical details
Built with
- Rust
- Wasmtime
- SQLite
- SolidJS
GitHub topics
- authentication
- database
- rest-api
- rust
Reviewed by the OpenSourcePicks editors from the project's repository and documentation. Something out of date? Tell us.