Skip to content

Repository files navigation

MantisBase

CI Release License: MIT Docker Pulls Discussions Discord

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.


Quick Start

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/mantisbase

The 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_password

3. 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/posts

That's it — you have a full backend with auth, realtime, and file uploads in under a minute.


Why MantisBase?

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

Features

  • 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 Admin Dashboard


Configuration

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 serve

Set MB_JWT_SECRET in production for secure token signing. See the CLI Reference for all options.


Install

Method Details
Pre-built binary Download from GitHub Releases, extract, and run ./mantisbase serveInstallation Guide
Docker docker run -p 7070:8080 allankoech/mantisbaseDocker Guide
Build from source git clone --recurse-submodules https://github.com/allankoechke/mantisbase.git && cd mantisbase && cmake -B build && cmake --build buildInstallation 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-dev and uuid-dev for PostgreSQL support. No external runtime dependencies — everything is bundled.


Documentation

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


Community

Questions, ideas, or feedback? Join the conversation on Discord or GitHub Discussions.

Watch the YouTube playlist for tutorials and walkthroughs.

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines on how to get involved.

License

MIT © 2025 Allan K. Koech

About

Open-source backend in a single C++ binary: instant REST APIs, auth, realtime, admin dashboard. The embeddable PocketBase alternative.

Topics

Resources

Contributing

Stars

13 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages