https://github.com/pjonaszik/rustbase
A multi-tenant Backend-as-a-Service in Rust โ realms, apps, collections, auth, hooks, files, realtime, dashboard.
https://github.com/pjonaszik/rustbase
axum baas backend backend-as-a-service multi-tenant rust self-hosted sqlite
Last synced: about 3 hours ago
JSON representation
A multi-tenant Backend-as-a-Service in Rust โ realms, apps, collections, auth, hooks, files, realtime, dashboard.
- Host: GitHub
- URL: https://github.com/pjonaszik/rustbase
- Owner: pjonaszik
- License: apache-2.0
- Created: 2026-05-27T16:57:57.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-06-04T20:10:54.000Z (22 days ago)
- Last Synced: 2026-06-04T21:05:22.407Z (22 days ago)
- Topics: axum, baas, backend, backend-as-a-service, multi-tenant, rust, self-hosted, sqlite
- Language: Rust
- Homepage: https://pjonaszik.github.io/rustbase/
- Size: 1.83 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE-APACHE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README

# RustBase
**Multi-tenant backend. Single binary. Real isolation.**
A multi-tenant Backend-as-a-Service in Rust. Drop one executable on a server, run the setup wizard, and you have workspaces, apps, collections, auth, realtime, file storage, a dashboard, and a REST API.
[](https://github.com/pjonaszik/rustbase/actions/workflows/ci.yml)
[](https://pjonaszik.github.io/rustbase/)
[](https://github.com/pjonaszik/rustbase/releases)
[](#licence)
[](https://www.rust-lang.org)
[](https://github.com/tokio-rs/axum)
[](https://www.sqlite.org/wal.html)
[](https://github.com/pjonaszik/rustbase/discussions)
[](https://github.com/pjonaszik/rustbase/stargazers)
[](https://github.com/pjonaszik/rustbase/commits/main)
[](https://github.com/pjonaszik/rustbase/blob/main/CONTRIBUTING.md)
[](https://www.paypal.com/ncp/payment/5L8KUWE8F2PSU)
๐ [Docs](https://pjonaszik.github.io/rustbase/) ย ยทย ๐ [Issues](https://github.com/pjonaszik/rustbase/issues) ย ยทย ๐ฌ [Discussions](https://github.com/pjonaszik/rustbase/discussions) ย ยทย ๐ [Security](SECURITY.md) ย ยทย ๐ [Changelog](CHANGELOG.md)
---
## Who this is for
You ship **multiple small apps** under one organisational tenant โ agency
projects for several clients, an indie portfolio of side products, a fleet of
internal tools โ and you want **real isolation** between them without running a
fleet of containers.
Concretely, RustBase suits you if:
- You'd otherwise deploy one PocketBase per app (and dread the ops).
- You'd otherwise reach for Supabase but don't want a managed Postgres bill,
RLS soup, or Edge Functions running someone else's JS runtime.
- You'd otherwise build "one Postgres + Redis + S3 + auth-service + admin UI"
stack but you ship by yourself and your time is the constraint.
RustBase gives you, in one binary, the multi-tenant primitive
(`System โ Workspace โ App`) baked into the storage layer. Each `App` gets its own
SQLite file. Delete an app โ `rm -rf` its folder. Take a backup โ `tar` the
folder. No managed services, no orchestration, no container Tetris.
See [Positioning](https://pjonaszik.github.io/rustbase/concepts/positioning)
and [the comparison vs PocketBase / Supabase / Appwrite](https://pjonaszik.github.io/rustbase/guide/comparison)
in the docs for the honest tradeoffs.
## Features
- **Multi-tenant by design** โ `System โ Workspace โ App`. Each app's data lives
in its own SQLite file under `data/workspaces//apps//data.db`,
with its own user pool, OAuth providers, files, hooks, and audit log.
- **Three admin tiers** โ master, workspace, and app admins, each scoped exactly
to what they manage.
- **Auth that fits a SaaS** โ email + password, email OTP (passwordless), TOTP
second factor, and OAuth2 / OIDC (Google, GitHub, Microsoft presets shipped).
- **Realtime** โ SSE subscriptions on every collection. Hooks publish on
every create / update / delete.
- **File storage** โ local disk or any S3-compatible bucket (AWS, R2, MinIO)
via `object_store`.
- **JS/TS hooks** โ embedded QuickJS runtime. Drop a `.js` or `.ts` file into
`data/hooks///` and lifecycle handlers, custom HTTP routes, and
scheduled jobs light up. No Node.js required, ever.
- **Hierarchical policies** โ master sets bounds, workspaces tighten, apps pick
values. Auto-clamp + audit when a parent narrows.
- **Audit log per scope**, append-only.
- **Embedded SvelteKit dashboard** at `/_/`, served straight from the binary.
- **Optional Litestream replication** to any S3 endpoint.
## Status
`v0.1` ships the core surface โ auth, collections, hooks, files, realtime,
dashboard, CI/release pipeline, multi-arch Docker image. `v0.2` adds the
production-hardening pack (rate limits, JWKS, PKCE, observability). See
[`ROADMAP.md`](ROADMAP.md) for the trajectory and [`CHANGELOG.md`](CHANGELOG.md)
for what landed.
Not yet a fit for: high-write workloads (>100 RPS sustained, the SQLite write
lock kicks in), multi-region deployments, or compliance-sensitive workloads
without an external review. See the [deployment guide](https://pjonaszik.github.io/rustbase/guide/deployment)
for what "production" means here in concrete terms.
## Quick start
### Docker (fastest)
```sh
docker run --rm -p 8080:8080 -v $(pwd)/data:/home/rustbase/data \
ghcr.io/pjonaszik/rustbase:latest
```
### Native binary
Download the binary for your platform from the
[latest release](https://github.com/pjonaszik/rustbase/releases/latest), or
build from source:
```sh
git clone https://github.com/pjonaszik/rustbase.git
cd rustbase
cargo build --release
./target/release/rustbase
```
Then:
1. Open in your browser.
2. The server auto-seeded an `admin` master-admin row at first boot with no
password โ the **setup wizard** asks you to set one. Submit it.
3. You're signed in. Create your first workspace and your first app.
4. Hit the REST API: `/api/workspaces//apps//collections/...`.
The full walkthrough lives at
[**docs / first-app**](https://pjonaszik.github.io/rustbase/guide/first-app).
## Build from source
You need:
- Rust โฅ 1.88 (stable). Install via [`rustup`](https://rustup.rs/).
- [Bun](https://bun.sh/) for the embedded dashboard and the docs site.
```sh
cargo build --release # produces ./target/release/rustbase
cargo test --workspace # โ 20 s
bun --cwd ui run dev # dashboard dev server, proxies API on :8080
bun --cwd docs run dev # docs dev server (VitePress)
```
See [CONTRIBUTING.md](CONTRIBUTING.md) for the full dev guide, hook setup, and
conventions.
## Architecture in 60 seconds
```
System
โโโ Workspace (organization boundary โ admins live here)
โโโ App (data product โ collections, records, files, end-users, OAuth live here)
```
Storage layout:
```
data/
system.db # workspaces registry, master admins
workspaces/
/
workspace.db # apps, workspace/app admins, admin refresh tokens
apps/
/
data.db # collections, records, users, oauth, app audit
storage/ # file blobs
hooks/
// # JS/TS hook source
```
One binary. One `data/` folder. Backups are object storage; restores are a
directory copy.
Full mental model: .
## Contributing
Bugs, feature ideas, and PRs are welcome. Please read
[CONTRIBUTING.md](CONTRIBUTING.md) first โ it covers the dev workflow,
the conventions the code expects, and how to ship a clean PR.
By participating you agree to the [Code of Conduct](CODE_OF_CONDUCT.md).
For security issues, see [SECURITY.md](SECURITY.md) โ please do **not** open a
public issue for those.
## Support us
RustBase is built and maintained on personal time. If it helps you ship โ or
if you just want to encourage more work on it โ contributions are welcome
through PayPal. The link is a payment link, so you enter the amount yourself
(no fixed tiers, no recurring trap, just a one-off transfer of whatever feels
right):
[**โ Support RustBase on PayPal**](https://www.paypal.com/ncp/payment/5L8KUWE8F2PSU)
Scan to support โ opens the PayPal payment page.
Every contribution โ code, docs, bug reports, PayPal โ keeps the project
moving. Thank you.
## Licence
Dual-licensed under either of:
- MIT License ([LICENSE-MIT](LICENSE-MIT) or
)
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or
)
at your option.
Unless you explicitly state otherwise, any contribution intentionally
submitted for inclusion in the work by you, as defined in the Apache-2.0
licence, shall be dual licensed as above, without any additional terms or
conditions.