EARLY Open source. Pre-1.0. Looking for first users →

Partner commissions.
Inside your own Postgres.

An embeddable, event-sourced commission engine for Next.js. The event log is the source of truth. Escrow release runs on pg_cron. No servers, no workers, no vendor lock-in.

// WHAT IT DOES

Event-sourced attribution.
Integer money math. Postgres-native.

Every piece is a pure function you can test in isolation. The engine never touches money — it emits payout tasks.

01 / EVENT LOG

Append-only source of truth

One table. Typed events. No updates, no deletes. Every projection is a fold over this log.

02 / PROJECTIONS

Rebuildable state

Leads, payouts, and timelines derive from the event log. Drop a table, replay, done.

03 / MONEY

Integer minor units

No floats. Commission math uses exact integer arithmetic. Rounding rules are explicit.

04 / RULES

Attribution & qualification

First-touch, last-touch, or custom. Sensible defaults, fully overridable via config.

05 / ESCROW

pg_cron holds and releases

Commissions sit in a held state. The database itself releases them on schedule. No worker process.

06 / AUTH

Vendor-neutral adapter

RLS policies check a session variable, not a provider-specific UID. Supabase adapter ships first.

// HOW IT WORKS

Four steps.
No orchestration.

Everything runs inside your existing Next.js app and Postgres database.

app/api/stripe/route.ts
// Minimal install: engine + Postgres. Nothing else.
import { init } from 'tandem-core';

const crm = init({
  db: { connectionString: process.env.DATABASE_URL },
  escrow: { holdDays: 30 },
  attribution: { strategy: 'first-touch' },
});

// Adapters map external payloads to typed events.
await crm.append({
  type: 'commission.earned',
  payload: { /* ... */ },
  partnerId: 'partner_123',
});

// Escrow release runs on pg_cron inside Postgres.
// No worker process. No external queue.
// ROADMAP

What's built.
What's coming.

This is the honest current state. No features are promised before they exist.

Live

tandem-core

The engine. Event log, projections, integer money math, idempotency, escrow release via pg_cron, Supabase auth adapter. Running in production.

Planned

tandem-crm

The CRM surface. Contacts, kanban, timeline, and an optional shadcn/ui admin. Built on tandem-core.

Planned

tandem-ramp

Sales onboarding orchestration. Reads tandem-core events, ships its own event types.

Planned

tandem-coaster

Clawbacks, disputes, and payout blocking. The brakes on the commission engine.

Planned

BetterAuth adapter

For Neon and plain-Postgres users. Bring-your-own-auth, no Supabase required.

Planned

Tandem Cloud

Managed hosting. Provisioning, monitoring, upgrades. Not started. Not before the open-source packages have real users.

// READ THE CODE

One runtime dependency.
Read it in an afternoon.

MIT licensed. Self-host it, fork it, replace the UI, delete what you don't need.

View on GitHub Read the docs