Practical Recipes
Recipes combine several framework features around one outcome. Each states the strongest evidence it can produce; none turns a local dry run into a live AWS claim.
Featured production path
Design a burst-ready Orders service from traffic pattern to recovery.
Use a concrete web, mobile, or partner API to evaluate idempotency, concurrency, persistence, Lambda wake behavior, optional queue work, residual cost, guarded delivery, and exact rollback evidence.
Follow the production blueprint- ContractRetry-safe create, bounded list, and conditional mutation
- RuntimeLocal service, Lambda HTTP, and optional SQS worker
- DataChoose PostgreSQL or DynamoDB from the access pattern
- EvidencePlan, package, verify, promote, observe, or compatible rollback
Standard JSON CRUD API
Use OpenAPI resource metadata, idempotent create, bounded cursor pagination, strong ETags, conditional update/delete, Problem Details, fake-port application tests, and real adapter tests.
Start with Orders API end to end, then use the production blueprint to make the persistence, runtime, cost, and recovery choices explicit.
Authenticated Web Application
- Enable
identityandsessions. - Choose the verified ingress claims and session store at composition.
- Authorize inside each application use case.
- Add exact CORS, cookie, and header policy.
- Test missing, insufficient, expired, revoked, and valid principals.
Guide: Identity and sessions.
File Upload with Metadata
- Add an application use case owning media, size, tenant, and retention policy.
- Inject the
object-storageport and a metadata persistence port. - Store the object and metadata with explicit recovery for partial failure.
- Serve through a reviewed proxy or signed-access adapter.
- Test malicious names/types, size limits, authorization, and deletion.
Guide: Files and static sites.
Transactional Notification
- Write domain state and an outbox event in one database transaction.
- Add an explicit worker and queue mapping.
- Map the event to a typed notification intent.
- Inject the selected email, webhook, or in-app adapter.
- Bound retries, DLQ, concurrency, and database connections in Plan IR.
Guides: Events and notifications and Queues and workers.
Client Review Environment
- Enable Feedback and its concrete data, storage, and notification adapters.
- Package an exact release and optional static frontend.
- Create an application-owned review manifest with owner and expiry.
- Collect untrusted, bounded feedback and clarify it in the thread.
- Export only explicitly development-ready context.
- Plan cleanup against the exact review identity; expiry alone does not apply deletion.
Guide: Client feedback loop.
Local to AWS
dev dry run -> local test -> inspect -> package -> release verify
-> change-set review -> target migration -> deploy apply
-> hosted verify -> promote exact artifact -> observeUse Plan an AWS deployment. Account, Region, environment, change set, migration, and destructive actions fail closed.
Static Frontend plus API
Build frontend and API once, bind their digests into one release, review private S3, CloudFront, and domain intent, publish the exact assets, then verify API and representative frontend bytes together.
Guide: Files and static sites.
Choose the Smallest Stack
| Need | Suggested components | Review before adding |
|---|---|---|
| Local CRUD prototype | defaults + sqlx-sqlite + test | Single-process durability and local lifecycle |
| Lambda JSON API | defaults + selected data adapter + aws-lambda + plan + release | Wake sources, concurrency, IAM, data profile, and residual cost |
| Signed-in app | previous + plugin-identity + plugin-sessions | Verified ingress, cookie/token policy, expiry, revocation, and retention |
| Uploads | previous + plugin-object-storage + selected storage adapter | Media policy, tenant keys, size, encryption, scanning, and deletion |
| Async delivery | plugin-events + plugin-notifications + aws-worker | Transactional intent, retries, DLQ, batch behavior, and connections |
| Review loop | plugin-feedback plus its concrete adapters | Untrusted input, retention, notification, transcription, and cleanup |
| Frontend hosting | plugin-static-site + AWS deployment inputs | Exact assets, private origin, cache policy, SPA fallback, and domain |
See Cargo feature flags and the built-in component catalog.