What is TrailBase?
TrailBase is an open-source, single-executable Firebase alternative that combines the simplicity of SQLite with the power of modern web technologies. Built on Rust, SQLite, and Wasmtime, TrailBase provides a complete backend solution with type-safe REST APIs, realtime subscriptions, authentication, and an admin UI - all in one binary.TrailBase delivers sub-millisecond latencies that eliminate the need for dedicated caches, ensuring you never deal with stale or inconsistent data.
Key Features
Type-Safe APIs
Automatically generated REST APIs with JSON Schema validation and code generation for virtually any language
WebAssembly Runtime
Extend functionality with custom logic using JavaScript, TypeScript, or Rust compiled to WebAssembly
Realtime Subscriptions
Built-in support for streaming data changes to clients in real-time
Authentication & Authorization
Complete auth system with OAuth2, password-based login, email verification, and fine-grained ACLs
Admin Dashboard
Web-based admin UI for managing users, tables, APIs, and configurations
Multi-Database Support
Work with multiple SQLite databases simultaneously with separate migration paths
Vector Search
Built-in support for vector embeddings and semantic search via sqlite-vec
Geospatial Support
Native geospatial capabilities with PostGIS-compatible functions
Why TrailBase?
Simplify Your Stack
TrailBase helps you simplify with fewer moving parts. Instead of managing multiple services (database, API server, cache, queue, auth service), you get an easy-to-self-host, single-executable backend for your mobile, web, or desktop application.Performance That Matters
With sub-millisecond latencies, TrailBase eliminates common performance bottlenecks:- No need for dedicated Redis/Memcached caches
- No stale or inconsistent data from cache invalidation issues
- Direct SQLite access provides blazing-fast queries
- Perfect for edge deployments and resource-constrained environments
Developer Experience
TrailBase prioritizes developer experience with:- Zero dependencies: Single binary with everything included
- Type safety: Generate client libraries in TypeScript, Dart, Rust, Python, Go, Kotlin, Swift, and C#
- Database migrations: Built-in migration system for schema versioning
- Hot reload: Development mode with automatic reloading
- Extensibility: WebAssembly runtime for custom server-side logic
Architecture Overview
TrailBase’s architecture is designed for simplicity and performance:Core Components
SQLite Database Layer
SQLite Database Layer
TrailBase uses SQLite as its database engine with:
- Multiple databases: Separate databases for main data, logs, and queues
- Extensions: sqlite-vec for vector search, sqlean for additional functions
- STRICT tables: Type safety at the database level
- WAL mode: Write-Ahead Logging for better concurrency
Record API System
Record API System
Automatically generated REST APIs from database schemas:
- CRUD operations: Create, Read, Update, Delete
- Filtering & sorting: Query parameters for complex queries
- Pagination: Efficient data fetching with offset/limit
- JSON Schema: Auto-generated schemas for type-safe clients
- Access control: Table and column-level permissions
WebAssembly Runtime
WebAssembly Runtime
Extend TrailBase with custom logic:
- Wasmtime-based: Fast, secure WebAssembly execution
- Multiple languages: JavaScript, TypeScript, or Rust
- Custom endpoints: Add new HTTP routes
- Database access: Query databases from WASM code
- Component model: Install pre-built components like auth UI
Authentication System
Authentication System
Complete auth solution with:
- Password authentication: Argon2 hashing
- OAuth2 providers: Google, GitHub, Apple, Microsoft, and more
- Email verification: Built-in email sending
- JWT tokens: Secure, stateless authentication
- User management: Admin CLI and UI tools
Project Structure
When you run TrailBase, it creates atraildepot directory with the following structure:
The
traildepot directory is portable - you can copy it between environments or back it up as a single unit.Use Cases
TrailBase is perfect for:- Mobile & web apps: Full-featured backend in a single binary
- Internal tools: Rapid development with admin UI
- Edge deployments: Run close to users with minimal resources
- Data analysis: SQLite-compatible with programmatic access
- Prototypes & MVPs: Get started quickly without infrastructure complexity
- Self-hosted alternatives: Replace Firebase, Supabase, or PocketBase
Client Libraries
TrailBase provides official client libraries for multiple languages:- JavaScript/TypeScript: npm
- Dart/Flutter: pub.dev
- Rust: crates.io
- C#/.NET: NuGet
- Swift: GitHub
- Kotlin: Maven
- Go: GitHub
- Python: PyPI
License
TrailBase is free software under the Open Software License 3.0 (OSL-3.0). The license’s narrow definition of “derivative work” means:- ✅ Your application code is not subject to copyleft
- ✅ You can build commercial applications
- ✅ Works for web, mobile, desktop, and services
- ✅ Modifications to TrailBase itself must be shared
For exceptions or enterprise licensing, contact [email protected]
Next Steps
Quickstart
Get TrailBase running in under 5 minutes
Installation
Detailed installation instructions for all platforms