Technology

How Uynzo works under the hood

Uynzo splits every scenario into two jobs. A deterministic engine on our servers calculates every number. Claude, Anthropic’s AI model, then explains those numbers in plain language and answers follow-up questions, without ever changing them.

This page describes the architecture for engineers, partners and program reviewers: what runs where, which data goes to the AI model, and how each workspace is kept separate.

  • Six deterministic models
  • Engine version 2026.11.1
  • Claude for narrative only
  • Row-level security on Postgres
A calculated Product Launch scenario in Uynzo: the headline result, badges reading Favourable, Illustrative Scenario and Engine 2026.11.1, impact figures for revenue, costs, profit, customers, break-even and ROI, and the Ask about this scenario assistant beside it.
Product screenshot with sample data

Architecture

One application, three services

Uynzo is a single Next.js application. Calculations, AI calls and privileged database access all run in server code; the browser only receives rendered pages and results.

Your browserWebsite and dashboard
  • Pages rendered on the server
  • Forms post to server actions
  • Assistant replies stream in
Uynzo applicationNext.js App Router, React 19, TypeScript · runs on our hosting provider
Server componentsRender the dashboard, scenarios and reports from Postgres on the server.
Server actionsHandle every form: zod validation, role checks, then writes to Postgres.
Chat route handler/api/ai/chat streams assistant replies as they are generated.
Scenario engineSix pure, deterministic calculators. No I/O, no AI.
AI layerBuilds prompts, validates Claude’s structured output, falls back safely.
GuardsWorkspace roles, AI rate limits, feature flags and admin audit logs.
SupabasePostgres + Auth
  • Managed PostgreSQL
  • Row-level security on every customer table
  • Email and password sign-in, confirmation and reset
AnthropicClaude API
  • Narrative analysis with a strict output schema
  • Streaming scenario assistant
  • Never calculates the figures
ResendTransactional email
  • Welcome and team invitation emails
  • Plan, payment, support and contact emails
  • Every send logged
Your browser talks to the Uynzo application over HTTPS. The application calls Supabase, Anthropic and Resend from the server with keys that never reach the browser.

Request flow

What happens when you run a scenario

The deterministic result is saved before any AI call starts, so the numbers never wait for, or depend on, the AI.

  1. Validate

    You submit a scenario form. A server action checks your workspace and plan limits, then validates every input against that scenario’s zod schema.

  2. Save

    The scenario and its inputs are written to Postgres as you, so row-level security decides which workspace they can belong to.

  3. Calculate

    The engine runs the chosen model with your inputs, using your Business Data as context. The result is stamped with the engine version and saved by the server. Users can read results but never write them.

  4. Explain

    Opening the result requests the AI analysis. The server checks the feature flag and rate limits, sends the inputs and result to Claude, and validates the structured response.

  5. Fall back

    If AI is switched off, over its limit, refused or invalid, a summary built from the result itself is stored instead. The calculated numbers are never affected.

  6. Log and notify

    Each AI request is logged with its model, token counts, duration and status, and an in-app notification tells you when the analysis is ready.

Scenario engine

Numbers from a deterministic engine

Each model is a pure TypeScript function with no I/O and no AI: the same inputs always produce the same result. Every result records the engine version that produced it (currently 2026.11.1). Stored inputs are validated again before every calculation.

  • Pricing Decision

    Applies a new price and your expected customer response, phased in evenly over three months, against today’s price and customers.

    Computes
    • Monthly revenue
    • Monthly profit
    • Profit margin
    • Break-even customers
  • Hiring Decision

    Adds salary and one-off hiring costs for each hire, with the expected revenue ramping up over three months.

    Computes
    • Net monthly impact
    • Monthly team cost
    • Payback period
    • One-off cost
  • Marketing Budget

    Customers acquired = budget ÷ CAC, with CAC rising 15% for every doubling of spend to reflect diminishing returns. Revenue builds from a 12-month cohort with your churn rate applied.

    Computes
    • New customers a month
    • Leads needed
    • Effective CAC
    • 12-month ROI
  • Growth Planning

    Works out the monthly growth rate needed to reach a revenue target in 12 months, and the new customers needed after replacing churn.

    Computes
    • Required monthly growth
    • New customers needed
    • Implied CAC
  • Cost Reduction

    Lowers monthly costs to a target or by a percentage, phased in over three months, with revenue held constant.

    Computes
    • Monthly profit
    • Operating margin
    • Annual savings
    • Cash runway
  • Product Launch

    Ramps customers linearly to your expected number over the launch timeline, with one-off launch marketing and a monthly operating cost.

    Computes
    • Steady-state revenue
    • Break-even month
    • 12-month ROI

Every result has the same shape. It holds a headline, a verdict (favourable, mixed or unfavourable), impact figures, baseline-versus-scenario metrics, a monthly timeline, the drivers behind the outcome and any warnings. Each assumption is labeled by its source: you, your Business Data or the model. All results are illustrative and depend on the assumptions entered.

AI layer

Claude explains; it never calculates

