Skip to content

Project structure

Every top-level file and folder in a Startup project, what it holds, and the tab of the business it builds.

A Startup project holds a file only where the Startup differs from its Startup Template. Its top-level folders follow the tabs of these docs, from nouns/ to code/.

The tree

  • leaseline/
  • startup.tsthe Startup: name, domain, Startup Template, own values
  • startups.lockStartup Template pins, by fingerprint
  • settings.mdxSettings not set in startup.ts
  • policies.mdxhow the numbers are computed
  • env.tsSecret and Integration names, no values
  • nouns/Business
  • Lease.mdxa Noun: properties, Verbs, states
  • Lease.renew.tsthe Function behind Lease.renew
  • Lease.renew.test.tsits cases
  • verbs/renew.mdxa Verb several Nouns share
  • evaluators/notice-tone.tsa rubric and its grader
  • mappings/rent-roll.tsa Source mapped into Nouns
  • products/pro.mdxProductsApp, API, Agent, Dataset or Service
  • offers/pro.mdxa Product at a Price, on terms
  • sites/www/a Site: Pages, layouts, navigation
  • apps/portal/an App over the Nouns
  • domains/leaseline.com.mdxa Domain: what it hosts, redirects, email
  • content/blog/posts and changelog entries
  • agents/customer/Agentsa Team
  • index.mdxthe Team: lead Role, mission
  • success-manager.mdxa Role and the agent or person filling it
  • success-manager.test.tsits eval cases
  • skills/renewal-call/a skill the Role loads
  • workflows/renewals/Workflowsa Process
  • index.mdxowner Role, Metric, target
  • notice-at-60-days.mdxa Workflow: prose, code and tests
  • weekly-unanswered.tsa Workflow: code only
  • plays/manager-referrals.mdxa Play: Process, Metric, budget
  • systems/billing.mdxSystemsan override on one System
  • dashboards/renewals.mdxa Dashboard for one scope
  • brand/CodeBrand, Theme, Templates
  • components/RenewalCountdown.*a Component: props, web rendering, CSS
  • tests/first-renewal.test.tsscenario tests in test
  • code/partner-webhook/a custom program
  • generated/rendered by the platform; pushes refused
  • _research/unmanaged
  • AGENTS.md, .mcp.json, package.jsoncoding agent setup
  • .sb/manifest, resolved Startup, types

Top-level files

FileHoldsConvention
startup.tsThe Startup and its own values. Also startup.mdx or startup.jsonstartup.ts
startups.lockStartup Template pinsstartups.lock
settings.mdxSettingsSettings
policies.mdxPoliciesPolicies
env.tsSecret and Integration namesenv.ts
AGENTS.md, .mcp.json, package.jsonCoding agent setupagent files

Top-level folders

PathHoldsConvention
nouns/Nouns, their Verb functions and testsNouns
verbs/Shared VerbsShared Verbs
evaluators/EvaluatorsEvaluators
mappings/MappingsMappings
products/ProductsProducts
offers/OffersOffers
sites/SitesSites
apps/AppsApps
domains/DomainsDomains
content/ContentContent
agents/Teams and RolesTeams, Roles
workflows/Processes and their WorkflowsProcesses, Workflows
plays/PlaysPlays
systems/Overrides on SystemsSystems
dashboards/DashboardsDashboards
brand/Brand, Theme, TemplatesBrand
components/ComponentsComponents
tests/Scenario testsScenario tests
code/Custom ImplementationsCustom code
generated/Files the platform rendersGenerated files
_name/Anything unmanagedPrivate folders
.sb/Manifest, resolved Startup, typesThe .sb folder

Rules every file follows

  1. The path is the identity. nouns/Lease.mdx is Lease, and offers/pro.mdx is offers/pro. No file states its own id.
  2. A file exists only where the Startup differs. Everything else is inherited and shows in .sb/resolved/.
  3. Definitions are MDX, behavior is TypeScript. Frontmatter is the record and the body is its docs. JSON is for machine-written files only.
  4. Root TypeScript is data. startup.ts and env.ts are parsed, never run. A loop or a computed value belongs in code/.
  5. Behavior binds by name. Lease.renew.ts runs Lease.renew, and a Workflow's Trigger is read from its code.
  6. The fingerprint covers meaning. Reformatting a file or editing a comment mints no Version.
  7. One leader per project. A project is git-first, with each commit imported as a Change, or db-first, with files regenerated from the record.
  8. No secrets and no records in files. Customers, Orders, Invoices, Messages and Events live in db.sb, never in the repository.
  9. A rename rewrites every reference. No alias is kept for an old path.

Several Startups in one repository

One repository can hold several Startups. Each Startup folder is byte-identical to the Startup in a repository of its own, and the root files set what every Startup below inherits.

  • northfield/
  • studio.tsSettings, Policies and Brand every Startup below inherits
  • brand/
  • templates/clinic-scheduling/a Startup Template the Startups below extend
  • startups/leaseline/the tree above
  • packages/shared code, as a workspace
PathHoldsKind
startup.tsStartupfile
startups.lockVersionfile
settings.mdxSettingfile
policies.mdxPolicyfile
nouns/[Noun].mdxNounfile
nouns/[Noun].[verb].tsFunctionfile
nouns/[Noun].[verb].test.tsFunctionfile
verbs/[verb].mdxVerbfile
workflows/[process]/[workflow].tsTriggerfile
evaluators/[name].tsEvaluatorfile
mappings/[source].tsSourcefile
products/[product].mdxProductfile
offers/[offer].mdxOfferfile
workflows/[process]/index.mdxProcessfile
plays/[play].mdxPlayfile
agents/[team]/[role].mdxRolefile
systems/[system].mdxSystemfile
dashboards/[dashboard].mdxDashboardfile
sites/[site]/Sitefolder
sites/[site]/**/page.mdxPagefile
sites/[site]/**/layout.mdxPagefile
sites/[site]/**/[key]/Collectionfolder
sites/[site]/**/not-found.mdxPagefile
apps/[app]/Appfolder
apps/[app]/**/view.mdxDashboardfile
code/[program]/Implementationfolder
generated/Filefolder
_[name]/Filefolder
.sb/resolved/Startupfolder
.sb/types/Nounfolder
studio.tsStudiofile
brand/Brandfolder
templates/[template]/Startup Templatefolder
components/[Name].mdxComponentfile
brand/templates/[template].mdxTemplatefile
brand/theme.mdxThemefile
startups/[startup]/Startupfolder
packages/Implementationfolder
env.tsSettingfile
.sb/repo.jsoncStartupfile
domains/[host].mdxDomainfile
content/[collection]/[slug].mdxContentfile
agents/[team]/index.mdxTeamfile
workflows/[process]/[workflow].mdxWorkflowfile
agents/[team]/[role].test.tsRolefile
tests/[scenario].test.tsStartupfile
components/[Name].tsxComponentfile
experiments/[experiment].mdxExperimentfile
prompts/[prompt].mdTemplatefile