Semitra
Rails-inspired application architecture for Cloudflare Workers with TypeScript-first contracts, JSON-first APIs, React Router 7 + Vite + Tailwind frontend defaults, and built-in subsystems for records, jobs, storage, mail, realtime, cache, and tenancy.
Semitra is not a Rails clone.
It is Rails architecture + TypeScript contracts + Cloudflare-native execution, with opinionated backend and frontend choices made for you.
What Semitra gives you
Section titled “What Semitra gives you”- A conventional app layout with controllers, records, resources, policies, jobs, mailers, mailboxes, and channels.
- Runtime-validated contracts shared across request params, models, jobs, mail, and realtime messages.
- Direct mapping to Cloudflare primitives instead of an abstraction that hides the platform.
- React Router 7 framework mode, Vite, Tailwind CSS, and typed frontend models in generated starter apps.
- A request lifecycle that stays explicit from route match to serialized response.
Good fits
Section titled “Good fits”Semitra is a strong fit for:
- multi-tenant SaaS applications
- internal operations dashboards
- customer portals with uploads and notifications
- workflow apps with jobs, mail, and event fan-out
- realtime notification or collaboration features
- JSON APIs paired with a generated React Router frontend
Request flow
Section titled “Request flow”Every Semitra request follows the same path:
Request -> Router -> Controller -> Policy -> Model -> Events -> Resource -> ResponseThat order is not branding. It is the framework boundary model:
- the router finds the action
- the controller coordinates request work
- the policy authorizes and scopes
- the model reads and writes state
- events and jobs handle side effects
- resources define response shape
Cloudflare mapping
Section titled “Cloudflare mapping”- D1 -> database
- R2 -> storage
- Queues -> jobs
- Durable Objects -> realtime
- KV -> cache
Start here
Section titled “Start here”- If you want to know what to build with Semitra, read Use Cases.
- If you want to connect the Worker API to the generated frontend, read Full-Stack Apps.
- If you want to run the code in this repository, read Getting Started.
- If you want the framework shape first, read Request Lifecycle.
- If you want subsystem detail, start with Jobs, Events, Mail, Realtime, Cache, Storage, and Tenancy.
- If you want the package and runtime boundary model, read Adapters and Runtime.
- If you are building an agent or retrieval source for Semitra, read AI Agent Reference.