Skip to content

Introduction

Layeron is a Cloudflare-native backend platform for building complete backend applications in TypeScript and running them in your own Cloudflare account.

You describe the backend your product needs: routes, databases, webhooks, queues, jobs, storage, logs, metrics, secrets, and module capabilities. Layeron turns that code into a Cloudflare resource graph, plans the changes, applies them through Cloudflare APIs, and records the deployment state.

Layeron is BYOC: Bring Your Own Cloudflare. Your application runtime, data, resources, secrets, and Cloudflare billing stay in your Cloudflare account while Layeron provides the SDK, compiler, orchestrator, CLI, dashboard, and deployment workflow.


Layeron lets you work at the level of backend capabilities while it handles the Cloudflare resource details.

Terminal window
import { backend, secret } from "@layeron/core"
import { db, storage, webhooks } from "@layeron/modules"
const app = backend({ project: "billing" })
const database = db({
name: "main",
})
app.use(webhooks.stripe({
path: "/webhooks/stripe",
secret: secret("STRIPE_WEBHOOK_SECRET"),
}))
app.use(database)
app.use(storage.bucket({ name: "images" }))
export default app

From that application definition, Layeron can coordinate Workers, routes, bindings, domains, D1 databases, R2 buckets, Queues, Durable Objects, Workflows, KV namespaces, secrets, migrations, cron triggers, logs, and deployment metadata.


  • Workspace: The collaboration and account boundary for teams, Cloudflare connections, API keys, and billing.
  • Project: The application boundary for modules, resources, domains, deployments, and settings.
  • Environment: An isolated deployment target such as development, preview, staging, or production.
  • Env: Application environment variables defined in layeron.config.ts and resolved for the selected Environment.
  • Backend app: A typed TypeScript declaration of routes, modules, capabilities, resources, secrets, and runtime behavior.
  • Module: A packaged backend capability such as webhooks, database, storage, realtime, jobs, or observability.
  • Resource graph: The Cloudflare-native blueprint Layeron generates from your app before planning and applying changes.

Layeron keeps product behavior and infrastructure in one typed application model:

  1. User code: You declare routes, modules, schema, secrets, jobs, and backend capabilities in TypeScript.
  2. AppSpec: Layeron converts your code into a deterministic application specification.
  3. Module resolution: Installed modules contribute routes, runtime units, bindings, secrets, state stores, and internal edges.
  4. Capability graph: Layeron understands the backend capabilities your app needs.
  5. Runtime topology: Layeron chooses the runtime units, placement model, and internal service edges.
  6. Resource graph: Layeron lowers the app into Cloudflare resources and generated artifacts.
  7. Diff, plan, apply: Layeron compares desired state with deployed state, produces a deployment plan, applies Cloudflare changes, and stores deployment records.

  • One backend app: Model your backend as a single application with modules, routes, resources, and environments.
  • Cloudflare-native output: Deploy to Workers, D1, R2, Queues, Durable Objects, Workflows, KV, domains, bindings, and secrets.
  • Typed capability APIs: Add backend primitives with TypeScript modules instead of wiring each Cloudflare resource by hand.
  • Deterministic deploys: Compile, diff, plan, apply, and record every deployment.
  • Local and production flow: Develop locally with Layeron-managed project state, then promote the same app model to Cloudflare.
  • Operational visibility: Connect logs, events, metrics, traces, replay metadata, and deployment context to the capabilities that produced them.

Layeron lets small teams build backend systems that usually require separate infrastructure code, deployment tooling, runtime conventions, observability plumbing, and Cloudflare-specific orchestration.

You keep the authoring experience close to product code:

Terminal window
app.use(webhooks.stripe())
app.use(storage.bucket("images"))
app.use(realtime.rooms())
app.get("/api/health", handler)

Layeron handles the generated Worker code, bindings, secrets, resource dependencies, migrations, deployment plans, and dashboard metadata behind that application model.


  • Quickstart: Create a backend, run it locally, and deploy it to Cloudflare.
  • Backend: Understand project config, backend entries, modules, routes, namespaces, and native Cloudflare resources.
  • Database: Add SQL storage, schema declarations, migrations, typed queries, and capacity settings.
  • Webhooks: Receive provider events, verify signatures, store event history, and replay failed work.
  • Observability: Record metrics, events, timings, spans, and error signals from backend code.