Application-Development
The Platform We Built Because We Kept Rebuilding the Same Backend
A multi-tenant business platform with an AI layer, powering every site we ship
Application-Development
The Platform We Built Because We Kept Rebuilding the Same Backend
A multi-tenant business platform with an AI layer, powering every site we ship
Every client project used to get its own backend: analytics, forms, SEO data, CRM, bookings, all rebuilt from scratch. A tenth of the functionality for three times the development time, on every single project. So we built the platform instead. Sonor is a multi-tenant business system with two NestJS APIs, an AI layer of 246 registered tools, a 45-export npm SDK that connects any Next.js site to it, and a React dashboard where agencies and businesses run analytics, SEO, CRM, forms, commerce, bookings, reputation, and more.
- Platform Engineering
- Multi-Tenant SaaS
- AI Systems
- API Architecture
- SDK Development
The site
2,164
HTTP endpoints across two APIs
Measured
246
Registered AI tools
Measured
475
Production database tables
Measured
59
SDK public exports
Measured
Challenges
What stood in the way
4 problems, and what each one took to clear.
Challenge 01
Problem
Every project rebuilt the same backend, badly
Each client site needed the same foundations: analytics, form handling, SEO data, content, a CRM to receive leads. Building those per project meant a tenth of the functionality for three times the development time, and every site aged separately.
Solution
We built the platform once. Two NestJS APIs, one for business data and operations and one for AI, sitting behind a shared multi-tenant model of organizations, projects, and plans.
Result
New sites connect to a mature backend on day one instead of growing a thin one over months.
Challenge 02
Problem
A platform is only useful if sites can actually reach it
A powerful API that every project has to integrate by hand is just a different kind of repeated work.
Solution
We built an SDK. One npm package with 100 public entry points covering SEO, analytics, forms, blog, commerce, bookings, reputation, images, redirects, sitemaps, and AI discovery, authenticating with a single project key so sites never handle project identifiers. Seven of those exports are versioned wire contracts shared by the sites and the servers, with a runtime version-skew warning when they drift.
Result
Connecting a site is an install and one environment variable, and every site inherits improvements as the package version moves.
Challenge 03
Problem
Agencies and their clients need different views of the same system
An agency managing dozens of client businesses, an independent business managing itself, and the platform operator all need genuinely different access to overlapping data.
Solution
We modeled organizations by type with agencies managing client organizations, projects carrying their own plan tier, and a plan guard that gates AI features at the request level. The tiering is data, not scattered conditionals, and platform administrators bypass it explicitly rather than accidentally.
Result
One system serves agencies, their clients, independents, and operators without forking the product.
Challenge 04
Problem
An AI that can act needs limits before it needs features
An assistant that can change a live business system is only safe if there is a structural answer to what it may do without asking. Ten separate features each inventing their own approval flow is how that goes wrong.
Solution
We built the Action Ledger, with one rule: new capabilities do not create their own proposal tables, status enums, or autonomy switches, they register on the ledger. Autonomy is a per-project policy with a mode for each action class, a daily cap on automatic changes, a confidence floor that demotes automatic to proposed, and automatic revert. The agent itself can only file proposals; it never applies changes directly.
Result
Agent capability and agent authority are separated by architecture rather than by prompt instructions.
Strategy
How the work ran
4 phases, in the order they happened.
Phase 01
Extracting the pattern
We took what every client project kept rebuilding and turned it into a shared model: organizations, projects, plans, and the data domains every business site actually needs.
- Multi-tenant data model
- Plan and feature tiering
- Authentication and API key design
- Core domain schemas
Phase 02
Building the business API
We built the operations backbone: CRM, SEO, analytics ingestion, forms, blog, commerce, bookings, reputation, broadcast, proposals, billing, and platform administration.
- NestJS API across 48 modules
- Public namespace for connected sites
- Layered authentication guards
- Stripe and Square billing paths
Phase 03
Building the AI layer
We built a second API for intelligence: a conversational assistant with full business context, a registry of tools it can call, memory that persists across sessions, pattern and anomaly monitors, and a knowledge graph.
- 246 registered AI tools
- 169 model-routed intents
- Tiered model routing with cost controls
- Action Ledger and autonomy policy
Phase 04
Connecting the sites
We built the SDK that makes the platform reachable from any Next.js site, with versioned contracts shared between package and server so the two cannot silently drift apart.
- 59-export npm package
- Seven versioned wire contracts
- Server-rendered SEO and blog modules
- Analytics, forms, and AI discovery
Results
What it delivered
Outcomes
Backends stopped being project work
Analytics, forms, SEO, and CRM arrive with the SDK instead of being rebuilt per client.
One system, many tenancies
Agencies, their client businesses, and independent operators all run on the same platform with plan-gated capability.
AI with structural limits
Autonomous action is governed by a single ledger and a per-project policy rather than by feature-level switches.
Tech stack
What it's built with
14 technologies.
NestJS 11
TypeScript
React 19
Vite
Tailwind CSS 4
PostgreSQL
Supabase
Redis
BullMQ
OpenAI
Stripe
Square
Render
Netlify
Project details
What the job was
The particulars of the build, as the record states them.
Industry
Software & SaaS