# Quickback Compiler

The **Quickback Compiler** is the build tool at the center of Quickback. You write declarative definitions in TypeScript — schema, security rules, validation, custom actions — and the compiler emits a production Hono application for the **Quickback Stack** on Cloudflare.

```
defineTable() ─┐
                ├─► quickback compile ─► Hono API on Cloudflare
defineActions()─┘                       (D1 or Neon)
```

## What the compiler does

When you run `quickback compile`, it:

1. **Reads your definitions** — every `defineTable()`, `defineActions()`, and `defineConfig()` in your project
2. **Validates security** — firewall, access, guards, and masking are checked for consistency
3. **Generates output** — Hono routes + middleware + types + OpenAPI spec + MCP server + security artifacts
4. **Emits database migrations** — runs `drizzle-kit generate` for schema changes

```
quickback/
├── quickback.config.ts    # Compiler configuration (providers, options)
└── features/
    └── jobs/
        ├── jobs.ts         # defineTable(...)
        └── actions.ts      # defineActions(...)
```

## The target: Hono on Cloudflare

[Quickback for Hono API](/compiler/targets/hono-api) generates a complete Hono application bundled into a Cloudflare Worker. Pair with **Cloudflare D1** for SQLite-at-the-edge or **Neon** for full PostgreSQL via Hyperdrive.

```typescript
providers: {
  runtime: defineRuntime('cloudflare'),
  database: defineDatabase('cloudflare-d1'), // or 'neon'
  auth: defineAuth('better-auth'),
}
```

## The DSL

- **[Definitions](/compiler/definitions)** — Schema, Firewall, Access, Guards, Masking, Views, Actions
- **[Configuration](/compiler/config)** — `quickback.config.ts`, providers, domains, bindings
- **[Getting Started](/compiler/getting-started)** — Templates and full examples

## The cloud and the CLI

You don't run the compiler binary locally — it runs as a hosted service:

- **[Cloud Compiler](/compiler/cloud-compiler)** — `compiler.quickback.dev`, CLI, authentication, MCP server for editors
- **[Claude Code Skill](/compiler/claude-code-skill)** — AI-powered authoring assistance

## Development workflow

1. **Define resources** in `quickback/features/`
2. **Compile** with `quickback compile`
3. **Apply migrations** with `wrangler d1 migrations apply`
4. **Test locally** with `wrangler dev`
5. **Deploy** with `wrangler deploy`

## Next steps

- [Getting Started](/compiler/getting-started) — Create your first project
- [Definitions](/compiler/definitions) — The DSL
- [Quickback for Hono API](/compiler/targets/hono-api) — Generated output reference