Uynzo uses Anthropic’s Claude models through the official Claude API SDK, from server code only, for two features: the written analysis of a scenario and the scenario assistant.

  • Narrative only. Claude receives the calculated result marked as authoritative and is instructed never to invent, re-derive or correct a number.
  • Structured output, validated twice. The analysis is requested against a zod schema and checked again on our server before it is saved.
  • Fallback analysis. If the call fails, or the response is refused, unreadable or invalid, a summary built from the result’s drivers, warnings and metrics is shown instead.
  • Streaming scenario chat. A route handler streams assistant replies as they are written and saves both turns when the reply is complete. Quick what-ifs are labeled as rough estimates.
  • Rate limits. A per-user limit each minute and a monthly allowance per workspace by plan: 20, 200 or 1,000 AI requests on Free, Growth and Business.
  • Usage logging. Every request is logged with model, token counts, duration and status, which powers plan limits and our admin AI usage view.
  • Platform switches. AI analysis and the assistant each have a platform-wide feature flag. With AI off, scenarios still calculate in full.
The analysis schemaWhat Claude is allowed to return
summarystring
key_driversstring[]
trade_offsstring[]
risks{ title, detail, severity }[]
observationsstring[]
suggested_questionsstring[]

No field in the schema carries a figure for the engine to use. Numbers shown in the product always come from the scenario engine.

Data and AI

What data goes to the AI model

AI requests happen only in connection with a scenario: when you open a newly calculated result (or refresh its analysis), and when you message the assistant. Each request covers a single scenario.

Sent for an AI analysis

  • The scenario type and title
  • The business context text you wrote for the scenario
  • Your scenario inputs
  • The calculated result: headline, verdict, impact figures, metrics, drivers, assumptions and warnings

Also sent to the assistant

  • The same scenario details and result
  • The scenario’s existing AI analysis
  • Your new message, up to 2,000 characters
  • Up to 30 earlier messages from that scenario’s conversation

Never sent

  • Your name, email address or password
  • Your team list or workspace members
  • Your full Business Data table
  • Other scenarios or other workspaces’ data

Requests go to Anthropic through the Claude API. Under Anthropic’s commercial terms, API inputs and outputs are not used to train its models. Assumptions in a result can mention figures taken from your Business Data. There is currently no per-workspace switch for AI; our Privacy Policy explains your options.

Data model

Multi-tenant Postgres with row-level security

All application data lives in Supabase’s managed PostgreSQL. Row-level security is enabled on every table. Its policies call security-definer helpers that check whether the signed-in user is a workspace member, a workspace admin or a platform admin.

People and workspaces

Every user belongs to one or more workspaces, with an owner, admin or member role in each.

  • profiles
  • organizations
  • organization_members

Business Data

The business profile and metrics the engine uses as context for every scenario.

  • business_profiles
  • business_metrics

Scenarios

Inputs are versioned; results are written only by the server and carry the engine version.

  • scenarios
  • scenario_inputs
  • scenario_results
  • scenario_messages
  • scenario_comparisons
  • scenario_templates

Operations

Usage, billing records, support and the logs behind our admin area.

  • ai_requests
  • subscriptions
  • payments
  • plan_requests
  • notifications
  • support_requests
  • audit_logs
  • activity_logs
  • email_logs

A database trigger stops members from changing their own role or status, and the server writes scenario results with a service-role key that is never sent to the browser. Integration tests run the policies against a real Supabase project with two throwaway users to check that one workspace cannot see another’s data.

Stack

A small, well-understood stack

Uynzo uses a few established tools, so the system is easy to reason about and to audit.

  • Next.js App RouterServer components for pages, server actions for every mutation, a route handler for streaming chat, and Cache Components.
  • React 19 and TypeScriptOne typed codebase for the website, the dashboard, the admin area and the scenario engine.
  • SupabaseManaged PostgreSQL with row-level security, plus authentication. SQL migrations are kept in the repository.
  • Anthropic Claude APIStructured narrative analysis and a streaming scenario assistant, with prompt caching for the fixed instructions.
  • ResendTransactional email from the server, with every send recorded in an email log.
  • zodSchemas for every form, API request and scenario model, and for the AI analysis itself.

Automated tests

Tests run on Node’s built-in test runner and cover:

  • All six scenario calculators
  • AI fallback analysis
  • AI rate limiting
  • Workspace role checks and safe redirects
  • Business Data validation
  • Row-level security policies, against a real Supabase project

The product

What this looks like in the app

Screens from the live product, shown with a sample workspace. Figures are illustrative.

Roadmap

What we plan to build next

These are plans, not shipped features. None of them is available today, and their order may change with customer feedback.

  • Planned
    A per-workspace setting to switch off AI analysis and the scenario assistant.
  • Planned
    Multi-factor authentication for user accounts.
  • Planned
    Moving the per-minute AI limit from each server’s memory to a shared store, so it holds across server instances.
  • Planned
    Online payment through a payment provider, alongside emailed invoices.
  • Planned
    More scenario models beyond the current six.

Get started

See the engine for yourself

Add your Business Data and run your first scenario on the Free plan.

  • Pricing
  • Hiring
  • Marketing
  • Growth
  • Costs
  • Launch