Browse pages
Get Started
This tutorial starts a consumer repository at small size.
Purpose#
This tutorial starts a consumer repository at small size. At the end the repository holds its configuration, its first records, one implemented use case, and a passing model check. Where a step differs by stack, run the row that matches the stacks in litespec.project.json.
This guide carries no provision. Each step cites the provisions it satisfies.
Prerequisites#
- Read the agent protocol, the authoring standard, and the supported scope.
- Read the extension catalog to learn which capabilities stay inactive at the start.
- Install the .NET SDK and Node.js releases that
litespec.manifest.jsonpins. - Decide which stacks the product ships:
dotnetplus one platform per frontend.
Lesson#
-
Pin the LiteSpec release. Add the LiteSpec repository as a submodule or another pinned dependency. This satisfies
litespec/workspace/structure#use-the-canonical-root-tree. -
Write the project configuration. Run
litespec init --preset dotnet-react --size small, which writeslitespec.project.jsonwith the shape, the stacks and the pinned release inreviewedLiteSpecVersion. Copyproject-agents.mdfrom the template index to the root asAGENTS.md. Fill every placeholder and name every owner. This satisfieslitespec/core/scope#select-a-size-a-shape-and-stacks. -
Select extensions only when their criteria already hold. Write each selection in the object form with its criterion and review date. This satisfies
litespec/core/scope#select-conditional-extensions-explicitlyandlitespec/core/scope#record-selected-extensions. -
Create the toolchain configuration from the manifest pins. Add the SDK floor, the shared build settings, the central NuGet versions, the tool manifest, and the JavaScript toolchain pin. This satisfies
litespec/backend/dotnet/config#set-the-sdk-floor-at-the-workspace-root,litespec/backend/dotnet/config#centralize-net-build-settings,litespec/backend/dotnet/config#centralize-nuget-versions,litespec/backend/dotnet/config#commit-the-tool-manifest, andlitespec/workspace/config#pin-the-javascript-toolchain. -
Add only the packages the manifest already pins. Record each new package approval explicitly. This satisfies
litespec/backend/dotnet/packages#pin-every-dependency-centrallyandlitespec/workspace/dependencies#approve-new-packages-explicitly. -
Create the API solution. Add the five application projects, the AppHost, the ServiceDefaults, and the Architecture and Integration test projects. Add the Acceptance project when the product needs executable specifications. This satisfies
litespec/backend/dotnet/architecture#use-five-application-projectsandlitespec/backend/dotnet/testing#keep-the-test-projects-the-size-requires. -
Apply the file, type, and folder names. Match each C# file to its primary type and each namespace to its folder. This satisfies
litespec/backend/dotnet/naming#match-c-files-and-primary-typesandlitespec/workspace/naming#keep-namespaces-aligned-with-folders. -
Write the product brief. Copy
product-brief.mdfrom the template index todocs/product/brief.md. State the boundary, the refusals, and the audience. This satisfieslitespec/core/product#keep-business-intent-under-product. -
Write one topic page with its requirements. Copy
product-topic.mdfrom the template index. State each commitment as one requirement with its kind. This satisfieslitespec/core/product#state-each-topic-in-one-page-shapeandlitespec/core/product#identify-every-requirement. -
State which constraints apply. Write one constraint record per outside rule, or record that none applies, and set
constraints.answeredtotrue. Thelitespec.project.jsontemplate defines the fields. -
Record the first decision. Copy
decision.mdfrom the template index. Name the options, the decider, and what would change the choice. This satisfieslitespec/core/product#record-each-product-choice-as-a-decisionandlitespec/core/product#trace-every-choice-to-a-decision. -
Write the people records. Add one actor page per party, one role page per grantable set, and the permission entries on the permissions page. Each use case later names the permissions it needs. The
actor.md,role.md, andpermission-list.mdtemplates define the fields. -
Write the module and its business records. Follow Model a domain module for the module, the rules, the use cases, the events, and the permissions. This satisfies
litespec/core/system#group-language-and-use-cases-by-module. -
Implement one use case. Move the transition into a business method, keep the handler narrow, commit once, expose one endpoint, and authorize the target. This satisfies
litespec/backend/domain#express-transitions-through-business-methods,litespec/backend/application#keep-command-handlers-narrow,litespec/backend/dotnet/persistence#commit-once-in-the-command-pipeline,litespec/backend/dotnet/api#use-one-endpoint-per-operation, andlitespec/quality/security#authorize-each-target-resource. -
Declare each frontend. Run the row that matches the platform in
litespec.project.json.Platform Structure step UI step reactDeclare the application tree and mirror the backend use case path ( litespec/frontend/web/structure#use-the-frontend-application-tree)Compose each route from one floorplan ( litespec/frontend/web/ui#compose-each-route-from-one-floorplan)svelteDeclare the application tree and mirror the backend use case path ( litespec/frontend/web/structure#use-the-frontend-application-tree)Compose each route from one floorplan ( litespec/frontend/web/ui#compose-each-route-from-one-floorplan)blazorDeclare the client solution tree and organize features by module and use case ( litespec/frontend/blazor/structure#use-the-client-solution-tree)No UI contract step; Blazor stays outside the controlled UI contract -
Deliver one complete slice. Ship source, tests, contracts, and operating evidence for one use case. This satisfies
litespec/core/system#deliver-one-complete-use-case. -
Add the operating records. Write the limits and runbooks, add deployment, backup, restore, and rollback, and configure the pipeline gates. This satisfies
litespec/quality/operations#start-the-stack-with-one-local-commandandlitespec/quality/ci#run-applicable-gates-on-every-pull-request. -
Build the model. Run
litespec model buildfrom the consumer root. It writesmodel.jsonwith the computed links between records, code, screens, and tests. -
Check the model. Run
litespec model check. It exits 1 on any unresolved citation, missing link, or unproved case. Fix every finding before continuing. -
Render the generated regions. Run
litespec model render. Commit what it wrote. -
Run the remaining validators. Run
litespec consumerandlitespec uifrom the consumer root. Both exit0on a clean tree. This satisfieslitespec/core/release#run-consistency-checks.
What you built#
- A consumer repository at small size that the model check accepts.
- One implemented use case with records, code, tests, and generated contracts.
- The command pages for the checks are Validate Consumer and Validate Controlled UI. See the command index.