TypeScript · Cloudflare · Edge-native
Your next product
is already 80% built.
One coherent stack: Auth, OttaORM, RBAC & RLS that fail closed, Queues, Cron, Realtime, a multilingual Blog/CMS, a landing site you edit in the admin, BYOK AI & UI components - wired together for multi-tenant SaaS apps on Cloudflare Workers.Your AI already knows this codebase: 60+ production-ready packages it can pull in with one command, and 14 built-in agent skills that teach it the Ottabase way.An idea on Friday, a product on Monday.
Edge KV·D1 + Drizzle·Durable Objects·MIT
Everything your needs.
In Packages.
Open-source monorepo on Cloudflare Workers - not a hosted backend. 63 packages and four apps: otta-web for your product, otta-worker for a single Worker with no SPA, otta-landing for your public site, otta-cache for your builds.
Expressive APIs.
For Humans and Agents alike.
Even 100% AI-generated code stays readable, intentional, and truly yours.
Fields, relationships, and domain logic live in one class. Validation, CRUD APIs, forms, and tables are derived from it - one place defines it all. Inspired by Laravel Eloquent, built from day one for TypeScript and Cloudflare Workers.
import { BaseModel } from '@ottabase/ottaorm';
import { postsTable } from './Post.schema';
export class Post extends BaseModel {
static entity = 'posts';
static table = postsTable;
static softDeletes = true;
static casts = { publishedAt: 'date', featured: 'boolean' } as const;
// Drives Zod validation, generated forms, tables, and the API.
protected static fields = {
title: { type: 'string', searchable: true, validation: { rules: 'required' } },
status: { type: 'string', formConfig: { fieldType: 'select' } },
};
// Domain logic on the model - not in a forwarder.
async publish() {
this.set('status', 'published');
this.set('publishedAt', new Date());
return this.save();
}
async author() {
const { User } = await import('@ottabase/ottaorm');
return this.belongsTo(User, 'userId');
}
}
// GET / POST / PATCH / DELETE /api/ottaorm/posts
// ↑ one allowlist entry. Zero extra code.import { createModelHooks } from '@ottabase/ottaorm/client';
// One call. Every hook.
export const {
useList: usePosts,
useDetail: usePost,
useInfiniteList: usePostsInfinite,
useCreate: useCreatePost,
useUpdate: useUpdatePost,
useDelete: useDeletePost,
} = createModelHooks<PostType>({ entityName: 'posts' });
// In your component:
const { data } = usePosts({
where: { status: 'published' },
orderBy: 'publishedAt', orderDirection: 'desc',
limit: 20,
});
const update = useUpdatePost();
update.mutate({ id, data: { status: 'published' } });
// Caching, dedup, retries, and optimistic updates are
// framework-owned. No fetch() in client code - lint says so.import { initRLS, registerPolicy, RLSPolicies } from '@ottabase/ottaorm';
// Every model needs a policy. No policy, no access.
initRLS();
registerPolicy({ model: 'invoices', policy: RLSPolicies.TenantScoped(false) });
// Per request: identity from the verified session,
// org membership from D1 - never from a client header.
const ctx = await getSecurityContext(request, session, env);
// The tenant filter is merged last. A client `where`
// can't widen it; unresolved membership is a denial.
const res = await executeSecureCrudRequest(crud, ctx);
// Permission + scope. Never a role name.
await user.hasPermission('invoices:update', {
organizationId: ctx.organizationId,
});
// Multi-tenancy is the foundation,
// not the feature you add in month 6.$ ls .claude/skills
ottabase-create-model ottabase-crud ottabase-form
ottabase-rbac ottabase-upload ottabase-email
ottabase-queue ottabase-cron ottabase-theme
ottabase-component ottabase-package ottabase-migration
ottabase-testing ottabase-cloudflare ottabase-new-app
ottabase-update ottabase-downstream
$ pnpm docs:llms
✓ llms.txt the index any agent can read
✓ llms-full.txt every guide and README, one file
> "Add invoices: model, CRUD, admin table, org-scoped."
▸ ottabase-create-model schema · registry · migration
▸ ottabase-crud allowlist · createModelHooks · ModelCrud
▸ ottabase-rbac RLS policy · permission + scope
✓ No custom endpoint. No fetch(). No new architecture.$ pnpm cf:login
$ pnpm otta deploy otta-web
✓ D1 database (SQLite at the edge)
✓ KV namespace (sessions + permission cache)
✓ R2 buckets (public files, private files, backups)
✓ Queue (background jobs)
✓ Built: the packages it uses, then the app
✓ Deployed, tagged with the commit; secrets set
✓ https://otta-web-production.my-account.workers.dev # custom domains work too
→ open /__bootstrap__ once: migrations, RBAC seed, owner, finalize
# Then Cloudflare Workers Builds, on every push to main:
$ pnpm otta deploy otta-web --ci
✓ Only when something it uses changed
✓ Live on 275+ edge locations
# Later schema changes: Admin → Migrate. $0-$5/mo covers most MVPs.Edge-first.
Not ported-from.
Ottabase was designed for Cloudflare Workers from day one - not ported from Node.js. Every layer is a first-class Cloudflare primitive, not a wrapper hiding something slower underneath.
D1 for your relational database (SQLite, replicated globally). KV for sub-millisecond RBAC permission checks and session lookups. R2 for file storage with Cloudflare Images processing. Durable Objects for stateful WebSocket pub/sub without a separate Realtime bill. Queues for reliable background jobs. Analytics Engine for high-volume event tracking at the edge.
You own every bit of it - deployed under your own Cloudflare account. Sub-100ms latency to users in 275+ cities worldwide, with no cold starts and pricing that stays predictable as you scale. Not sponsored. Just convinced.
Read the philosophyRBAC cache
Files
Realtime
Jobs
Secure by default
Every gate fails closed.
Tenant leaks rarely come from the code you wrote. They come from the check you forgot. In Ottabase, a forgotten check is a denial - not a leak.
7 defaults / 0 flags
RLS + RBAC- 403
POST /api/ottaorm/user_rolesCRUD is an allowlist - 403
GET /api/ottaorm/posts x-org-id: theirsOrg header vs. your memberships - DENY
ctx.memberOrganizationIds = undefinedUnresolved is never unscoped - IGNORED
role: "owner"Permission + scope, not names - 429
POST /__bootstrap__/api/init ×20Secret guesses throttled - DROPPED
GET /api/auth/callback/googleProvider tokens never stored - OPAQUE
throw new Error(stack, policy, ctx)Clients get a generic error
From an empty folder to going live.
Clone, env, dev servers, then a built-in bootstrap wizard on first open - no mystery init route. Under five minutes to a logged-in tenant app.
- Clone & install - git clone + pnpm install + pnpm build:pkg - shared packages must compile before first dev.
- Env secrets - pnpm env:secrets writes apps/otta-web/.env.local with every local secret generated. Safe to re-run; it never overwrites a value you set.
- Setup Cloudflare - pnpm cf:setup when you want real D1/KV/R2/Queues bindings. For a local spin, Wrangler --local needs nothing more.
- pnpm dev - Vite on 3003, Wrangler on 3004; it waits for both before opening the browser. pnpm otta start <app> runs any other app.
- Bootstrap wizard - First visit to localhost:3003 redirects to /__bootstrap__: migrations, RBAC seed, owner account, finalize via a GUI wizard.
- Deploy - git push - CI lints, type-checks, tests, and deploys. First production boot runs the same wizard once; later schema tweaks use Admin → Migrate.
Ottabase Pro
When the side project becomes the business.
Everything above is complete and stays MIT. Pro is the eleven packages a company running on it needs next: see every app on one board, charge your users, catch every error, tell customers what is going on, open the database from the admin. Source, in a private repository you clone into your monorepo. No license keys, nothing gated.
Nothing already open source ever moves behind the paywall. That's a promise →
- @ottabase/payportSell plans to your users.
- @ottabase/helpdeskAnswer customers next to everything you know about them.
- @ottabase/og-studioDraw the card every shared link shows.
- @ottabase/campaignsEmail your users from the app they signed up to.
- @ottabase/lifecycleThe right mail when something happens.
- @ottabase/blackboxEvery error, grouped, with the evidence.
- @ottabase/beaconA status page your app serves itself.
- @ottabase/workbenchYour D1, inside the admin.
- @ottabase/privacyEvery data request answered before its deadline.
- @ottabase/ssoYour customers sign in with their own identity provider.
- @ottabase/towerEvery app you run, on one board.
Own 100% of the stack.
Stop Rebuilding.
Start Shipping!
Open sourced under the MIT License.
v1.13.0 · github.com/ottabase/ottabase