Mantis
A lightweight, pluggable Backend-as-a-Service (BaaS) library built in C++
Portable. Embeddable. Syncable. Built for speed and extensibility.
🔧 Overview
Mantis is a modular, lightweight C++ library designed to power modern backend systems in embedded devices, desktop tools, or standalone server deployments. Inspired by systems like PocketBase and Supabase, Mantis focuses on:
- Minimal runtime footprint
- SQLite as the default local database (with optional MySQL/PSQL support)
- Built-in authentication and access control
- Auto-generated REST APIs
- Pluggable sync layer (client-server)
- Embeddable as a reusable C++ library
🛠️ Tech Stack
- Language: C++
- Database: SQLite (default), MySQL/PSQL (planned)
- Build System: CMake
- Packaging: Docker + CLI
- Sync: WebSocket / REST delta sync (planned)
NOTE: On windows, we use mingw
not MSVC
due to some feature incompatibility. For mingw
, it requires at least v13
with support for std::format
.
</blockquote>
🚀 Getting Started
git clone --recurse-submodules https://github.com/allankoechke/mantis.git
cd mantis
cmake -B build
cmake --build build
./build/mantisapp serve -p 5000
You can also embed Mantis as a library in your own C++ project:
int main(
const int argc,
char* argv[])
{
app.init();
return app.run();
}
The main application for mantis.
Mantis entry point.
Definition app.h:63
int main(const int argc, char *argv[])
MantisApp standalone entrypoint.
Definition mantisapp.cpp:16
Check mantis/examples for a sample
Admin Dashboard
Mantis ships with a lightweight admin dashboard available on <host>:<ip>/admin
and restricted to admin login only. By default, in your setup, you need to create a admin user account using the CLI command:
mantisapp admins --add <email>
With the admin account created, we can then use it to log in to the admin dashboard. The dashboard allows for easy management of:
- **__CRUD__** on admin accounts
- **__CRUD__** on system logs [WIP?]
- **__CRUD__** on database tables (only the tables managed by mantis).
- **__CRUD__** on records in the tables.
- Schema & database migration [WIP?]
By default, admin auth tokens expire after an hour, but it's configurable in the settings tab of the dashboard.
___admin dashboard snapshot___
📁 Project Structure
mantis/
├── include/
│ └── mantis/ # Public API headers
├── src/ # Internal implementation
├── examples/ # Embedding examples
├── tests/ # Unit & integration tests
├── docker/ # Docker deployment
└── CMakeLists.txt
🤝 Contributing
Contributions are welcome! Please see CONTRIBUTING.md and open an issue or PR.