Examples
Examples that show how real Shaperail applications are structured. Repository examples link directly to the checked-in code under examples/, and in-guide walkthroughs cover patterns that are documented rather than checked into the repo.
Available examples
| Example | Description |
|---|---|
| Blog API | Two resources (posts, comments) with controllers: slug generation, edit rules, comment rate limiting, XSS prevention. Public reads, protected writes, owner-based updates, relations, cursor/offset pagination, soft delete. The checked-in project lives in examples/blog-api. |
| Enterprise SaaS | Billing and subscription management example with invoice workflow enforcement, payment validation, audit logs, plan-based credit limits, and tenant-scoped business rules. |
| Incident platform | Single app showing API-key alert ingest, file uploads, jobs/workers, event subscribers, inbound and outbound webhooks, WebSocket rooms, GraphQL/gRPC wiring, and manual runtime bootstrap in src/main.rs. |
| Multi-service workspace | Two services (users-api, orders-api) showing workspace layout, dependency-ordered startup, and validated saga definitions for order creation. |
| Multi-tenant SaaS | Three resources (organizations, projects, tasks) with controllers: plan-based project limits, status transition enforcement, cross-resource validation, tenant-scoped uniqueness. Shows tenant_key, JWT tenant claims, super_admin bypass. |
| WASM plugins | Controller hooks written in TypeScript and Python compiled to WASM. Includes email validation and input normalization examples with the full plugin interface documented. |
| Controller walkthrough | Documentation walkthrough in the Controllers guide. Complements the repository examples with a complete multi-resource billing walkthrough focused on controller patterns and testing guidance. |
The repository currently includes these example directories under examples/: blog-api, enterprise-saas, incident-platform, multi-service, multi-tenant, and wasm-plugins.
If you wire controllers into a running app today, manual controller registration is still required.