Quickstart
Install the compiler. Write .carrier. Ship a service.
The compiler is a Cargo workspace. Every command below is present in the carrierc CLI today.
Step 1
Clone and build the compiler
# clone the repo$ git clone https://github.com/walknorth/carrier.git$ cd carrier$ # build & test the compiler workspace$ cargo test$ cargo run -p carrierc -- --helpRequirements
Rust toolchain (edition 2024). Postgres 14+ for services that use models, CRUD, policy RLS, jobs, schedules, events, or idempotency.
Optional
Redis — used by
cache.* and redis.* when REDIS_URL is configured. Without it the cache falls back to in-memory.Step 2
Scaffold a project, check, and build
Project layout
my-service/
carrier.toml
src/
main.carrier
carrier.toml
src/
main.carrier
carrier.toml
[package]
name = "my-service"
version = "0.1.0"
name = "my-service"
version = "0.1.0"
$ carrier new my-service$ cd my-service$ # validate types, CRUD, auth, policies, and more$ carrier check$ # generate rust + cargo + native binary$ carrier build$ # run the service (or ./.carrier/build/<binary>)$ carrier runStep 3
Write your first service
Copy the hello-carrier example into src/main.carrier. It uses only Tier 1 constructs and demonstrates service, auth jwt, type, and route.
src/main.carrier
Tier 1service App { openapi { title: "Hello Carrier API" version: "0.1.0" } server { host: env("HOST", "0.0.0.0") port: env_int("PORT", 3000) }} auth jwt Auth { issuer: env("JWT_ISSUER", "carrier") audience: env("JWT_AUDIENCE", "carrier-users") secret: env("JWT_SECRET", "local-dev-secret")} type RegisterRequest { email: String @email name: String @length(min: 2, max: 100) password: String @length(min: 8)} type AuthTokens { access_token: String refresh_token: String } route POST "/auth/register" public -> AuthTokens { input: RegisterRequest handler { let user = auth.register( email: input.email, name: input.name, password: input.password ) return auth.issue_tokens(user.id) }} route GET "/me" protect Auth -> MeResponse { handler { return auth.current_user() }}Iteratezsh
$ carrier dev # watch + rebuild$ $ carrier openapi > openapi.json$ carrier fmt$ carrier migrate generate$ carrier migrate up$ carrier cleanStep 4
Where to read next
Every item links back to the real repo content. Pick the tier that matches the shape of your service.
Tier 1→
hello-carrier
Minimal single-file service. Start here to verify the toolchain.
Tier 2→
inventory-control
Production shape: multi-file, crud, actions, idempotency.
Tier 3→
booking-service
Tenant-aware workflow: @version, jobs, events, schedules.
Flagship→
doctor-directory
Cache, SQL, DB functions, clients, policy/RLS, audit.
CLI
All commands, one reference
Implemented today. Every one of these runs against every example in the repo.
carrier newscaffold a new projectcarrier checkvalidate types, CRUD, auth, policy, built-inscarrier buildgenerate rust + cargo-build native binarycarrier runrun the compiled binarycarrier devwatch & rebuild on changescarrier fmtformat .carrier sourcecarrier openapiemit OpenAPI JSONcarrier cleanremove .carrier/ artifactscarrier migrate generateproduce SQL migrations & schema snapshotscarrier migrate upapply generated migrations