Skip to content

Getting started

Create a Startup as code, add a Noun and an Offer, take a test payment, watch its Events, ship the Change and attach your domain.

npm create startups creates a Startup and the project that defines it as code. In about fifteen minutes it takes a test payment on its own preview, and the same files run it live.

What you build

Leaseline tracks lease renewals for small property managers and sells one plan at $29 a month. By the end it has a Lease Noun with its own API and an Offer with a working checkout. It also has a paid test Subscription and a live address on leaseline.app.

You need npm and a terminal. Everything below runs in the test environment, so no real money moves.

Steps

Terminal12 steps
  1. Create the project from the Solo SaaS Startup Template:

    npm create startups leaseline.app -- --template solo-saas --yes
    Created Leaseline in testStartup      startup_1Template     Solo SaaSInterfaces   https://api.sb/leaseline.app · MCP · SDK · CLINext: cd leaseline

    The Startup runs from the first second, with a Site, an App, an API and an agent in every Role the Startup Template staffs. The project holds only what differs from it:

    leaseline/├── startup.ts       the Startup: name, domain, the Startup Template it extends├── startups.lock    the Startup Template Version it pins├── AGENTS.md        how any coding agent works this Startup├── .mcp.json        the MCP servers, scoped to leaseline.app└── package.json
  2. Start the dev server. It watches the project and previews each edit as a Change:

    cd leaselinenpx startup-builder dev
    Watching leaseline in testPreview   https://preview-4f1c.leaseline.appChange    change_1 (no edits yet)
  3. Add a Noun. Leaseline declares a Lease Noun in one file:

    nouns/Lease.mdx
    ---
    properties:
      unit: string
      resident?: Contact
      endsOn: date
      rent?: money
    verbs:
      renew: { months: integer, increase?: number }
      notify: {}
    ---
    A Lease is one resident's agreement on one unit.

    The dev server compiles it at once and writes its types to .sb/types/. $.Lease is typed, /app/leases lists records, and Lease.renew is a route, a CLI operation and an MCP tool.

  4. Write a first record from code:

    TypeScript
    import { $ } from 'startup-builder'
    
    const lease = await $.Lease.create({ unit: '4B', endsOn: '2027-01-31', rent: { amount: 1800, currency: 'USD' } })
  5. Add the Offer. Its Price compiles to a Stripe price and a checkout on the preview:

    offers/pro.mdx
    ---
    price: { amount: 29, currency: USD }
    interval: month
    ---
  6. In a second terminal, stream the Startup's new subscriptions:

    npx startup-builder listen Offer.subscribed
  7. Open /pricing on the preview, choose the plan and pay with the test card 4242 4242 4242 4242. The listener prints Offer.subscribed with the new Subscription, and the founder's App shows the first $29.

  8. Run the checks on the Change the dev server printed. Every test and Evaluator runs on the preview:

    Text
    Review my change.
  9. Merge it into a new Version:

    npx startup-builder do Change.merge --json '{"change":"change_1"}'
    Merged change_1Version   version_2
  10. Deploy the Version that merge printed. It asks the founder first, then points the live address at the new build:

    npx startup-builder do Version.deploy --json '{"version":"version_2"}'
  11. Attach the Domain to the Startup that step 1 printed. Connect prints the DNS records to set at your registrar and verifies them:

    npx startup-builder do Domain.connect --json '{"hostname":"leaseline.app","startup":"startup_1"}'
  12. Read what you built, own and inherited values side by side:

    npx startup-builder show /

Result

Leaseline runs from seven files. The Lease Noun has an API, SDK methods, CLI operations and MCP tools.

The Offer sells through a Stripe checkout, and its first test Subscription raised Offer.subscribed. The merged Version serves leaseline.app, and every later edit ships the same way.

Live charges start once the owners finish Stripe's onboarding (Stripe).

Next steps