allankoech/mantisbase

By allankoech

Updated about 1 month ago

Lightweight BaaS with auto REST APIs, real-time DB, auth, and an admin dashboard in one binary.

Image
Networking
API management
Web servers
0

1.1K

allankoech/mantisbase repository overview

MantisBase Docker Image

Docker Pulls GitHub

A lightweight, pluggable Backend-as-a-Service (BaaS) built in C++. Get instant REST APIs, authentication, and an admin dashboard in a single container.

Quick Start

Basic Usage
docker run -d \
  --name mantisbase \
  -p 7070:80 \
  mantisbase:latest
Access the services:
With Persistent Data
docker run -d \
  --name mantisbase \
  -p 7070:80 \
  -v $(pwd)/data:/mb/data \
  -v $(pwd)/public:/mb/public \
  -v $(pwd)/scripts:/mb/scripts \
  mantisbase:latest
Using Docker Compose
services:
  mantisbase:
    image: mantisbase:latest
    ports:
      - "7070:80"
    volumes:
      - ./data:/mb/data
      - ./public:/mb/public
      - ./scripts:/mb/scripts
    restart: unless-stopped
    environment:
      - MANTIS_JWT_SECRET=your-secret-key-here

Run with: docker compose up -d

First Steps

1. Create Admin Account

docker exec -it mantisbase mantisbase admins add [email protected] your_secure_password

2. Access Admin Dashboard

Open http://localhost:7070/mb in your browser and log in with your admin credentials.

3. Create Your First Entity

Use the admin dashboard to create tables and configure access rules, or use the API:

curl -X POST http://localhost:7070/api/v1/schemas \
  -H "Authorization: Bearer <admin_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "posts",
    "type": "base",
    "fields": [
      {"name": "title", "type": "string", "required": true},
      {"name": "content", "type": "string"}
    ],
    "rules": {
      "list": {"mode": "public", "expr": ""},
      "get": {"mode": "public", "expr": ""},
      "add": {"mode": "auth", "expr": ""}
    }
  }'

Configuration

Environment Variables
  • MANTIS_JWT_SECRET - JWT secret key for token signing (required for production)
Volume Mounts
  • /mb/data - Database files, logs, and uploaded files
  • /mb/public - Static files to serve
  • /mb/scripts - JavaScript extension scripts
Custom Port

The container exposes port 80 internally. Map it to any host port:

docker run -d -p 8080:80 mantisbase:latest

PostgreSQL Support
docker run -d \
  -p 7070:80 \
  -e MANTIS_JWT_SECRET=your-secret \
  mantisbase:latest \
  mantisbase --database PSQL \
    --connection "dbname=mantis host=postgres port=5432 user=postgres password=postgres" \
    serve

Tags

  • latest - Latest stable release
  • 0.3.1 - Specific version tag
  • 0.3 - Version series

Features

  • Auto-generated REST APIs - Create tables and get instant endpoints
  • JWT Authentication - Built-in user authentication
  • Real-time Database - Database notifications for changes using SSE
  • Admin Dashboard - Web-based management interface
  • File Handling - Upload and serve files
  • Access Control - Flexible permission rules
  • JavaScript Extensions - Custom logic support
  • SQLite/PostgreSQL - Multiple database backends

Documentation

Examples

List Records
curl http://localhost:7070/api/v1/entities/posts
Create Record
curl -X POST http://localhost:7070/api/v1/entities/posts \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"title": "My Post", "content": "Hello World!"}'
Upload File
curl -X POST http://localhost:7070/api/v1/entities/posts \
  -H "Authorization: Bearer <token>" \
  -F "title=My Post" \
  -F "[email protected]"

Support

License

MIT License © 2025 Allan K. Koech

Tag summary

Content type

Image

Digest

sha256:3d0cc7682

Size

37.5 MB

Last updated

about 1 month ago

Requires Docker Desktop 4.37.1 or later.