← Start here · Technical reference · written for technical and AI readers
Stapilo: full technical reference
A detailed description of how Stapilo is built: the applications, how they connect, the data model, the AI agent, integrations, quality controls, security and the measured effort. All figures were measured from the codebase and the live system on 25–26 October 2026. Security-sensitive details (server addresses, keys, internal network layout) are deliberately left out.
1. At a glance
What
Measured
Notes
Product code
~930,000 lines
5,201 files: TypeScript (backend and web apps), Swift (Mac and iOS), Prisma schema. Migrations and translations excluded
Test code
~476,000 lines
3,173 test files; about 34% of all code is tests
Guard rules
573 files
Tests that read the codebase itself and fail when a structural rule is broken; 245 pinned in a registry so they can't be silently removed
Database
336 tables
188 enums, 1,043 migrations, one PostgreSQL database
Screens
187
Organised as rooms → 141 tabs → 241 sub-tabs
AI agent tools
163
In 27 families, all on one shared engine
Background job queues
175
PostgreSQL-backed queue, each with required retry and expiry settings
API
437+ endpoints
133 route files; input validation schemas on write endpoints
Changes
6,449
Since 18 February 2026 (the current codebase); 3,074 merged pull requests; an earlier version of the platform existed before
2. Applications
Application
Who uses it
What it does
Owner app (web)
Business owners and their teams
The AI agent and conversation on one side, the live screen ("canvas") on the other; all building and running happens here
Customer portal (web)
The businesses' own customers
Sign-in, courses, events, bookings, purchases, communities; served on each business's own domain or subdomain
Published sites
Visitors
Pages, funnels, forms and checkouts the businesses publish, served as static files with one shared stylesheet
Preview host and app sandbox
Internal isolation
Business- and AI-made HTML and mini-apps run on separate origins, so they can never read application cookies or sessions
Academy marketplace (web)
The public
A marketplace of what every Stapilo business offers
Platform admin (web)
Stapilo staff
Platform operations, catalog and pricing, health
Desktop app (Electron)
Business owners
The owner's own AI assistant working beside Stapilo through a secure connection
Screen recorder and studio (native Mac, Swift)
Business owners
Records and edits video and uploads it into the business
iOS app (Swift)
Community members
Built, not yet released
Real-time service
All apps
Live updates to open screens
3. Backend architecture
One backend codebase, five processes: a fast API; the agent process (paying businesses' AI); the sales door (anonymous visitors' AI, the same program started separately so a visitor-side problem can't take down a paying business's AI; enforced by a guard); a worker for background jobs; and a real-time service.
Four servers on a private network (application, database, worker, real-time). Each production process runs in two copies so deployments swap without downtime.
Data: one PostgreSQL database accessed through Prisma; Redis for caching, rate limits and real-time; a PostgreSQL-backed job queue (175 queues) with a single entry point for sending jobs and a single way to define workers.
Media: object storage for files and a streaming video service with a built-in player; a media file is only ever deleted after a check confirms nothing references it.
Monitoring: error tracking for backend and web apps with source maps; an hourly health snapshot checks every production process.
4. Data model and multi-tenancy
One person record per customer (the contact) and one access table for every kind of entitlement (course, event, community, product). New features add a resource type, never a new membership table.
One form model covers quizzes, polls, surveys, tests and registrations, through field types and behaviour flags.
One history per customer: every action (purchase, visit, answer, message, webinar attendance) is written through a single function to the customer's timeline, attached to the exact item it concerns (1.69 million events recorded so far).
Tenant isolation: 283 of the 336 tables are automatically scoped to one business: a scoped database client adds the business filter to every read and write, and callers can't override it. Hand-written SQL must include the business condition or the build fails; a security audit walked all 338 raw-SQL sites and found no leak between businesses.
Deletes that matter: deleting anything people depend on first reports what would be affected (registrations, answers, posts); soft deletion with restore for key records.
5. The AI agent
One engine for every agent, so timeouts, error reporting, cost tracking and prompt caching are shared rather than duplicated.
The agent's map is the app's map: a "building" of rooms, tabs and sub-tabs that mirrors exactly what a person clicks through; two automated checks keep the agent's map and the app's screens identical. On every turn the agent knows which room, tab and record the person is looking at.
Tools: 163 tools in 27 families (pages, courses, webinars, campaigns, inbox, ads, shop, bookings, settings and more). Each turn holds a small everyday kit plus a menu from which a family of tools is loaded when needed, keeping prompts small.
One conversation per business, shared by the whole team across rooms; each line is stamped with who wrote it and where. The agent reads a moving window of recent conversation by size, never summaries.
Safety: risky actions (publishing, sending to many people, deleting, refunding) wait for the owner's approval.
Cost control: the fixed start of every prompt is kept byte-identical between messages (enforced by a guard) so the provider's cache applies; every turn's cost is recorded per business. Measured AI cost: about $10–30 per business per month.
Outside AI: an owner's own AI assistant can operate Stapilo through a secure connection, with exactly the owner's permissions.
6. Integrations
Payments
Five payment provider adapters, including Stripe and Paddle plus local processors for countries without Stripe; saved cards, subscriptions, instalments where available, test orders kept out of the books
Meta
Ads management, audiences built from customer segments, Messenger, Instagram and WhatsApp
Email
Three separate sending streams (transactional, automations, campaigns) so bulk mail can never use the identity reserved for receipts and sign-in codes; warm-up and deliverability monitoring; received email lands in a shared inbox with spam filtering that fails closed
SMS and push
SMS sending with failure tracking; push notifications
Zoom and live video
Zoom meetings and events from inside Stapilo; built-in live rooms
AI providers
Models assigned by role (agent, page writing, reading media, support), configurable without code changes
Not yet built
Zapier/Make connections and a public API with keys (outgoing webhooks exist)
7. Quality controls
"One front door" rule: each domain has exactly one official entry point (granting access, checking access, recording an event, sending a job, submitting a form, deleting media). A guard fails the build if any code goes around it.
Ten representative guards: business-scoped raw SQL; visitor AI and business AI in separate processes; secrets stay encrypted; one function checks access; one function grants access; granting access after a payment must be checked, never ignored; one function writes customer history; deletes report their impact; one way to enqueue jobs; the cached prompt prefix stays stable. A further check verifies that guards actually scan files, so a blind guard can't pass.
Continuous integration on every pull request: unit, integration (real PostgreSQL, all migrations applied, schema drift check), route and front-end tests, translation parity, dependency security audit, linting, type-checking of every package, a full build, and end-to-end browser tests as a second required check. Changes merge only when all pass.
Scheduled checks: nightly coverage, weekly mutation testing (the code is deliberately broken to prove tests catch it, with a ratchet that may only improve), a weekly scan for tests that would break on a future date, dependency reports.
AI-assisted development: 94% of changes were written together with an AI coding assistant; all of them pass the same tests and guards as any other change.
8. Security
Authentication: customers sign in with a one-time code (and Google sign-in); sessions are HttpOnly, Secure cookies scoped to one business; the customer identity always comes from the session, never from the request.
Secrets: every production key is stored encrypted, each server able to decrypt only what it needs; third-party credentials in the database are encrypted with AES-256-GCM, and production refuses to start without the key.
Isolation of user-made content: AI- and business-made pages and apps run on separate origins with no access to sessions.
Abuse protection: 399 route-level rate limits, flood limits at the web server, bounded rate-limit keys, payment webhook limits, input validation on write endpoints, security headers enforced by a guard.
Audits: four whole-platform security audits in October 2026 found 143 issues (3 critical, 17 high); 133 are fixed, the rest are owner actions or deliberate decisions. The first audit concluded that the wall between businesses held everywhere it was traced and that no secrets were committed.
Backups: the database is copied every 6 hours to three separate providers, one with a compliance lock that prevents deletion for 7 days; weekly and monthly long-term copies; every off-site copy is encrypted; media and original videos are copied nightly; failed copies raise an alert. Not yet done: a recorded full restore drill from the off-site copies.
9. Effort
Month (2026)
Changes
Lines written
Lines removed
February (from the 18th)
125
103,767
27,956
March
486
224,629
60,205
April
985
253,122
75,796
May
1,524
374,066
129,425
June
468
267,542
86,663
July
275
89,641
25,165
August
731
421,555
158,054
September
1,232
972,633
639,375
October (to the 25th)
545
361,358
284,331
Seven people contributed code in this period (the founder and six developers); 645 person-days of recorded work; the founder active on 194 of 250 days. Large removals in September and October are deliberate rewrites (the old dashboard and the old AI engine replaced). Development spans about 18 months in total: an earlier version (in a separate repository, not counted here), then the current codebase since 18 February 2026, which every figure on this page measures; at least 8 months with a team of five.
10. Code review on request
For serious investors, a technical reviewer they name can be given time-limited, read-only access to a clean copy of the codebase (without secrets or history that contains them), under a confidentiality agreement.