POST /api/v1/{collection} Collection-Centric APIs
Define a collection once and ship CRUD APIs with filtering, pagination, and validation already wired.
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.
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 POST /api/v1/{collection} Define a collection once and ship CRUD APIs with filtering, pagination, and validation already wired.
account_id /* auto scoped */ One physical table per collection, many tenant accounts, and automatic row-level isolation at every layer.
checksum + previous_hash Column-level audit events are append-only and hash-linked for traceability, GxP, and CFR-style workflows.
list_rule: "@owns_record()" Collection rules compile into SQL WHERE clauses for row-level and field-level access without policy boilerplate.
on_record_before_create 33+ lifecycle events with priority ordering and abort support so you can extend behavior without forking core.
/api/v1/auth/* Email/password, OAuth, SAML, API keys, and multi-account users are built in for real production requirements.
git clone https://github.com/lalitgehani/snackbase.git cd SnackBase && uv sync uv run python -m snackbase init-db uv run python -m snackbase serve --reload SnackBase gives you startup velocity with enterprise controls: collection rules, multi-account isolation, and immutable audit history.