MantisBase is a self-hosted C++20 BaaS — one binary gives you instant REST APIs, authentication, realtime SSE, file uploads, and a web admin dashboard.
Perfect for embedded devices, desktop apps, or standalone servers. No runtime dependencies.
1. Run it
# Option A: Download the latest binary from GitHub Releases
wget https://github.com/allankoechke/mantisbase/releases/latest/download/mantisbase_linux-x86_64.zip
unzip mantisbase_linux-x86_64.zip
./mantisbase serve
# Option B: Docker (one-liner)
docker run -p 7070:8080 allankoech/mantisbaseThe server starts on http://localhost:7070 with the API at /api/v1/ and admin dashboard at /mb.
2. Create your admin account
Visit http://localhost:7070/mb to create your admin credentials via the dashboard, or use the CLI:
./mantisbase admins --add admin@example.com your_strong_password3. Build your backend
Create entities (tables) from the admin dashboard or via the REST API — endpoints are generated instantly.
# Example: list records from an entity you created
curl http://localhost:7070/api/v1/entities/postsThat's it — you have a full backend with auth, realtime, and file uploads in under a minute.
| Feature | MantisBase | PocketBase | Supabase | Firebase |
|---|---|---|---|---|
| Language | C++20 | Go | Elixir/Postgres | Proprietary |
| Single binary | ✅ | ✅ | ❌ | ❌ |
| Self-hosted | ✅ | ✅ | ✅ | ❌ |
| Embeddable in C++ | ✅ | ❌ | ❌ | ❌ |
| Realtime (SSE) | ✅ | ✅ | ✅ | ✅ |
| Admin dashboard | ✅ | ✅ | ✅ | ✅ |
| Auth & access rules | ✅ | ✅ | ✅ | ✅ |
| File uploads | ✅ | ✅ | ✅ | ✅ |
| Open source | MIT | MIT | Apache 2.0 | ❌ |
- Auto-generated REST APIs — create a table, get CRUD endpoints instantly → API Reference
- Built-in authentication — JWT-based auth with login, refresh, logout, and token verify → Auth API
- Access control rules — public, auth, or custom expression-based permissions → Access Rules
- Realtime updates — SSE streams for live database changes (SQLite & PostgreSQL) → API Reference
- Admin dashboard — web UI for managing schemas, records, users, and files → Quick Start
- File uploads — multipart upload and serving tied to entity records → File Handling
- Embeddable — use as a C++ library in your own application → Embedding Guide
- JavaScript extensions — extend with custom routes and logic → Scripting Guide
MantisBase supports SQLite (default) and PostgreSQL, with all options configurable via CLI flags or environment variables:
# Custom port and host
mantisbase serve --port 8080 --host 0.0.0.0
# Use PostgreSQL instead of SQLite
mantisbase --db postgresql --db_url "dbname=mydb host=localhost user=postgres password=pass" serve
# Development mode (verbose logging, relaxed JWT defaults)
mantisbase --dev serveSet MB_JWT_SECRET in production for secure token signing. See the CLI Reference for all options.
| Method | Details |
|---|---|
| Pre-built binary | Download from GitHub Releases, extract, and run ./mantisbase serve → Installation Guide |
| Docker | docker run -p 7070:8080 allankoech/mantisbase → Docker Guide |
| Build from source | git clone --recurse-submodules https://github.com/allankoechke/mantisbase.git && cd mantisbase && cmake -B build && cmake --build build → Installation Guide |
| Embed in C++ | Add as a CMake submodule and #include <mantisbase/mantisbase.h> in your app → Embedding Guide |
Requirements: C++20 compiler (GCC/MinGW 13+). Linux builds need
libpq-devanduuid-devfor PostgreSQL support. No external runtime dependencies — everything is bundled.
| Doc | Description |
|---|---|
| Quick Start | Get running in under 2 minutes |
| Installation | Binary, source, and embedding setup |
| CLI Reference | Command-line options and flags |
| API Reference | REST endpoints, schemas, and realtime SSE |
| Authentication | Auth endpoints and JWT flow |
| Access Rules | Permission system and expressions |
| Docker | Container deployment |
| File Handling | Upload and serve files |
| Health Check | Monitoring endpoint |
| Scripting | JavaScript extensions |
Full API docs: docs.mantisbase.dev
Questions, ideas, or feedback? Join the conversation on Discord or GitHub Discussions.
Watch the YouTube playlist for tutorials and walkthroughs.
Contributions are welcome! See CONTRIBUTING.md for guidelines on how to get involved.
MIT © 2025 Allan K. Koech

