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 automation engine handles webhooks, workflows, and custom endpoints without writing backend code.
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,
});
// → rules enforced + audit captured + webhooks fired
// Trigger a workflow manually
await sb.workflows.trigger('wf-order-processing', {
order_id: order.id,
}); 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.
trigger → condition → action Webhooks, API-defined hooks, multi-step workflows, and custom endpoints — all configurable via API, no backend code.
/api/v1/x/{your-slug} Define serverless-like HTTP endpoints that execute action pipelines with query, aggregate, and transform steps.
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, immutable audit history, and a built-in automation engine for webhooks, workflows, and custom endpoints.