Growth OS
Get Started

Architecture

Build specs in the browser, validate with Zod, generate deterministic output, and share via URL-encoded state.

No Backend
URL Share
Deterministic
Zod Validation

Overview

Growth OS is a deterministic specification generator for product-led growth teams. Users input product metadata (type, primary object, value action) and configuration choices (activation rules, tracking events), and the system outputs a complete growth specification including KPI trees, activation definitions, tracking plans, and experiment templates.

Framework
Next.js 16 + React 19
Language
TypeScript
Validation
Zod Schemas
Styling
Tailwind CSS v4

System Flow

The architecture follows a linear flow from input to shareable output, with validation at each boundary.

Builder
User inputs
Zod Validate
Schema check
Generator
Pure function
Preview
Live output
Encode
lz-string
Share SSR
OG + render

Data Model

The core data structure captures everything needed to generate a complete growth specification.

productType

B2B SaaS vs Devtool. Determines metric naming conventions and default guardrails.

primaryObject

The core entity users create. Used to generate North Star metric naming.

valueAction

The action that delivers value. Forms the basis of activation event naming.

ttvMinutes

Time-to-value in minutes. Informs onboarding experiment design.

activationRules

Array of predefined rule types converted to human-readable rules during generation.

coreEvents

Enum-based event selection ensuring consistent event taxonomy across specs.

Generator Design

The generator (generateGrowthSpec) is a pure function: identical inputs always produce identical outputs.

Cacheability
Same URL always renders the same spec. CDN-friendly.
Testability
No mocking required. Snapshot tests work reliably.
Debugging
Share a URL and reproduce exact output. No "works on my machine".

The only non-deterministic element is the timestamp in the footer, which uses the generation date for versioning shared specs.

SSR Strategy

Different pages use different rendering strategies based on their needs.

/builder (Client-Heavy)
  • Hero/layout server-rendered for fast first paint
  • Wizard form as client component with Suspense
  • localStorage for draft persistence
/s?d=... (Server-Heavy)
  • Full SSR: decode → validate → generate on server
  • Dynamic OG metadata from decoded spec
  • robots: noindex for share URLs

Exports

Three export formats, each with honest tradeoffs.

Markdown (.md)
  • • Full spec as structured markdown
  • • Tables for tracking plans
  • • Copy or download
Tables may render differently across tools
JSON
  • • Raw BuilderWizardState
  • • Machine-readable
  • • Same as URL payload
Input data only, not generated output
Print to PDF
  • • Native window.print()
  • • @media print styling
  • • Save as PDF in dialog
Quality depends on browser

Validation Strategy

Runtime validation using Zod ensures type safety at system boundaries.

export const GrowthSpecInputSchema = z.object({
  productType: ProductTypeSchema.or(z.literal('')),
  primaryObject: z.string().min(1).max(50),
  valueAction: z.string().min(1).max(50),
  ttvMinutes: z.string().regex(/^\d+$/),
  activationRules: z.array(ActivationRuleSchema).min(1),
  coreEvents: z.array(CoreEventSchema).min(1),
})

Testing

Tests run via Vitest (pnpm test).

Unit Tests
  • pluralize() - singular/plural/custom
  • Encoding/decoding round-trips
  • Schema validation edge cases
Route Tests
  • All static routes return 200
  • /s with invalid param shows error
  • /s with valid param renders spec

The deterministic generator design means integration tests are effectively unit tests—no external dependencies to mock.

Future Roadmap

01
Export formats
PDF export, Notion/Confluence integration via API
02
Template library
Pre-built specs for PLG SaaS, marketplaces, devtools
03
Diff view
Compare two specs side-by-side for A/B testing variations
04
Analytics integration
Generate Amplitude/Mixpanel tracking plan code directly
05
Team collaboration
Optional authenticated mode with revision history

Engineering Notes

Key technical decisions that make this codebase recruiter-ready.

Deterministic output
No backend required
SSR share pages
Route tests
Encode/decode tests
Zod schema validation