Carrier
Appendices · Carrier Reference Toolkit
Appendix G1 min read

Example Carrier Service Walkthrough

This walkthrough stays structural rather than inventing exact Carrier syntax. The goal is to show the shape of building a focused service from scratch.

Start with a focused service boundary: patient intake. The service owns intake submissions, consent capture, and pre-visit questionnaire workflow. It does not own clinical encounter documentation or billing.

Create the source layout:

src/

main.carrier

00_models/

intake_submission.carrier

10_types/

intake_contracts.carrier

20_actions/

submit_intake.carrier

30_routes/

intake_routes.carrier

Define the service in src/main.carrier, then import the files that belong in the build graph. Add models for durable intake data: submission record, status, patient reference, timestamps, and audit-relevant identifiers. Add named types for API contracts: submit intake request, submit intake response, intake status response. Use healthcare.questionnaire if the intake flow captures structured clinical or administrative data.

Implement the main business operation as an action: validate the request, apply policy, write the submission in a transaction, and return a typed response. Expose thin routes: one to submit intake, one to read submission status, and only add CRUD if the resource truly has simple semantics. Add policy for tenant visibility and role-based access.

Verify the service:

excerpt
carrier fmt
carrier check
carrier build --target node
Generate governance artifacts when needed:
carrier openapi > openapi.json
carrier migrate generate

Finally, review .carrier/manifest.json to confirm that routes, models, and policies match the intended architecture.

End of book.

Carrier Language by Nikolai Manek — built to serve hospitals, schools, and the institutions of public life.

Copyright © 2026 Nikolai Manek. All rights reserved.

Contents