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.
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 and the resource API guide.
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/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/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/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/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 |
|---|---|
| Local CRUD prototype | defaults + sqlx-sqlite + test |
| Lambda JSON API | defaults + sqlx-postgres + aws-lambda + plan + release |
| Signed-in app | previous + plugin-identity + plugin-sessions |
| Uploads | previous + plugin-object-storage + selected storage adapter |
| Async delivery | plugin-events + plugin-notifications + aws-worker |
| Review loop | plugin-feedback plus its concrete adapters |
| Frontend hosting | plugin-static-site + AWS deployment inputs |
See Cargo feature flags and the built-in component catalog.