Skip to content

Repository files navigation

LightBase Logo

A local-first, multi-protocol API development client powered by a native C-Core engine. Note: We are currently transitioning our C-Core to Swift for improved memory safety and modern concurrency.

C99 Python License Tests LightBase - Lightweight API & Database Desktop Client | Product Hunt

LightBase is a local API development client that combines a C99 backend with a Python gateway bridge and a browser-based UI. Every request, collection, and environment is stored as plain JSON files you can version-control with Git — no accounts, no cloud sync, no telemetry.


Architecture

          
   Browser UI     ←→     Python Bridge             ←→     C-Core Engine      
  (HTML/CSS/JS)  HTTP    (ThreadingHTTPServer)     IPC    (libcore.so)       
                                                   TCP                       
  • API Studio          • Route dispatcher               • OpenSSL TLS 1.3   
  • SQL Console         • Advanced features              • Lock-free pool    
  • Flow Builder        • Plugin executor                • Security module   
  • Security Tab        • Export engine                   • mmap telemetry    
  • Dashboards          • Auth handler                   • Git watcher       
          
                                                          
                                       127.0.0.1:8001
                          workspace/               (TLV binary protocol)
                           (Git-able)
                         

Layer Responsibilities

  • Native Desktop UI — Lightweight HTML/CSS/JS client rendered in a native desktop window (via pywebview/WebKit2), featuring glassmorphism design, protocol tabs, security dashboard, and real-time displays.
  • Python Bridge — Multi-threaded HTTP gateway (ThreadingHTTPServer on port 8000) that proxies requests to the C-Core, runs advanced features, manages plugins, and spins up the PyWebView window natively.
  • C-Core (libcore.so) — Multi-threaded native engine handling TLS networking, SQLite queries, telemetry logging, AES crypto, Git reactive state, and AI inference via a binary TLV protocol over TCP 127.0.0.1:8001

Quick Start

Installation via Package Managers

LightBase is natively available for Arch Linux, macOS, and Windows.

Arch Linux (AUR)

If you are on Arch Linux, Manjaro, or EndeavourOS, you can install LightBase directly from the Arch User Repository (AUR) using yay:

yay -S lightbase

macOS (Homebrew) [Dependencies ONLY... Build Yourself]

For macOS, you can use Homebrew:

brew install cmake pkg-config openssl sqlite libgit2 python curl
make

Windows (MSYS2) [Dependencies ONLY... Build Yourself]

For Windows, we recommend using MSYS2:

pacman -S --noconfirm --needed mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc mingw-w64-x86_64-pkg-config mingw-w64-x86_64-openssl mingw-w64-x86_64-sqlite3 mingw-w64-x86_64-libgit2 mingw-w64-x86_64-python mingw-w64-x86_64-python-pip curl
make

Manual Install (Build from Source)

git clone https://github.com/Aarav90-cpu/LightBase.git
cd LightBase
make install-deps    # Auto-detects your distro and installs packages
make                 # Build C-Core + install Python deps
sudo make install    # System-wide install (appears in app menu!)

After install, launch from your app menu or terminal:

lightbase

Supported OS

OS Package Manager Note
macOS brew Native ARM64 / x86_64
Windows MSYS2 pacman MinGW64 target
Arch pacman Arch, Manjaro

make install-deps automatically detects your distro and runs the correct package manager.

Manual Steps (if you prefer)

# 1. Build
make

# 2. Run locally (without system install)
make run

Make Targets

Command Description
make Build C-Core + install Python deps
make install-deps Auto-detect distro, install system packages
make build Build C-Core only
make run Start the bridge server (port 8000)
make test Run full test suite (75 tests, 24 categories)
sudo make install System-wide install → app menu + lightbase command
sudo make uninstall Remove system-wide install
make clean Remove build artifacts, caches, logs
make dist Create production distribution bundle

Boot Output

[C-Core Pool] Asynchronous Interceptor Grid deployed with 8 active threads!
[Security]  HMAC-SHA256 signing key initialized (mlock+dontdump).
[Bridge]  Security module armed (HMAC + rate limiter + path guard + SQL sanitizer).
[Bridge]  Git reactive watcher armed.
[Bridge] LightBase API → http://localhost:8000 

Run Tests

make test     # Runs test_all.py (75 tests across 24 categories)

Clean Up

make clean    # Remove build artifacts, caches, logs, temp files

Security API Reference

Endpoint Description
POST /security/status Full security module status report
POST /security/sign HMAC-SHA256 sign a payload
POST /security/verify Verify payload signature
POST /security/validate_path Check path for traversal attacks
POST /security/validate_sql Check SQL for injection patterns
POST /security/ip/add Add IP allow/block rule
POST /security/ip/remove Remove IP rule
POST /security/ip/list List all IP rules
POST /security/ip/check Check if IP is allowed
POST /security/session/create Create session token with TTL
POST /security/session/validate Validate session token
POST /security/session/revoke Revoke session token
POST /security/session/list List active sessions
POST /security/audit/log Read audit trail
POST /security/audit/clear Clear audit trail
POST /security/max_size/set Set max request size
POST /security/max_size/get Get max request size

Documentation

For complete feature documentation, usage guides, and API reference:

User Guide

Covers all features including API Studio protocols, test scripts, visual flows, plugin system, AI workflows, exports, built-in security features, and advanced workflows.


CLI Usage

Run headless requests without the UI:

# Via the included CLI script
./bridge/lb-cli.sh httpbin.org /get GET

# Or directly via curl
curl -X POST http://localhost:8000/request \
  -H "Content-Type: application/json" \
  -d '{"method":"GET","hostname":"httpbin.org","path":"/get","headers":[]}'

License

Licensed under the Apache License 2.0.


Built with ❤️ — 100% local, zero cloud dependencies.

Releases

Contributors

Languages