v0.6.0 Hook API v1.0 AGPLv3

Build like a startup. Comply like an enterprise. Own your backend.

SnackBase is an open-source Python backend for multi-tenant products that need real controls. Rules compile to SQL, audit trails are immutable, and the hook system lets you customize behavior without rewriting core services.

GitHub stars
1,161 tests
33+ hook events
19 API routers
sdk-example.ts
import { SnackBaseClient } from '@snackbase/sdk';

const sb = new SnackBaseClient({
  url: 'https://api.yourapp.com',
  token: session.token,
});

// Collection-centric records API with automatic tenant scoping
const { items, total } = await sb.records.list('products', {
  filter: { active: true },
  sort:   ['-created_at'],
  perPage: 20,
});
// → { items: Product[], total: 847 }

const order = await sb.records.create('orders', {
  product_id: items[0].id,
  quantity:   3,
});
// → collection rules enforced + immutable audit captured
CAPABILITIES

Why SnackBase is different

POST /api/v1/{collection}

Collection-Centric APIs

Define a collection once and ship CRUD APIs with filtering, pagination, and validation already wired.

account_id /* auto scoped */

Shared-Table Multi-Tenancy

One physical table per collection, many tenant accounts, and automatic row-level isolation at every layer.

checksum + previous_hash

Immutable Audit Chain

Column-level audit events are append-only and hash-linked for traceability, GxP, and CFR-style workflows.

list_rule: "@owns_record()"

SQL-Compiled Rules

Collection rules compile into SQL WHERE clauses for row-level and field-level access without policy boilerplate.

on_record_before_create

Stable Hook API v1.0

33+ lifecycle events with priority ordering and abort support so you can extend behavior without forking core.

/api/v1/auth/*

Enterprise Auth Surface

Email/password, OAuth, SAML, API keys, and multi-account users are built in for real production requirements.

STACK

Built for regulated multi-tenant SaaS

Your Product
React / Vue / Svelte Internal Tools Agent Workflows
SDK Layer
@snackbase/sdk @snackbase/react Typed Service Clients
API Surface
/api/v1/{collection} /api/v1/auth/* /api/v1/realtime/*
SnackBase Engine
Rules → SQL Hook System v1.0 Audit Integrity Chain Account Isolation
Storage Layer
PostgreSQL MySQL SQLite (dev)
QUICKSTART

From clone to running instance

Clone
git clone https://github.com/lalitgehani/snackbase.git
Install
cd SnackBase && uv sync
Initialize
uv run python -m snackbase init-db
Serve
uv run python -m snackbase serve --reload
// NEXT STEP

Ship product logic, not backend plumbing.

SnackBase gives you startup velocity with enterprise controls: collection rules, multi-account isolation, and immutable audit history.