Skip to content

Build Workers. Not Scaffolding.

A type-safe, modular framework for Cloudflare Workers with automatic OpenAPI docs, dependency injection, and first-class support for every Workers primitive.

src/index.ts
import { Stratal } from 'stratal';
import { AppModule } from './app.module';

export default new Stratal({
  module: AppModule,
});
AI Skills
$ npx skills add strataljs/stratal

Teach your AI agent Stratal's conventions, patterns, and APIs. It generates framework-correct code — decorators, import paths, module structure, and more.

MCP Server
$ npx quarry mcp:serve

Expose your API routes as MCP tools. AI agents discover and call your endpoints directly — no extra configuration needed.

AI-First

Built for AI agents

Stratal is designed to work with AI coding agents from the ground up. Install the Stratal skill and your AI agent understands the framework's conventions — it can scaffold projects, generate modules, controllers, and services, and wire dependency injection correctly.

Then expose your API as MCP tools so AI agents can discover and call your endpoints directly.

From boilerplate to business logic

If you've used NestJS or Laravel, you'll feel right at home.

worker.tsBefore
export default {
  async fetch(request, env) {
    // Set up router, parse body, validate...
  },
  async queue(batch, env) {
    if (batch.queue.startsWith('order-queue')) {
      await orderConsumer.queue(batch, env);
    }
    if (batch.queue.startsWith('webhook-queue')) {
      await webhookConsumer.queue(batch, env);
    }
    if (batch.queue.startsWith('notification-queue')) {
      await notificationConsumer.queue(batch, env);
    }
  },
  async scheduled(controller, env) {
    switch (controller.cron) {
      case '0 2 * * *': jobType = 'expiration'; break;
      case '0 5 * * *': jobType = 'renewal'; break;
      case '0 6 * * *': jobType = 'warnings'; break;
      default: console.warn(`Unknown cron`);
    }
  },
}
app.module.tsAfter
@Module({
  imports: [
    I18nModule.forRoot({ defaultLocale: 'en', locales: ['en', 'fr'] }),
    NotesModule,
  ],
  consumers: [NotificationConsumer],
  jobs: [CleanupJob],
})
export class AppModule {}
index.tsEntry
export default new Stratal({
  module: AppModule,
})

Everything you need to build at the edge

Familiar patterns from NestJS and Laravel, purpose-built for Cloudflare Workers. Stratal handles the scaffolding so you can focus on what your application actually does.

📖

Auto-generated OpenAPI Docs

Generate OpenAPI specs directly from your route definitions and Zod schemas. Always accurate, zero maintenance.

🛤️

Flexible Routing

Convention-based mapping from method names to HTTP verbs, or explicit @Get/@Post decorators for full control. Pick the style that fits.

💉

Dependency Injection

Built-in DI container resolves services automatically. Declare dependencies in constructors, skip the manual wiring.

🧱

Modular Architecture

Organize code into cohesive modules with clear boundaries. Import, share, and reuse across Workers effortlessly.

Workers Primitives

First-class support for Queues, Cron Triggers, KV, R2, D1, Durable Objects, Service Bindings, and Workflows.

🧪

Built for Testing

Compile module subsets, swap dependencies, and test HTTP endpoints with a fluent API. Testing should be the easy part.

Up and running in minutes

Let AI build your app

$ npx skills add strataljs/stratal

Scaffold a complete Stratal app with AI — routes, modules, and tests generated from your description.

Learn more
Or, set up manually
1

Scaffold your project

$ npm create stratal@latest my-app
2

Start the dev server

$ cd my-app && npm run dev
3

Make your first request

$ curl http://localhost:8787/api/hello
{"message": "Hello from Stratal!"}

Why Stratal?

🌐

Workers-Native

Purpose-built for Cloudflare's runtime, not ported from Node. Every API, binding, and primitive is a first-class citizen.

⚙️

Convention over Configuration

Method names, decorators, and module definitions eliminate boilerplate. Spend time on business logic, not plumbing.

🤖

AI-Ready Architecture

Structured patterns that AI coding agents can follow and extend. Conventions + OpenAPI specs = code that writes itself.

🔒

Type-Safe End to End

Zod schemas, typed bindings, and decorator metadata catch errors at compile time, not in production.

Ready to build?

Get started in under a minute.