@quickback-dev/cli 0.16.1 → 0.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/compile.d.ts.map +1 -1
- package/dist/commands/compile.js +24 -0
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/create.js +2 -2
- package/dist/docs/content.js +5 -5
- package/dist/docs/content.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/copy-source-apps.d.ts +34 -0
- package/dist/lib/copy-source-apps.d.ts.map +1 -0
- package/dist/lib/copy-source-apps.js +136 -0
- package/dist/lib/copy-source-apps.js.map +1 -0
- package/dist/lib/copy-source-apps.test.d.ts +2 -0
- package/dist/lib/copy-source-apps.test.d.ts.map +1 -0
- package/dist/lib/copy-source-apps.test.js +170 -0
- package/dist/lib/copy-source-apps.test.js.map +1 -0
- package/dist/skill/docs/compiler/config/bindings.md +35 -1
- package/dist/skill/docs/compiler/config/output.md +41 -0
- package/dist/skill/docs/compiler/getting-started/template-empty.md +1 -1
- package/dist/skill/docs/stack/cms/security.md +1 -1
- package/dist/skill/docs/stack/realtime/durable-objects.md +16 -0
- package/package.json +1 -1
- package/src/skill/docs/compiler/config/bindings.md +35 -1
- package/src/skill/docs/compiler/config/output.md +41 -0
- package/src/skill/docs/compiler/getting-started/template-empty.md +1 -1
- package/src/skill/docs/stack/cms/security.md +1 -1
- package/src/skill/docs/stack/realtime/durable-objects.md +16 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/commands/compile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/commands/compile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA+DH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAsB,OAAO,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4bzE"}
|
package/dist/commands/compile.js
CHANGED
|
@@ -24,6 +24,7 @@ import { loadConfig, loadFeatures, findConfigPath, findFeaturesDir, findServices
|
|
|
24
24
|
import { writeFilesWithMerge } from '../lib/file-writer.js';
|
|
25
25
|
import { prepareGeneratedDir } from '../lib/prepare-output.js';
|
|
26
26
|
import { copyPublicAssets, PublicAssetCollisionError } from '../lib/copy-public-assets.js';
|
|
27
|
+
import { copySourceApps, SourceAppCollisionError } from '../lib/copy-source-apps.js';
|
|
27
28
|
import { isSecurityReportArtifactContent, partitionGeneratedFiles } from '../lib/artifact-routing.js';
|
|
28
29
|
import { runCommand } from '../lib/shell.js';
|
|
29
30
|
import { syncConfigFile } from '../lib/config-sync.js';
|
|
@@ -371,6 +372,29 @@ export async function compile(options = {}) {
|
|
|
371
372
|
}
|
|
372
373
|
throw error;
|
|
373
374
|
}
|
|
375
|
+
// User-authored source apps — anything under quickback/apps/<name>/
|
|
376
|
+
// rides past the compiler verbatim into src/apps/<name>/, alongside the
|
|
377
|
+
// compiler-emitted SPA shells (cms/, account/). Use this for hand-written
|
|
378
|
+
// companion mini-SPAs (e.g. m/, admin/) that share the worker's ASSETS
|
|
379
|
+
// binding. Static binaries belong in quickback/public/ instead.
|
|
380
|
+
try {
|
|
381
|
+
const appsResult = await copySourceApps({
|
|
382
|
+
projectRoot,
|
|
383
|
+
outputDir,
|
|
384
|
+
manifestPaths: filesToWrite.map((f) => f.path),
|
|
385
|
+
});
|
|
386
|
+
if (appsResult.copied > 0) {
|
|
387
|
+
console.log(pc.gray(` ${pc.green('●')} Copied ${appsResult.copied} source app file(s) from quickback/apps/ → src/apps/`));
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
catch (error) {
|
|
391
|
+
if (error instanceof SourceAppCollisionError) {
|
|
392
|
+
spinner.fail('Source app collision');
|
|
393
|
+
console.error(pc.red(error.message));
|
|
394
|
+
process.exit(1);
|
|
395
|
+
}
|
|
396
|
+
throw error;
|
|
397
|
+
}
|
|
374
398
|
// Run post-compile commands from providers
|
|
375
399
|
if (result.commands && result.commands.length > 0) {
|
|
376
400
|
console.log(pc.gray('\nRunning post-compile commands...\n'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.js","sourceRoot":"","sources":["../../src/commands/compile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACxD,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACpL,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAC3F,OAAO,EAAE,+BAA+B,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACtG,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,SAAS,WAAW,CAAC,CA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CAAC;iBAAM,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC3C,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,2CAA2C,CAAC,CAAC,CAAC;gBACpE,OAAO,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAC;YAC/D,CAAC;QACH,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC,CAAC;QAC3C,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
package/dist/commands/create.js
CHANGED
|
@@ -399,7 +399,7 @@ export const todos = sqliteTable("todos", {
|
|
|
399
399
|
export default defineTable(todos, {
|
|
400
400
|
firewall: {
|
|
401
401
|
organization: {},
|
|
402
|
-
owner: {
|
|
402
|
+
owner: {},
|
|
403
403
|
softDelete: {},
|
|
404
404
|
},
|
|
405
405
|
|
|
@@ -625,7 +625,7 @@ export const projects = sqliteTable("projects", {
|
|
|
625
625
|
export default defineTable(projects, {
|
|
626
626
|
firewall: {
|
|
627
627
|
organization: {},
|
|
628
|
-
owner: {
|
|
628
|
+
owner: {},
|
|
629
629
|
softDelete: {},
|
|
630
630
|
},
|
|
631
631
|
guards: {
|
package/dist/docs/content.js
CHANGED
|
@@ -43,7 +43,7 @@ export const DOCS = {
|
|
|
43
43
|
},
|
|
44
44
|
"compiler/config/bindings": {
|
|
45
45
|
"title": "Custom Bindings",
|
|
46
|
-
"content": "Quickback's compiler owns the D1/KV/R2/ASSETS/queue blocks it needs for its own features. Anything else your worker binds to — Cloudflare Email, an extra R2 bucket, a custom queue, a service binding, your own Durable Object, Workers AI, or non-secret `[vars]` — goes under the top-level `bindings` key:\n\n```ts\n\nexport default defineConfig({\n name: \"studio-mail\",\n template: \"hono\",\n providers: {\n runtime: defineRuntime(\"cloudflare\"),\n database: defineDatabase(\"cloudflare-d1\", { splitDatabases: true }),\n auth: defineAuth(\"better-auth\"),\n },\n bindings: {\n sendEmail: [{ name: \"EMAIL\" }],\n r2Buckets: [\n { binding: \"MAIL_RAW\", bucketName: \"studio-mail-raw\" },\n { binding: \"MAIL_ATTACHMENTS\", bucketName: \"studio-mail-attachments\" },\n ],\n vars: {\n MAIL_SENDING_DOMAIN: \"studio.example.com\",\n },\n },\n});\n```\n\ncamelCase field names map 1:1 to the snake_case TOML blocks in `wrangler.toml`. Every compile regenerates `wrangler.toml` from your config, so these entries are the source of truth — no more post-compile patch scripts.\n\n## Fields\n\n### `sendEmail`\n\nEmits `[[send_email]]`. Use when your worker calls `env.<NAME>.send(...)` via Cloudflare Email Service.\n\n```ts\nsendEmail: [\n {\n name: \"EMAIL\",\n // Optional: restrict who the worker is allowed to send to.\n destinationAddress: \"alerts@example.com\",\n allowedDestinationAddresses: [\"alerts@example.com\", \"ops@example.com\"],\n },\n]\n```\n\n### `r2Buckets`\n\nEmits additional `[[r2_buckets]]` blocks alongside the compiler-owned files bucket.\n\n```ts\nr2Buckets: [\n {\n binding: \"MAIL_RAW\",\n bucketName: \"studio-mail-raw\",\n previewBucketName: \"studio-mail-raw-preview\", // optional\n jurisdiction: \"eu\", // optional\n },\n]\n```\n\n### `queueProducers` / `queueConsumers`\n\nEmits `[[queues.producers]]` and `[[queues.consumers]]`. Useful for app-owned queues beyond the compiler's webhook/embedding queues.\n\n```ts\nqueueProducers: [\n { binding: \"MAIL_QUEUE\", queue: \"mail-send\" },\n],\nqueueConsumers: [\n {\n queue: \"mail-send\",\n maxBatchSize: 5,\n maxBatchTimeout: 30,\n maxRetries: 3,\n maxConcurrency: 2,\n deadLetterQueue: \"mail-dlq\",\n },\n]\n```\n\n### `services`\n\nEmits `[[services]]` — service bindings to sibling workers.\n\n```ts\nservices: [\n { binding: \"INBOUND\", service: \"studio-mail-inbound\", environment: \"production\" },\n]\n```\n\n### `durableObjects`\n\nEmits `[[durable_objects.bindings]]` for app-owned Durable Objects. Don't use this for Quickback's built-in `BROADCASTER` realtime DO — that one is compiler-owned.\n\nA DO entry has two flavors: **in-worker** (the class lives in this worker — set `from`) or **cross-worker** (the class lives in another worker — set `scriptName`). The two are mutually exclusive.\n\n```ts\ndurableObjects: [\n // In-worker DO — Quickback re-exports the class from src/index.ts\n // and emits a [[migrations]] block. Class file lives at\n // quickback/features/loops/lib/ItemStream.ts (copied verbatim to src/).\n { name: \"ITEM_STREAM\", className: \"ItemStream\", from: \"features/loops/lib/ItemStream\" },\n\n // Cross-worker DO — the exporting worker owns the migration; this\n // worker only declares the binding.\n { name: \"RATE_LIMITER\", className: \"RateLimiter\", scriptName: \"rate-limit-worker\" },\n]\n```\n\nEach in-worker DO entry accepts:\n\n| Field | Default | Notes |\n|-------|---------|-------|\n| `name` | — | Wrangler binding name. Becomes `c.env.<NAME>` (typed as `DurableObjectNamespace`). |\n| `className` | — | The exported TypeScript class. |\n| `from` | — | Module path under `src/` (no `./`, no `.ts`). The compiler copies `quickback/lib/...` and `quickback/features/<f>/lib/...` verbatim into `src/`, so use that same relative path. |\n| `migrationTag` | `qb-do-${className}` | Wrangler migration tag. Stable across regenerations — **never remove or rename a deployed tag**, or wrangler will reject the deploy. |\n| `useSqlite` | `true` | SQLite-backed DO storage. Set to `false` for the legacy KV-backed mode. |\n| `scriptName` | — | Cross-worker only. Mutually exclusive with `from`. |\n\nWhere the class file lives: in-worker DO classes go under `quickback/lib/` or `quickback/features/<feature>/lib/` so they survive every compile (the rest of `src/` is wiped). Both copy verbatim into the generated `src/` tree.\n\
|
|
46
|
+
"content": "Quickback's compiler owns the D1/KV/R2/ASSETS/queue blocks it needs for its own features. Anything else your worker binds to — Cloudflare Email, an extra R2 bucket, a custom queue, a service binding, your own Durable Object, Workers AI, or non-secret `[vars]` — goes under the top-level `bindings` key:\n\n```ts\n\nexport default defineConfig({\n name: \"studio-mail\",\n template: \"hono\",\n providers: {\n runtime: defineRuntime(\"cloudflare\"),\n database: defineDatabase(\"cloudflare-d1\", { splitDatabases: true }),\n auth: defineAuth(\"better-auth\"),\n },\n bindings: {\n sendEmail: [{ name: \"EMAIL\" }],\n r2Buckets: [\n { binding: \"MAIL_RAW\", bucketName: \"studio-mail-raw\" },\n { binding: \"MAIL_ATTACHMENTS\", bucketName: \"studio-mail-attachments\" },\n ],\n vars: {\n MAIL_SENDING_DOMAIN: \"studio.example.com\",\n },\n },\n});\n```\n\ncamelCase field names map 1:1 to the snake_case TOML blocks in `wrangler.toml`. Every compile regenerates `wrangler.toml` from your config, so these entries are the source of truth — no more post-compile patch scripts.\n\n## Fields\n\n### `sendEmail`\n\nEmits `[[send_email]]`. Use when your worker calls `env.<NAME>.send(...)` via Cloudflare Email Service.\n\n```ts\nsendEmail: [\n {\n name: \"EMAIL\",\n // Optional: restrict who the worker is allowed to send to.\n destinationAddress: \"alerts@example.com\",\n allowedDestinationAddresses: [\"alerts@example.com\", \"ops@example.com\"],\n },\n]\n```\n\n### `r2Buckets`\n\nEmits additional `[[r2_buckets]]` blocks alongside the compiler-owned files bucket.\n\n```ts\nr2Buckets: [\n {\n binding: \"MAIL_RAW\",\n bucketName: \"studio-mail-raw\",\n previewBucketName: \"studio-mail-raw-preview\", // optional\n jurisdiction: \"eu\", // optional\n },\n]\n```\n\n### `queueProducers` / `queueConsumers`\n\nEmits `[[queues.producers]]` and `[[queues.consumers]]`. Useful for app-owned queues beyond the compiler's webhook/embedding queues.\n\n```ts\nqueueProducers: [\n { binding: \"MAIL_QUEUE\", queue: \"mail-send\" },\n],\nqueueConsumers: [\n {\n queue: \"mail-send\",\n maxBatchSize: 5,\n maxBatchTimeout: 30,\n maxRetries: 3,\n maxConcurrency: 2,\n deadLetterQueue: \"mail-dlq\",\n },\n]\n```\n\n### `services`\n\nEmits `[[services]]` — service bindings to sibling workers.\n\n```ts\nservices: [\n { binding: \"INBOUND\", service: \"studio-mail-inbound\", environment: \"production\" },\n]\n```\n\n### `durableObjects`\n\nEmits `[[durable_objects.bindings]]` for app-owned Durable Objects. Don't use this for Quickback's built-in `BROADCASTER` realtime DO — that one is compiler-owned.\n\nA DO entry has two flavors: **in-worker** (the class lives in this worker — set `from`) or **cross-worker** (the class lives in another worker — set `scriptName`). The two are mutually exclusive.\n\n```ts\ndurableObjects: [\n // In-worker DO — Quickback re-exports the class from src/index.ts\n // and emits a [[migrations]] block. Class file lives at\n // quickback/features/loops/lib/ItemStream.ts (copied verbatim to src/).\n { name: \"ITEM_STREAM\", className: \"ItemStream\", from: \"features/loops/lib/ItemStream\" },\n\n // Cross-worker DO — the exporting worker owns the migration; this\n // worker only declares the binding.\n { name: \"RATE_LIMITER\", className: \"RateLimiter\", scriptName: \"rate-limit-worker\" },\n]\n```\n\nEach in-worker DO entry accepts:\n\n| Field | Default | Notes |\n|-------|---------|-------|\n| `name` | — | Wrangler binding name. Becomes `c.env.<NAME>` (typed as `DurableObjectNamespace`). |\n| `className` | — | The exported TypeScript class. |\n| `from` | — | Module path under `src/` (no `./`, no `.ts`). The compiler copies `quickback/lib/...` and `quickback/features/<f>/lib/...` verbatim into `src/`, so use that same relative path. |\n| `migrationTag` | `qb-do-${className}` | Wrangler migration tag. Stable across regenerations — **never remove or rename a deployed tag**, or wrangler will reject the deploy. |\n| `useSqlite` | `true` | SQLite-backed DO storage. Set to `false` for the legacy KV-backed mode. |\n| `scriptName` | — | Cross-worker only. Mutually exclusive with `from`. |\n\nWhere the class file lives: in-worker DO classes go under `quickback/lib/` or `quickback/features/<feature>/lib/` so they survive every compile (the rest of `src/` is wiped). Both copy verbatim into the generated `src/` tree.\n\n### `durableObjectMigrations`\n\nCloudflare's `[[migrations]]` list is **append-only** — once a tag is deployed, removing it from `wrangler.toml` causes the next deploy to fail with code 10061 (\"Cannot apply migration\"). Quickback regenerates `wrangler.toml` from your config on every compile, so any historical lifecycle entries (deleted, renamed, transferred classes) need to live in the config too — otherwise they'd be wiped.\n\n`bindings.durableObjectMigrations[]` is the slot for those entries. Compiler emits them **first** in the [[migrations]] list, before the auto-emitted current-class creation tags, so CF sees the chronology it needs.\n\n```ts\nbindings: {\n durableObjects: [\n { name: \"NOTEPAD\", className: \"Notepad\", from: \"lib/Notepad\" },\n ],\n // Historical lifecycle: a previous LegacyNotes class was deleted on\n // 2026-05-09. Without this entry, a recompile would drop the\n // deleted_classes block and the next deploy would 10061.\n durableObjectMigrations: [\n {\n tag: \"qb-do-deleted-legacy-notes-2026-05-09\",\n deletedClasses: [\"LegacyNotes\"],\n },\n ],\n}\n```\n\nEach entry accepts:\n\n| Field | Notes |\n|-------|-------|\n| `tag` | Migration tag. Once deployed, never change it. Convention: `qb-do-<verb>-<class>-<YYYY-MM-DD>`. |\n| `newClasses` | KV-backed creations. Rare — most DOs use `new_sqlite_classes`. |\n| `newSqliteClasses` | SQLite-backed creations. Use this if you ever need to declare a creation manually instead of letting the auto-emit handle it. |\n| `deletedClasses` | Array of class names to tear down. **Destroys the DO's storage** on deploy — only use when you're sure. |\n| `renamedClasses` | `[{ from, to }]` — class rename without losing storage. |\n| `transferredClasses` | `[{ from, from_script, to }]` — move a class across workers. |\n\n**When you remove a DO from `bindings.durableObjects`**, declare the teardown here. Don't hand-edit `wrangler.toml` — those edits get wiped on the next compile.\n\n### `vars`\n\nMerged into the compiler's own `[vars]` table — emitting a second `[vars]` block would be invalid TOML. Values must be `string`, `number`, or `boolean`.\n\n```ts\nvars: {\n MAIL_SENDING_DOMAIN: \"studio.example.com\",\n MAIL_MAX_ATTACHMENTS: 10,\n MAIL_DEBUG: false,\n}\n```\n\nSecrets do **not** go here. Use Wrangler's secret store instead:\n\n```bash\nwrangler secret put MAIL_INBOUND_SECRET\n```\n\n### `ai`\n\nEmits a top-level `[ai]` block. Use this if you need Workers AI bound under a name different from Quickback's internal `AI`.\n\n```ts\nai: { binding: \"USER_AI\" }\n```\n\n## Reserved binding names\n\nBinding names that clash with compiler-owned bindings are rejected at validation time, with the offending field path in the error message. Reserved names depend on what your config enables:\n\n| Name | Reserved when |\n|------|---------------|\n| `AUTH_DB`, `DB` | `splitDatabases: true` (default) |\n| `DATABASE` | `splitDatabases: false` |\n| `AUDIT_DB` | always (cross-tenant unsafe-action audit) |\n| `WEBHOOKS_DB`, `WEBHOOKS_QUEUE` | a webhooks binding is configured |\n| `KV` | always |\n| `R2_BUCKET`, `FILES_DB` | `fileStorage: defineFileStorage(\"cloudflare-r2\")` |\n| `VECTORIZE` | a Vectorize index is configured |\n| `BROADCASTER` | realtime is enabled |\n| `EMAIL` | `email: { provider: \"cloudflare\" }` |\n| `ASSETS` | `cms: true` or `account: true` |\n| `AI`, `EMBEDDINGS_QUEUE` | embeddings are configured |\n\nPick a different name — the generated `env` on the handler side takes whatever binding you pick.\n\n## See also\n\n- [Environment Variables](/compiler/config/variables) — the non-secret `[vars]` / secret split\n- [Providers](/compiler/config/providers) — runtime / database / auth selection"
|
|
47
47
|
},
|
|
48
48
|
"compiler/config/domains": {
|
|
49
49
|
"title": "Multi-Domain Architecture",
|
|
@@ -55,7 +55,7 @@ export const DOCS = {
|
|
|
55
55
|
},
|
|
56
56
|
"compiler/config/output": {
|
|
57
57
|
"title": "Output Structure",
|
|
58
|
-
"content": "The compiler generates a complete project structure based on your definitions and provider configuration. The output varies depending on your runtime (Cloudflare vs Bun) and enabled features.\n\n**Warning:** Never edit files in `src/` directly. They are overwritten on every compile. Make changes in your `quickback/` definitions instead.\n\n## Cloudflare Output\n\n```\nsrc/\n├── index.ts # Hono app entry point (Workers export)\n├── env.d.ts # Cloudflare bindings TypeScript types\n├── db/\n│ ├── index.ts # Database connection factory\n│ ├── auth-schema.ts # Auth table schemas (dual mode)\n│ └── features-schema.ts # Feature table schemas (dual mode)\n├── auth/\n│ └── index.ts # Better Auth instance & config\n├── features/\n│ └── {feature}/\n│ ├── schema.ts # Drizzle table definition\n│ ├── routes.ts # CRUD + action endpoints\n│ └── actions.ts # Action handlers (if defined)\n├── lib/\n│ ├── access.ts # Access control helpers\n│ ├── types.ts # Runtime type definitions\n│ ├── masks.ts # Field masking utilities\n│ ├── services.ts # Service layer\n│ ├── audit-wrapper.ts # Auto-inject audit fields\n│ └── security-audit.ts # Unsafe cross-tenant audit logger (when needed)\n└── middleware/\n ├── auth.ts # Auth context middleware\n ├── db.ts # Database instance middleware\n └── services.ts # Service injection middleware\n\nquickback/drizzle/\n├── auth/ # Auth migrations (dual mode)\n│ ├── meta/\n│ │ ├── _journal.json\n│ │ └── 0000_snapshot.json\n│ └── 0000_initial.sql\n├── features/ # Feature migrations (dual mode)\n│ ├── meta/\n│ │ ├── _journal.json\n│ │ └── 0000_snapshot.json\n│ └── 0000_initial.sql\n└── audit/ # Unsafe cross-tenant action audit migrations (when needed)\n ├── meta/\n └── 0000_initial.sql\n\n# Root config files\n├── package.json\n├── tsconfig.json\n├── wrangler.toml # Cloudflare Workers config\n├── drizzle.config.ts # Features DB drizzle config\n├── drizzle.auth.config.ts # Auth DB drizzle config (dual mode)\n└── drizzle.audit.config.ts # Audit DB drizzle config (when unsafe actions exist)\n```\n\n## Bun Output\n\n```\nsrc/\n├── index.ts # Hono app entry point (Bun server)\n├── db/\n│ ├── index.ts # SQLite connection (bun:sqlite)\n│ └── schema.ts # Combined schema (single DB)\n├── auth/\n│ └── index.ts # Better Auth instance\n├── features/\n│ └── {feature}/\n│ ├── schema.ts\n│ ├── routes.ts\n│ └── actions.ts\n├── lib/\n│ ├── access.ts\n│ ├── types.ts\n│ ├── masks.ts\n│ ├── services.ts\n│ └── audit-wrapper.ts\n└── middleware/\n ├── auth.ts\n ├── db.ts\n └── services.ts\n\nquickback/drizzle/ # Single migration directory\n├── meta/\n│ ├── _journal.json\n│ └── 0000_snapshot.json\n└── 0000_initial.sql\n\ndata/ # SQLite database files\n└── app.db\n\n├── package.json\n├── tsconfig.json\n└── drizzle.config.ts\n```\n\n## Key Differences by Runtime\n\n| Aspect | Cloudflare | Bun |\n|--------|-----------|-----|\n| Entry point | Workers `export default` | `Bun.serve()` with port |\n| Database | D1 bindings (dual mode) | SQLite file (single DB) |\n| Types | `env.d.ts` for bindings | No extra types needed |\n| Config | `wrangler.toml` | `.env` file |\n| Migrations | `quickback/drizzle/auth/` + `quickback/drizzle/features/` | `quickback/drizzle/` |\n| Drizzle configs | 2 configs (auth + features) | 1 config |\n\n## Optional Output Files\n\nThese files are generated only when the corresponding features are configured:\n\n### Embeddings\n\nWhen any feature has `embeddings` configured:\n\n```\nsrc/\n├── lib/\n│ └── embeddings.ts # Embedding helpers\n├── routes/\n│ └── embeddings.ts # POST /api/v1/embeddings endpoint\n└── queue-consumer.ts # Queue handler for async embedding jobs\n```\n\n### File Storage (R2)\n\nWhen `fileStorage` is configured:\n\n```\nsrc/\n└── routes/\n └── storage.ts # File upload/download endpoints\nquickback/drizzle/\n└── files/ # File metadata migrations\n ├── meta/\n └── 0000_*.sql\n```\n\n### Webhooks\n\nWhen webhooks are enabled:\n\n```\nsrc/\n└── lib/\n └── webhooks/\n ├── index.ts # Webhook module entry\n ├── sign.ts # Webhook payload signing\n ├── handlers.ts # Handler registry\n ├── emit.ts # Queue emission helpers\n ├── routes.ts # Inbound/outbound endpoints\n └── providers/\n ├── index.ts\n └── stripe.ts # Stripe webhook handler\nquickback/drizzle/\n└── webhooks/ # Webhook schema migrations\n ├── meta/\n └── 0000_*.sql\n```\n\n### Security Audit Database (Unsafe Actions)\n\nWhen any action enables unsafe cross-tenant mode (`unsafe.crossTenant: true`):\n\n```\nsrc/\n├── db/\n│ └── audit-schema.ts # audit_events table\n└── lib/\n └── security-audit.ts # mandatory audit writer\n\nquickback/drizzle/\n└── audit/\n ├── meta/\n └── 0000_*.sql\n\n# Root\n└── drizzle.audit.config.ts\n```\n\nCloudflare output also includes an `AUDIT_DB` D1 binding in `wrangler.toml` and migration scripts:\n\n- `db:migrate:audit:local`\n- `db:migrate:audit:remote`\n\n### Security Contract Report and Signature\n\nGenerated on every compile (unless disabled via `compiler.securityContracts.report.enabled: false`):\n\n```\nreports/\n├── security-contracts.report.json # Contract evaluation summary + violations\n└── security-contracts.report.sig.json # Signature / digest envelope for the report\n```\n\nThe signature file uses HMAC-SHA256 when a signing key is configured, otherwise it falls back to SHA-256 digest mode. \nSet `compiler.securityContracts.report.signature.required: true` to fail compilation when a signing key is missing.\n\n### Realtime\n\nWhen any feature has `realtime` configured:\n\n```\nsrc/\n├── lib/\n│ ├── realtime.ts # Broadcast helpers\n│ ├── Broadcaster.ts # Durable Object class (inline in main worker)\n│ └── ws-ticket.ts # WebSocket ticket auth utility\n└── routes/\n └── ws-ticket.ts # POST /realtime/v1/ws-ticket endpoint\n```\n\nThe Broadcaster DO class is exported from your main worker entry point and runs inline — no separate `cloudflare-workers/broadcast/` deployment needed.\n\n### Device Authorization\n\nWhen the `deviceAuthorization` plugin is enabled:\n\n```\nsrc/\n└── routes/\n └── cli-auth.ts # Device auth flow endpoints\n```\n\n## Database Schemas\n\n### Dual Database Mode (Cloudflare Default)\n\nThe compiler separates schemas into two files:\n\n**`src/db/auth-schema.ts`** — Re-exports Better Auth table schemas:\n- `users`, `sessions`, `accounts`\n- `organizations`, `members`, `invitations` (if organizations enabled)\n- Plugin-specific tables (`apiKeys`, etc.)\n\n**`src/db/features-schema.ts`** — Re-exports your feature schemas:\n- All tables defined with `defineTable()`\n- Audit field columns added automatically\n\n### Single Database Mode (Bun Default)\n\n**`src/db/schema.ts`** — Combined re-export of all schemas (auth + features).\n\n## Generated Routes\n\nFor each feature, the compiler generates a routes file at `src/features/{name}/routes.ts` containing:\n\n| Route | Generated When |\n|-------|----------------|\n| `GET /` | `crud.list` configured |\n| `GET /:id` | `crud.get` configured |\n| `POST /` | `crud.create` configured |\n| `PATCH /:id` | `crud.update` configured |\n| `DELETE /:id` | `crud.delete` configured |\n| `PUT /:id` | `crud.put` configured |\n| `POST /batch` | `crud.create` exists (auto-enabled) |\n| `PATCH /batch` | `crud.update` exists (auto-enabled) |\n| `DELETE /batch` | `crud.delete` exists (auto-enabled) |\n| `PUT /batch` | `crud.put` exists (auto-enabled) |\n| `GET /views/{name}` | `views` configured |\n| `POST /:id/{action}` | Record-based actions defined |\n| `POST /{action}` | Standalone actions defined |\n\nAll routes are mounted under `/api/v1/{feature}` in the main app.\n\n## Migrations\n\nThe compiler runs `drizzle-kit generate` during compilation to produce SQL migration files. On subsequent compiles, it uses `existingFiles` (your current migration state) to generate only incremental changes.\n\nThe CLI loads migration meta JSON from one location only — `<project>/quickback/drizzle/`:\n\n- `quickback/drizzle/auth/meta/`\n- `quickback/drizzle/features/meta/`\n- `quickback/drizzle/files/meta/`\n- `quickback/drizzle/webhooks/meta/`\n- `quickback/drizzle/audit/meta/`\n- `quickback/drizzle/meta/` (single-database mode)\n\nQuickback owns this state — nothing under a project-root `drizzle/` folder is ever read or written.\n\nMigration and report artifacts are written to the `quickback/` state directory:\n\n- `quickback/drizzle/...` for Drizzle migration SQL/meta artifacts\n- `quickback/reports/...` for security contract report artifacts\n\nFor non-interactive environments (cloud compile, CI), table/column renames must be declared with `compiler.migrations.renames` in `quickback.config.ts`. This avoids interactive rename prompts during migration generation.\n\nMigration files follow the Drizzle Kit naming convention:\n```\n0000_initial.sql\n0001_add_status_column.sql\n0002_create_orders_table.sql\n```\n\n## CMS and Account UI Assets\n\nWhen `cms` and/or `account` are enabled, the compiler builds the SPAs from source at compile time and includes the assets in the output.\n\nEach SPA is placed in its own subdirectory under `src/apps/`:\n\n```\nsrc/apps/ # Root assets directory\n├── cms/ # CMS SPA (served at /cms/ on unified domain)\n│ ├── index.html\n│ └── assets/\n│ ├── app.abc123.js # Content-hashed filenames from Vite\n│ └── app.xyz456.css\n└── account/ # Account SPA (served at /account/ on unified domain)\n ├── index.html\n └── assets/\n ├── app.def789.js\n └── app.ghi012.css\n```\n\nOn custom domains, each SPA is served at root (`/`) via hostname-based routing. On the unified domain, CMS is at `/cms/` and Account is at `/account/`.\n\n### Static Assets (`quickback/public/`)\n\nAnything you drop under `quickback/public/` is copied verbatim into `src/apps/` on every compile. The compiler does not parse, template, or otherwise touch these files — they are bytes that ride past it into the Cloudflare ASSETS binding.\n\n```\nquickback/public/ # Source — checked into your repo\n├── favicon.ico\n├── robots.txt\n├── og/\n│ └── og-image.png\n└── pdfs/\n └── whitepaper.pdf\n```\n\nAfter compile:\n\n```\nsrc/apps/ # Destination — written by the CLI\n├── favicon.ico # Served at https://your-domain/favicon.ico\n├── robots.txt # Served at /robots.txt\n├── og/og-image.png # Served at /og/og-image.png\n├── pdfs/whitepaper.pdf\n├── cms/ # Compiler-emitted SPA (don't shadow)\n└── account/ # Compiler-emitted SPA (don't shadow)\n```\n\nNotes:\n\n- The folder is optional. If it doesn't exist, this step is a no-op.\n- Files removed from `quickback/public/` disappear from `src/apps/` on the next compile — `src/` is wiped and rewritten each run.\n- Hidden entries (`.DS_Store`, `.git/`, dotfiles) are skipped.\n- A file in `quickback/public/` that would overwrite a compiler-emitted path (e.g. `quickback/public/cms/index.html`) fails the compile with a clear error rather than silently shadowing the SPA shell.\n- Binaries (images, fonts, PDFs) are copied byte-for-byte — there is no string round-trip.\n\n### Generated Wrangler Assets Config\n\nThe compiler always generates `run_worker_first = true` when SPAs are enabled — the Worker handles all SPA routing (per hostname and per path prefix):\n\n```toml\n[assets]\nbinding = \"ASSETS\"\ndirectory = \"src/apps\"\nnot_found_handling = \"none\"\nrun_worker_first = true\n```\n\nSee [Multi-Domain Architecture](/compiler/config/domains) for details on hostname routing.\n\n## See Also\n\n- [Providers](/compiler/config/providers) — Configure runtime, database, and auth providers\n- [Environment variables](/compiler/config/variables) — Required variables by runtime\n- [Multi-Domain Architecture](/compiler/config/domains) — Custom domains and hostname routing"
|
|
58
|
+
"content": "The compiler generates a complete project structure based on your definitions and provider configuration. The output varies depending on your runtime (Cloudflare vs Bun) and enabled features.\n\n**Warning:** Never edit files in `src/` directly. They are overwritten on every compile. Make changes in your `quickback/` definitions instead.\n\n## Cloudflare Output\n\n```\nsrc/\n├── index.ts # Hono app entry point (Workers export)\n├── env.d.ts # Cloudflare bindings TypeScript types\n├── db/\n│ ├── index.ts # Database connection factory\n│ ├── auth-schema.ts # Auth table schemas (dual mode)\n│ └── features-schema.ts # Feature table schemas (dual mode)\n├── auth/\n│ └── index.ts # Better Auth instance & config\n├── features/\n│ └── {feature}/\n│ ├── schema.ts # Drizzle table definition\n│ ├── routes.ts # CRUD + action endpoints\n│ └── actions.ts # Action handlers (if defined)\n├── lib/\n│ ├── access.ts # Access control helpers\n│ ├── types.ts # Runtime type definitions\n│ ├── masks.ts # Field masking utilities\n│ ├── services.ts # Service layer\n│ ├── audit-wrapper.ts # Auto-inject audit fields\n│ └── security-audit.ts # Unsafe cross-tenant audit logger (when needed)\n└── middleware/\n ├── auth.ts # Auth context middleware\n ├── db.ts # Database instance middleware\n └── services.ts # Service injection middleware\n\nquickback/drizzle/\n├── auth/ # Auth migrations (dual mode)\n│ ├── meta/\n│ │ ├── _journal.json\n│ │ └── 0000_snapshot.json\n│ └── 0000_initial.sql\n├── features/ # Feature migrations (dual mode)\n│ ├── meta/\n│ │ ├── _journal.json\n│ │ └── 0000_snapshot.json\n│ └── 0000_initial.sql\n└── audit/ # Unsafe cross-tenant action audit migrations (when needed)\n ├── meta/\n └── 0000_initial.sql\n\n# Root config files\n├── package.json\n├── tsconfig.json\n├── wrangler.toml # Cloudflare Workers config\n├── drizzle.config.ts # Features DB drizzle config\n├── drizzle.auth.config.ts # Auth DB drizzle config (dual mode)\n└── drizzle.audit.config.ts # Audit DB drizzle config (when unsafe actions exist)\n```\n\n## Bun Output\n\n```\nsrc/\n├── index.ts # Hono app entry point (Bun server)\n├── db/\n│ ├── index.ts # SQLite connection (bun:sqlite)\n│ └── schema.ts # Combined schema (single DB)\n├── auth/\n│ └── index.ts # Better Auth instance\n├── features/\n│ └── {feature}/\n│ ├── schema.ts\n│ ├── routes.ts\n│ └── actions.ts\n├── lib/\n│ ├── access.ts\n│ ├── types.ts\n│ ├── masks.ts\n│ ├── services.ts\n│ └── audit-wrapper.ts\n└── middleware/\n ├── auth.ts\n ├── db.ts\n └── services.ts\n\nquickback/drizzle/ # Single migration directory\n├── meta/\n│ ├── _journal.json\n│ └── 0000_snapshot.json\n└── 0000_initial.sql\n\ndata/ # SQLite database files\n└── app.db\n\n├── package.json\n├── tsconfig.json\n└── drizzle.config.ts\n```\n\n## Key Differences by Runtime\n\n| Aspect | Cloudflare | Bun |\n|--------|-----------|-----|\n| Entry point | Workers `export default` | `Bun.serve()` with port |\n| Database | D1 bindings (dual mode) | SQLite file (single DB) |\n| Types | `env.d.ts` for bindings | No extra types needed |\n| Config | `wrangler.toml` | `.env` file |\n| Migrations | `quickback/drizzle/auth/` + `quickback/drizzle/features/` | `quickback/drizzle/` |\n| Drizzle configs | 2 configs (auth + features) | 1 config |\n\n## Optional Output Files\n\nThese files are generated only when the corresponding features are configured:\n\n### Embeddings\n\nWhen any feature has `embeddings` configured:\n\n```\nsrc/\n├── lib/\n│ └── embeddings.ts # Embedding helpers\n├── routes/\n│ └── embeddings.ts # POST /api/v1/embeddings endpoint\n└── queue-consumer.ts # Queue handler for async embedding jobs\n```\n\n### File Storage (R2)\n\nWhen `fileStorage` is configured:\n\n```\nsrc/\n└── routes/\n └── storage.ts # File upload/download endpoints\nquickback/drizzle/\n└── files/ # File metadata migrations\n ├── meta/\n └── 0000_*.sql\n```\n\n### Webhooks\n\nWhen webhooks are enabled:\n\n```\nsrc/\n└── lib/\n └── webhooks/\n ├── index.ts # Webhook module entry\n ├── sign.ts # Webhook payload signing\n ├── handlers.ts # Handler registry\n ├── emit.ts # Queue emission helpers\n ├── routes.ts # Inbound/outbound endpoints\n └── providers/\n ├── index.ts\n └── stripe.ts # Stripe webhook handler\nquickback/drizzle/\n└── webhooks/ # Webhook schema migrations\n ├── meta/\n └── 0000_*.sql\n```\n\n### Security Audit Database (Unsafe Actions)\n\nWhen any action enables unsafe cross-tenant mode (`unsafe.crossTenant: true`):\n\n```\nsrc/\n├── db/\n│ └── audit-schema.ts # audit_events table\n└── lib/\n └── security-audit.ts # mandatory audit writer\n\nquickback/drizzle/\n└── audit/\n ├── meta/\n └── 0000_*.sql\n\n# Root\n└── drizzle.audit.config.ts\n```\n\nCloudflare output also includes an `AUDIT_DB` D1 binding in `wrangler.toml` and migration scripts:\n\n- `db:migrate:audit:local`\n- `db:migrate:audit:remote`\n\n### Security Contract Report and Signature\n\nGenerated on every compile (unless disabled via `compiler.securityContracts.report.enabled: false`):\n\n```\nreports/\n├── security-contracts.report.json # Contract evaluation summary + violations\n└── security-contracts.report.sig.json # Signature / digest envelope for the report\n```\n\nThe signature file uses HMAC-SHA256 when a signing key is configured, otherwise it falls back to SHA-256 digest mode. \nSet `compiler.securityContracts.report.signature.required: true` to fail compilation when a signing key is missing.\n\n### Realtime\n\nWhen any feature has `realtime` configured:\n\n```\nsrc/\n├── lib/\n│ ├── realtime.ts # Broadcast helpers\n│ ├── Broadcaster.ts # Durable Object class (inline in main worker)\n│ └── ws-ticket.ts # WebSocket ticket auth utility\n└── routes/\n └── ws-ticket.ts # POST /realtime/v1/ws-ticket endpoint\n```\n\nThe Broadcaster DO class is exported from your main worker entry point and runs inline — no separate `cloudflare-workers/broadcast/` deployment needed.\n\n### Device Authorization\n\nWhen the `deviceAuthorization` plugin is enabled:\n\n```\nsrc/\n└── routes/\n └── cli-auth.ts # Device auth flow endpoints\n```\n\n## Database Schemas\n\n### Dual Database Mode (Cloudflare Default)\n\nThe compiler separates schemas into two files:\n\n**`src/db/auth-schema.ts`** — Re-exports Better Auth table schemas:\n- `users`, `sessions`, `accounts`\n- `organizations`, `members`, `invitations` (if organizations enabled)\n- Plugin-specific tables (`apiKeys`, etc.)\n\n**`src/db/features-schema.ts`** — Re-exports your feature schemas:\n- All tables defined with `defineTable()`\n- Audit field columns added automatically\n\n### Single Database Mode (Bun Default)\n\n**`src/db/schema.ts`** — Combined re-export of all schemas (auth + features).\n\n## Generated Routes\n\nFor each feature, the compiler generates a routes file at `src/features/{name}/routes.ts` containing:\n\n| Route | Generated When |\n|-------|----------------|\n| `GET /` | `crud.list` configured |\n| `GET /:id` | `crud.get` configured |\n| `POST /` | `crud.create` configured |\n| `PATCH /:id` | `crud.update` configured |\n| `DELETE /:id` | `crud.delete` configured |\n| `PUT /:id` | `crud.put` configured |\n| `POST /batch` | `crud.create` exists (auto-enabled) |\n| `PATCH /batch` | `crud.update` exists (auto-enabled) |\n| `DELETE /batch` | `crud.delete` exists (auto-enabled) |\n| `PUT /batch` | `crud.put` exists (auto-enabled) |\n| `GET /views/{name}` | `views` configured |\n| `POST /:id/{action}` | Record-based actions defined |\n| `POST /{action}` | Standalone actions defined |\n\nAll routes are mounted under `/api/v1/{feature}` in the main app.\n\n## Migrations\n\nThe compiler runs `drizzle-kit generate` during compilation to produce SQL migration files. On subsequent compiles, it uses `existingFiles` (your current migration state) to generate only incremental changes.\n\nThe CLI loads migration meta JSON from one location only — `<project>/quickback/drizzle/`:\n\n- `quickback/drizzle/auth/meta/`\n- `quickback/drizzle/features/meta/`\n- `quickback/drizzle/files/meta/`\n- `quickback/drizzle/webhooks/meta/`\n- `quickback/drizzle/audit/meta/`\n- `quickback/drizzle/meta/` (single-database mode)\n\nQuickback owns this state — nothing under a project-root `drizzle/` folder is ever read or written.\n\nMigration and report artifacts are written to the `quickback/` state directory:\n\n- `quickback/drizzle/...` for Drizzle migration SQL/meta artifacts\n- `quickback/reports/...` for security contract report artifacts\n\nFor non-interactive environments (cloud compile, CI), table/column renames must be declared with `compiler.migrations.renames` in `quickback.config.ts`. This avoids interactive rename prompts during migration generation.\n\nMigration files follow the Drizzle Kit naming convention:\n```\n0000_initial.sql\n0001_add_status_column.sql\n0002_create_orders_table.sql\n```\n\n## CMS and Account UI Assets\n\nWhen `cms` and/or `account` are enabled, the compiler builds the SPAs from source at compile time and includes the assets in the output.\n\nEach SPA is placed in its own subdirectory under `src/apps/`:\n\n```\nsrc/apps/ # Root assets directory\n├── cms/ # CMS SPA (served at /cms/ on unified domain)\n│ ├── index.html\n│ └── assets/\n│ ├── app.abc123.js # Content-hashed filenames from Vite\n│ └── app.xyz456.css\n└── account/ # Account SPA (served at /account/ on unified domain)\n ├── index.html\n └── assets/\n ├── app.def789.js\n └── app.ghi012.css\n```\n\nOn custom domains, each SPA is served at root (`/`) via hostname-based routing. On the unified domain, CMS is at `/cms/` and Account is at `/account/`.\n\n### Static Assets (`quickback/public/`)\n\nAnything you drop under `quickback/public/` is copied verbatim into `src/apps/` on every compile. The compiler does not parse, template, or otherwise touch these files — they are bytes that ride past it into the Cloudflare ASSETS binding.\n\n```\nquickback/public/ # Source — checked into your repo\n├── favicon.ico\n├── robots.txt\n├── og/\n│ └── og-image.png\n└── pdfs/\n └── whitepaper.pdf\n```\n\nAfter compile:\n\n```\nsrc/apps/ # Destination — written by the CLI\n├── favicon.ico # Served at https://your-domain/favicon.ico\n├── robots.txt # Served at /robots.txt\n├── og/og-image.png # Served at /og/og-image.png\n├── pdfs/whitepaper.pdf\n├── cms/ # Compiler-emitted SPA (don't shadow)\n└── account/ # Compiler-emitted SPA (don't shadow)\n```\n\nNotes:\n\n- The folder is optional. If it doesn't exist, this step is a no-op.\n- Files removed from `quickback/public/` disappear from `src/apps/` on the next compile — `src/` is wiped and rewritten each run.\n- Hidden entries (`.DS_Store`, `.git/`, dotfiles) are skipped.\n- A file in `quickback/public/` that would overwrite a compiler-emitted path (e.g. `quickback/public/cms/index.html`) fails the compile with a clear error rather than silently shadowing the SPA shell.\n- Binaries (images, fonts, PDFs) are copied byte-for-byte — there is no string round-trip.\n\n### Source Apps (`quickback/apps/`)\n\nFor hand-authored TypeScript apps that live alongside the compiler-emitted SPA shells, drop them under `quickback/apps/<name>/`. The CLI copies the tree into `src/apps/<name>/` on every compile, byte-for-byte, after the compiler has finished writing.\n\n```\nquickback/apps/ # Source — checked into your repo\n├── m/ # A hand-authored mobile companion app\n│ ├── index.tsx\n│ ├── components/Button.tsx\n│ └── lib/utils.ts\n└── admin/ # A hand-authored admin tool\n └── index.tsx\n```\n\nAfter compile:\n\n```\nsrc/apps/\n├── m/index.tsx # Hand-authored — preserved across compiles\n├── m/components/Button.tsx\n├── m/lib/utils.ts\n├── admin/index.tsx\n├── cms/ # Compiler-emitted SPA (don't shadow)\n└── account/ # Compiler-emitted SPA (don't shadow)\n```\n\nWhen to choose `apps/` vs `public/`:\n\n| | `quickback/public/` | `quickback/apps/` |\n|---|---|---|\n| **Use for** | Static binaries (logos, fonts, OG images, PDFs, robots.txt) | Hand-authored TS/TSX/JS app source |\n| **Skips** | Hidden entries only (`.DS_Store`, `.git/`) | Hidden entries + `node_modules/`, `dist/`, `build/`, `.next/`, `.turbo/`, `.cache/` |\n| **Folder layout** | Files at any depth — flat or nested | Apps under named subfolders (`m/`, `admin/`, …) |\n\nNotes:\n\n- The folder is optional. If it doesn't exist, this step is a no-op.\n- Files removed from `quickback/apps/<name>/` disappear from `src/apps/<name>/` on the next compile — `src/` is wiped and rewritten each run.\n- A file in `quickback/apps/` that would overwrite a compiler-emitted path (e.g. `quickback/apps/cms/index.tsx` while `cms: true`) fails the compile with a clear error.\n- Migrating from hand-edited `src/apps/<name>/`: move the entire folder under `quickback/apps/<name>/` once, then trust the compile cycle. The hermetic `src/` contract holds again.\n\n### Generated Wrangler Assets Config\n\nThe compiler always generates `run_worker_first = true` when SPAs are enabled — the Worker handles all SPA routing (per hostname and per path prefix):\n\n```toml\n[assets]\nbinding = \"ASSETS\"\ndirectory = \"src/apps\"\nnot_found_handling = \"none\"\nrun_worker_first = true\n```\n\nSee [Multi-Domain Architecture](/compiler/config/domains) for details on hostname routing.\n\n## See Also\n\n- [Providers](/compiler/config/providers) — Configure runtime, database, and auth providers\n- [Environment variables](/compiler/config/variables) — Required variables by runtime\n- [Multi-Domain Architecture](/compiler/config/domains) — Custom domains and hostname routing"
|
|
59
59
|
},
|
|
60
60
|
"compiler/config/providers": {
|
|
61
61
|
"title": "Providers",
|
|
@@ -151,7 +151,7 @@ export const DOCS = {
|
|
|
151
151
|
},
|
|
152
152
|
"compiler/getting-started/template-empty": {
|
|
153
153
|
"title": "Empty Scaffolding Templates",
|
|
154
|
-
"content": "The `empty` template creates a project with only the configuration file — no example features. Use this when you know exactly what you want to build and don't need starter code.\n\n## Available Empty Templates\n\n| Template | Runtime | Database | Command |\n|----------|---------|----------|---------|\n| `empty` | Cloudflare Workers | D1 | `quickback create empty my-app` |\n\nAlias: `quickback create scaffold my-app` (same as `empty`)\n\n## Create the Project\n\n```bash\nquickback create empty my-app\n```\n\nThis scaffolds a minimal project:\n\n```\nmy-app/\n├── quickback/\n│ ├── quickback.config.ts # Compiler configuration\n│ └── features/ # Empty — add your own\n├── package.json\n└── tsconfig.json\n```\n\n## Generated Configuration\n\n```typescript\nexport default {\n name: \"my-app\",\n template: \"hono\",\n features: {\n organizations: true,\n },\n providers: {\n runtime: { name: \"cloudflare\", config: {} },\n database: {\n name: \"cloudflare-d1\",\n config: { binding: \"DB\" },\n },\n auth: { name: \"better-auth\", config: {} },\n },\n};\n```\n\nMulti-tenant mode (`organizations: true`) is the default. Change to `organizations: false` for [single-tenant mode](/compiler/config/single-tenant).\n\n## Adding Your First Feature\n\nCreate a feature directory with a schema file:\n\n```bash\nmkdir -p quickback/features/products\n```\n\n```typescript\n// quickback/features/products/products.ts\n\nexport const products = sqliteTable(\"products\", {\n id: text(\"id\").primaryKey(),\n name: text(\"name\").notNull(),\n description: text(\"description\"),\n price: integer(\"price\").notNull(),\n organizationId: text(\"organization_id\").notNull(),\n userId: text(\"user_id\").notNull(),\n});\n\nexport default defineTable(products, {\n firewall: {\n organization: {},\n owner: {
|
|
154
|
+
"content": "The `empty` template creates a project with only the configuration file — no example features. Use this when you know exactly what you want to build and don't need starter code.\n\n## Available Empty Templates\n\n| Template | Runtime | Database | Command |\n|----------|---------|----------|---------|\n| `empty` | Cloudflare Workers | D1 | `quickback create empty my-app` |\n\nAlias: `quickback create scaffold my-app` (same as `empty`)\n\n## Create the Project\n\n```bash\nquickback create empty my-app\n```\n\nThis scaffolds a minimal project:\n\n```\nmy-app/\n├── quickback/\n│ ├── quickback.config.ts # Compiler configuration\n│ └── features/ # Empty — add your own\n├── package.json\n└── tsconfig.json\n```\n\n## Generated Configuration\n\n```typescript\nexport default {\n name: \"my-app\",\n template: \"hono\",\n features: {\n organizations: true,\n },\n providers: {\n runtime: { name: \"cloudflare\", config: {} },\n database: {\n name: \"cloudflare-d1\",\n config: { binding: \"DB\" },\n },\n auth: { name: \"better-auth\", config: {} },\n },\n};\n```\n\nMulti-tenant mode (`organizations: true`) is the default. Change to `organizations: false` for [single-tenant mode](/compiler/config/single-tenant).\n\n## Adding Your First Feature\n\nCreate a feature directory with a schema file:\n\n```bash\nmkdir -p quickback/features/products\n```\n\n```typescript\n// quickback/features/products/products.ts\n\nexport const products = sqliteTable(\"products\", {\n id: text(\"id\").primaryKey(),\n name: text(\"name\").notNull(),\n description: text(\"description\"),\n price: integer(\"price\").notNull(),\n organizationId: text(\"organization_id\").notNull(),\n userId: text(\"user_id\").notNull(),\n});\n\nexport default defineTable(products, {\n firewall: {\n organization: {},\n owner: {},\n softDelete: {},\n },\n guards: {\n createable: [\"name\", \"description\", \"price\"],\n updatable: [\"name\", \"description\", \"price\"],\n },\n read: {\n access: { roles: [\"member+\"] },\n },\n crud: {\n create: { access: { roles: [\"member+\"] } },\n update: { access: { roles: [\"member+\"] } },\n delete: { access: { roles: [\"admin+\"] }, mode: \"soft\" },\n },\n});\n```\n\nThen compile:\n\n```bash\nquickback login # First time only\nquickback compile\n```\n\n## Setup Steps\n\nFollow the same setup steps as the [Cloudflare template](/compiler/getting-started/template-cloudflare#setup-steps). The only difference is you'll need to add at least one feature before compiling.\n\n## Next Steps\n\n- [Schema Definitions](/compiler/definitions/schema) — Define tables with Drizzle ORM\n- [Firewall](/compiler/definitions/firewall) — Data isolation and tenant scoping\n- [Access Control](/compiler/definitions/access) — Role-based permissions\n- [Guards](/compiler/definitions/guards) — Field-level write protection\n- [Full Example](/compiler/getting-started/full-example) — Complete feature walkthrough"
|
|
155
155
|
},
|
|
156
156
|
"compiler/getting-started/templates": {
|
|
157
157
|
"title": "Templates",
|
|
@@ -403,7 +403,7 @@ export const DOCS = {
|
|
|
403
403
|
},
|
|
404
404
|
"stack/cms/security": {
|
|
405
405
|
"title": "Security",
|
|
406
|
-
"content": "# Security\n\nThe CMS respects all four Quickback security layers. Every UI element — buttons, form fields, table columns, action menus — adapts based on the current user's role and the security rules defined in your feature files.\n\n## CMS Access (admin-only by default)\n\nThe CMS is restricted to Better Auth platform admins (`user.role === \"admin\"`) by default — non-admin authenticated users are redirected to `/account/profile`. To allow any authenticated user, opt out explicitly:\n\n```typescript\ncms: { access: \"user\" }\n```\n\nUnder the default `access: \"admin\"`, the compiler emits server-side gates on every CMS-facing surface so a non-admin can't reach the CMS even by bypassing the SPA:\n\n1. **Account UI** — the \"Go to CMS\" button is hidden.\n2. **CMS SPA shell** — the Worker checks `ctx.userRole === \"admin\"` before serving `index.html`. Unauthenticated requests are redirected to login; authenticated non-admins get `403 Admin access required`.\n3. **`/api/v1/schema`** — the CMS metadata endpoint returns `403` to non-admins.\n4. **`custom_view` CRUD** — the CMS-internal saved-views table uses `userRole: [\"admin\"]` (see [`userRole`](/compiler/definitions/access#userrole-vs-roles)), so saved views can't be read or modified from outside the CMS by non-admin accounts.\n5. **In-SPA gate** — if any earlier layer is bypassed, the SPA still redirects the user to `/account/profile`.\n\nYour resource CRUD endpoints keep whatever `crud.access.roles` you defined — they're the app's data API and unaffected by the CMS gate.\n\n## The Four Layers\n\nQuickback enforces security through four complementary layers:\n\n| Layer | Purpose | CMS Behavior |\n|-------|---------|-------------|\n| **Firewall** | Tenant isolation (org-scoped data) | Handled server-side. CMS cannot bypass it. |\n| **CRUD Access** | Per-operation role requirements | Buttons hidden when role lacks permission |\n| **Guards** | Field-level create/update control | Form fields enabled/disabled per guard rules |\n| **Masking** | Sensitive field redaction | Masked values with lock icons per role |\n\n## Role-Based Access\n\nThe CMS header includes a **role switcher** (in demo mode) or reads the user's actual role from their organization membership (in live mode). The three roles are:\n\n- **owner** — Full access to all operations and data\n- **admin** — Elevated access, typically all CRUD and most actions\n- **member** — Standard access with restrictions on sensitive data and destructive actions\n\n### CRUD Button Visibility\n\nCRUD operation buttons are shown or hidden based on the current role's access:\n\n```typescript\ncrud: {\n create: { access: { roles: ['admin', 'owner'] } },\n read: { access: { roles: ['member', 'admin', 'owner'] } },\n update: { access: { roles: ['admin', 'owner'] } },\n delete: { access: { roles: ['owner'] } },\n}\n```\n\nWith the config above:\n\n- **Members** see the table (read) but no Create, Edit, or Delete buttons\n- **Admins** see Create and Edit buttons but no Delete\n- **Owners** see all buttons\n\nThe row action menu also adapts — Edit and Delete entries only appear when the role has the corresponding permission.\n\n## Guards\n\nGuards control which fields appear in create and edit forms, and which cells are editable in Data Table mode.\n\n### Createable Fields\n\nFields listed in `guards.createable` appear in the create form. Fields not in this list are hidden from the form entirely:\n\n```typescript\nguards: {\n createable: ['name', 'email', 'phone', 'status'],\n}\n```\n\n### Updatable Fields\n\nFields listed in `guards.updatable` are editable in the edit form and in Data Table inline editing:\n\n```typescript\nguards: {\n updatable: ['name', 'email', 'phone'],\n}\n```\n\n### Immutable Fields\n\nFields in `guards.immutable` can be set during creation but cannot be changed afterward. In edit mode, they appear as disabled inputs with a lock icon:\n\n```typescript\nguards: {\n immutable: ['accountCode', 'type'],\n}\n```\n\n### Protected Fields\n\nFields in `guards.protected` can only be updated via specific actions. They appear as disabled inputs with the message \"Updated via actions only\":\n\n```typescript\nguards: {\n protected: {\n status: ['approve', 'void'], // Updated by approve or void actions\n balance: ['applyPayment'], // Updated by applyPayment action\n },\n}\n```\n\n## Masking\n\nMasking rules redact sensitive data based on the user's role. The CMS applies masking client-side for display and the API enforces it server-side in responses.\n\n### Masking Types\n\n| Type | Example Input | Masked Output |\n|------|--------------|---------------|\n| `email` | `john@acme.com` | `j***@acme.com` |\n| `phone` | `(555) 123-4567` | `***-***-4567` |\n| `ssn` | `123-45-6789` | `***-**-6789` |\n| `redact` | `Confidential notes` | `------` |\n\n### Configuration\n\n```typescript\nmasking: {\n email: { type: 'email', show: { roles: ['admin', 'owner'] } },\n phone: { type: 'phone', show: { roles: ['admin', 'owner'] } },\n ssn: { type: 'ssn', show: { roles: ['owner'] } },\n}\n```\n\nWith the above config:\n\n- **Members** see masked values for email, phone, and SSN\n- **Admins** see unmasked email and phone, but masked SSN\n- **Owners** see all values unmasked\n\n### Visual Indicator\n\nMasked fields display a lock icon next to the redacted value, making it clear that the field contains hidden data:\n\n```\nEmail: [lock] j***@acme.com\nSSN: [lock] ***-**-6789\n```\n\n## Views\n\nViews provide column-level projections per role. Only authorized views appear in the toolbar dropdown.\n\n```typescript\nread: {\n views: {\n summary: {\n fields: ['id', 'name', 'status'],\n access: { roles: ['member', 'admin', 'owner'] },\n },\n financial: {\n fields: ['id', 'name', 'balance', 'creditLimit', 'paymentTerms'],\n access: { roles: ['admin', 'owner'] },\n },\n },\n}\n```\n\nMembers only see the \"summary\" view option. Admins and owners see both \"summary\" and \"financial\". The \"All Fields\" option is always available.\n\n## Firewall\n\nThe firewall layer handles tenant isolation — ensuring users can only access data within their organization. This is enforced entirely server-side:\n\n- `organization_id` columns are filtered automatically by the API\n- `owner`
|
|
406
|
+
"content": "# Security\n\nThe CMS respects all four Quickback security layers. Every UI element — buttons, form fields, table columns, action menus — adapts based on the current user's role and the security rules defined in your feature files.\n\n## CMS Access (admin-only by default)\n\nThe CMS is restricted to Better Auth platform admins (`user.role === \"admin\"`) by default — non-admin authenticated users are redirected to `/account/profile`. To allow any authenticated user, opt out explicitly:\n\n```typescript\ncms: { access: \"user\" }\n```\n\nUnder the default `access: \"admin\"`, the compiler emits server-side gates on every CMS-facing surface so a non-admin can't reach the CMS even by bypassing the SPA:\n\n1. **Account UI** — the \"Go to CMS\" button is hidden.\n2. **CMS SPA shell** — the Worker checks `ctx.userRole === \"admin\"` before serving `index.html`. Unauthenticated requests are redirected to login; authenticated non-admins get `403 Admin access required`.\n3. **`/api/v1/schema`** — the CMS metadata endpoint returns `403` to non-admins.\n4. **`custom_view` CRUD** — the CMS-internal saved-views table uses `userRole: [\"admin\"]` (see [`userRole`](/compiler/definitions/access#userrole-vs-roles)), so saved views can't be read or modified from outside the CMS by non-admin accounts.\n5. **In-SPA gate** — if any earlier layer is bypassed, the SPA still redirects the user to `/account/profile`.\n\nYour resource CRUD endpoints keep whatever `crud.access.roles` you defined — they're the app's data API and unaffected by the CMS gate.\n\n## The Four Layers\n\nQuickback enforces security through four complementary layers:\n\n| Layer | Purpose | CMS Behavior |\n|-------|---------|-------------|\n| **Firewall** | Tenant isolation (org-scoped data) | Handled server-side. CMS cannot bypass it. |\n| **CRUD Access** | Per-operation role requirements | Buttons hidden when role lacks permission |\n| **Guards** | Field-level create/update control | Form fields enabled/disabled per guard rules |\n| **Masking** | Sensitive field redaction | Masked values with lock icons per role |\n\n## Role-Based Access\n\nThe CMS header includes a **role switcher** (in demo mode) or reads the user's actual role from their organization membership (in live mode). The three roles are:\n\n- **owner** — Full access to all operations and data\n- **admin** — Elevated access, typically all CRUD and most actions\n- **member** — Standard access with restrictions on sensitive data and destructive actions\n\n### CRUD Button Visibility\n\nCRUD operation buttons are shown or hidden based on the current role's access:\n\n```typescript\ncrud: {\n create: { access: { roles: ['admin', 'owner'] } },\n read: { access: { roles: ['member', 'admin', 'owner'] } },\n update: { access: { roles: ['admin', 'owner'] } },\n delete: { access: { roles: ['owner'] } },\n}\n```\n\nWith the config above:\n\n- **Members** see the table (read) but no Create, Edit, or Delete buttons\n- **Admins** see Create and Edit buttons but no Delete\n- **Owners** see all buttons\n\nThe row action menu also adapts — Edit and Delete entries only appear when the role has the corresponding permission.\n\n## Guards\n\nGuards control which fields appear in create and edit forms, and which cells are editable in Data Table mode.\n\n### Createable Fields\n\nFields listed in `guards.createable` appear in the create form. Fields not in this list are hidden from the form entirely:\n\n```typescript\nguards: {\n createable: ['name', 'email', 'phone', 'status'],\n}\n```\n\n### Updatable Fields\n\nFields listed in `guards.updatable` are editable in the edit form and in Data Table inline editing:\n\n```typescript\nguards: {\n updatable: ['name', 'email', 'phone'],\n}\n```\n\n### Immutable Fields\n\nFields in `guards.immutable` can be set during creation but cannot be changed afterward. In edit mode, they appear as disabled inputs with a lock icon:\n\n```typescript\nguards: {\n immutable: ['accountCode', 'type'],\n}\n```\n\n### Protected Fields\n\nFields in `guards.protected` can only be updated via specific actions. They appear as disabled inputs with the message \"Updated via actions only\":\n\n```typescript\nguards: {\n protected: {\n status: ['approve', 'void'], // Updated by approve or void actions\n balance: ['applyPayment'], // Updated by applyPayment action\n },\n}\n```\n\n## Masking\n\nMasking rules redact sensitive data based on the user's role. The CMS applies masking client-side for display and the API enforces it server-side in responses.\n\n### Masking Types\n\n| Type | Example Input | Masked Output |\n|------|--------------|---------------|\n| `email` | `john@acme.com` | `j***@acme.com` |\n| `phone` | `(555) 123-4567` | `***-***-4567` |\n| `ssn` | `123-45-6789` | `***-**-6789` |\n| `redact` | `Confidential notes` | `------` |\n\n### Configuration\n\n```typescript\nmasking: {\n email: { type: 'email', show: { roles: ['admin', 'owner'] } },\n phone: { type: 'phone', show: { roles: ['admin', 'owner'] } },\n ssn: { type: 'ssn', show: { roles: ['owner'] } },\n}\n```\n\nWith the above config:\n\n- **Members** see masked values for email, phone, and SSN\n- **Admins** see unmasked email and phone, but masked SSN\n- **Owners** see all values unmasked\n\n### Visual Indicator\n\nMasked fields display a lock icon next to the redacted value, making it clear that the field contains hidden data:\n\n```\nEmail: [lock] j***@acme.com\nSSN: [lock] ***-**-6789\n```\n\n## Views\n\nViews provide column-level projections per role. Only authorized views appear in the toolbar dropdown.\n\n```typescript\nread: {\n views: {\n summary: {\n fields: ['id', 'name', 'status'],\n access: { roles: ['member', 'admin', 'owner'] },\n },\n financial: {\n fields: ['id', 'name', 'balance', 'creditLimit', 'paymentTerms'],\n access: { roles: ['admin', 'owner'] },\n },\n },\n}\n```\n\nMembers only see the \"summary\" view option. Admins and owners see both \"summary\" and \"financial\". The \"All Fields\" option is always available.\n\n## Firewall\n\nThe firewall layer handles tenant isolation — ensuring users can only access data within their organization. This is enforced entirely server-side:\n\n- `organization_id` columns are filtered automatically by the API\n- `owner` predicates restrict records to the creating user\n- The CMS never sees data outside the user's organization scope\n\nThe CMS does not display firewall config in its UI because there is nothing for the user to control. Tenant isolation is transparent and automatic.\n\n## Actions\n\nAction visibility is controlled by access conditions on each action:\n\n```typescript\nactions: {\n approve: {\n access: {\n roles: ['admin', 'owner'],\n record: { status: { equals: 'pending' } },\n },\n cms: { destructive: true, confirm: true },\n },\n}\n```\n\nThe CMS evaluates both the role requirement and the record condition. In this example, the \"Approve\" action only appears for admins and owners, and only on records where `status === \"pending\"`.\n\nDestructive actions (`cms.destructive: true`, or named `void`/`delete`) receive special warning styling with red text and an alert icon. Actions with `cms.hidden: true` are hidden from the CMS entirely (API-only).\n\n## Next Steps\n\n- **[Actions](/stack/cms/actions)** — Action dialogs and input forms\n- **[Table Views](/stack/cms/table-views)** — View projections and toolbar\n- **[Inline Editing](/stack/cms/inline-editing)** — How guards affect editability"
|
|
407
407
|
},
|
|
408
408
|
"stack/cms/table-views": {
|
|
409
409
|
"title": "Table Views",
|
|
@@ -427,7 +427,7 @@ export const DOCS = {
|
|
|
427
427
|
},
|
|
428
428
|
"stack/realtime/durable-objects": {
|
|
429
429
|
"title": "Realtime",
|
|
430
|
-
"content": "Quickback can generate realtime notification helpers for broadcasting changes to connected clients. This enables live updates via WebSocket using Cloudflare Durable Objects.\n\n## Enabling Realtime\n\nAdd `realtime` configuration to individual table definitions:\n\n```typescript\n// features/applications/applications.ts\n\nexport const applications = sqliteTable(\"applications\", {\n id: text(\"id\").primaryKey(),\n candidateId: text(\"candidate_id\").notNull(),\n jobId: text(\"job_id\").notNull(),\n stage: text(\"stage\").notNull(),\n organizationId: text(\"organization_id\").notNull(),\n});\n\nexport default defineTable(applications, {\n firewall: [{ field: 'organizationId', equals: 'ctx.activeOrgId' }],\n realtime: {\n enabled: true, // Enable realtime for this table\n onInsert: true, // Broadcast on INSERT (default: true)\n onUpdate: true, // Broadcast on UPDATE (default: true)\n onDelete: true, // Broadcast on DELETE (default: true)\n requiredRoles: [\"recruiter\", \"hiring-manager\"], // Who receives broadcasts\n fields: [\"id\", \"candidateId\", \"stage\"], // Fields to include (optional)\n },\n // ... guards, crud\n});\n```\n\nWhen any table has realtime enabled, the compiler generates `src/lib/realtime.ts` with helper functions for sending notifications.\n\n## Generated Helper\n\nThe `createRealtime()` factory provides convenient methods for both Postgres Changes (CRUD events) and custom broadcasts:\n\n```typescript\n\nexport const execute: ActionExecutor = async ({ db, ctx, input }) => {\n const realtime = createRealtime(ctx.env);\n\n // After creating a record\n await realtime.insert('applications', newApplication, ctx.activeOrgId!);\n\n // After updating a record\n await realtime.update('applications', newApplication, oldApplication, ctx.activeOrgId!);\n\n // After deleting a record\n await realtime.delete('applications', { id: applicationId }, ctx.activeOrgId!);\n\n return { success: true };\n};\n```\n\n## Event Format\n\nQuickback broadcasts events in a structured JSON format for easy client-side handling.\n\n### Insert Event\n\n```typescript\nawait realtime.insert('applications', {\n id: 'app_123',\n candidateId: 'cnd_456',\n stage: 'applied'\n}, ctx.activeOrgId!);\n```\n\nBroadcasts:\n```json\n{\n \"type\": \"postgres_changes\",\n \"table\": \"applications\",\n \"eventType\": \"INSERT\",\n \"schema\": \"public\",\n \"new\": {\n \"id\": \"app_123\",\n \"candidateId\": \"cnd_456\",\n \"stage\": \"applied\"\n },\n \"old\": null\n}\n```\n\n### Update Event\n\n```typescript\nawait realtime.update('applications',\n { id: 'app_123', stage: 'interview' }, // new\n { id: 'app_123', stage: 'screening' }, // old\n ctx.activeOrgId!\n);\n```\n\nBroadcasts:\n```json\n{\n \"type\": \"postgres_changes\",\n \"table\": \"applications\",\n \"eventType\": \"UPDATE\",\n \"schema\": \"public\",\n \"new\": { \"id\": \"app_123\", \"stage\": \"interview\" },\n \"old\": { \"id\": \"app_123\", \"stage\": \"screening\" }\n}\n```\n\n### Delete Event\n\n```typescript\nawait realtime.delete('applications',\n { id: 'app_123' },\n ctx.activeOrgId!\n);\n```\n\nBroadcasts:\n```json\n{\n \"type\": \"postgres_changes\",\n \"table\": \"applications\",\n \"eventType\": \"DELETE\",\n \"schema\": \"public\",\n \"new\": null,\n \"old\": { \"id\": \"app_123\" }\n}\n```\n\n## Custom Broadcasts\n\nFor arbitrary events that don't map to CRUD operations:\n\n```typescript\nawait realtime.broadcast('screening-complete', {\n applicationId: 'app_123',\n candidateId: 'cnd_456',\n stage: 'interview'\n}, ctx.activeOrgId!);\n```\n\nBroadcasts:\n```json\n{\n \"type\": \"broadcast\",\n \"event\": \"screening-complete\",\n \"payload\": {\n \"applicationId\": \"app_123\",\n \"candidateId\": \"cnd_456\",\n \"stage\": \"interview\"\n }\n}\n```\n\n## User-Specific Broadcasts\n\nTarget a specific user instead of the entire organization:\n\n```typescript\n// Only this user receives the notification\nawait realtime.insert('notifications', newNotification, ctx.activeOrgId!, {\n userId: ctx.userId\n});\n\n// Notify a hiring manager of a new application\nawait realtime.broadcast('application-received', {\n applicationId: 'app_123',\n jobId: 'job_789'\n}, ctx.activeOrgId!, {\n userId: hiringManagerId\n});\n```\n\n## Role-Based Filtering\n\nLimit which roles receive a broadcast using `targetRoles`:\n\n```typescript\n// Only hiring managers and recruiters receive this broadcast\nawait realtime.insert('applications', application, ctx.activeOrgId!, {\n targetRoles: ['hiring-manager', 'recruiter']\n});\n\n// Interviewers only see applications assigned to them\nawait realtime.update('applications', newRecord, oldRecord, ctx.activeOrgId!, {\n targetRoles: ['hiring-manager']\n});\n```\n\nIf `targetRoles` is not specified, all authenticated users in the organization receive the broadcast.\n\n## Per-Role Field Masking\n\nApply different field masking based on the subscriber's role using `maskingConfig`:\n\n```typescript\nawait realtime.insert('candidates', newCandidate, ctx.activeOrgId!, {\n maskingConfig: {\n phone: { type: 'phone', show: { roles: ['owner', 'hiring-manager', 'recruiter'] } },\n email: { type: 'email', show: { roles: ['owner', 'hiring-manager', 'recruiter'] } },\n resumeUrl: { type: 'redact', show: { roles: ['owner', 'hiring-manager', 'recruiter'] } },\n },\n});\n```\n\n**How masking works:**\n- Each subscriber receives a payload masked according to their role\n- Roles in the `show.roles` array see unmasked values\n- All other roles see the masked version\n- Masking is pre-computed per-role (O(roles) not O(subscribers))\n\n**Available mask types:**\n| Type | Example Output |\n|------|----------------|\n| `email` | `j***@y*********.com` |\n| `phone` | `******4567` |\n| `ssn` | `*****6789` |\n| `creditCard` | `**** **** **** 1111` |\n| `name` | `J***` |\n| `redact` | `[REDACTED]` |\n\n### Owner-Based Masking\n\nShow unmasked data to the record owner:\n\n```typescript\nmaskingConfig: {\n phone: {\n type: 'phone',\n show: { roles: ['hiring-manager'], or: 'owner' } // Hiring manager OR owner sees unmasked\n },\n}\n```\n\n## Client-Side Subscription\n\n### WebSocket Authentication\n\nQuickback uses **ticket-based authentication** for WebSocket connections. The client first obtains a short-lived ticket from the main API, then connects with it as a URL parameter. The Broadcaster verifies the ticket cryptographically at upgrade time — no HTTP round-trip needed.\n\n```typescript\n// 1. Get a ws-ticket from your API (requires session auth)\nconst response = await fetch('/broadcast/v1/ws-ticket', {\n method: 'POST',\n headers: { Authorization: `Bearer ${sessionToken}` },\n});\nconst { wsTicket } = await response.json();\n\n// 2. Connect with ticket as URL param\nconst ws = new WebSocket(\n `wss://api.yourdomain.com/broadcast/v1/websocket?ws_ticket=${wsTicket}&organizationId=${activeOrgId}`\n);\n\nws.onopen = () => {\n console.log('Connected and authenticated!');\n // No auth message needed — pre-authenticated at upgrade\n};\n```\n\nTickets expire after 60 seconds, so fetch a fresh one before each connection or reconnection.\n\n### Handling Messages\n\n```typescript\nws.onmessage = (event) => {\n const msg = JSON.parse(event.data);\n\n // Handle CRUD events\n if (msg.type === 'postgres_changes') {\n const { table, eventType, new: newRecord, old: oldRecord } = msg;\n\n if (eventType === 'INSERT') {\n addRecord(table, newRecord);\n } else if (eventType === 'UPDATE') {\n updateRecord(table, newRecord);\n } else if (eventType === 'DELETE') {\n removeRecord(table, oldRecord.id);\n }\n }\n\n // Handle custom broadcasts\n if (msg.type === 'broadcast') {\n const { event, payload } = msg;\n\n if (event === 'screening-complete') {\n refreshApplication(payload.applicationId);\n } else if (event === 'interview-scheduled') {\n showInterviewNotification(payload.applicationId);\n }\n }\n};\n```\n\n## Environment\n\nNo additional environment variables are needed for realtime. The Broadcaster DO runs inline in your main worker and uses `BETTER_AUTH_SECRET` (already required for auth) to sign and verify WebSocket tickets.\n\n| Variable | Description |\n|----------|-------------|\n| `BETTER_AUTH_SECRET` | Signs/verifies WebSocket tickets (already set for auth) |\n\nThe `BROADCASTER` binding is a `DurableObjectNamespace` — the compiler generates this in your `wrangler.toml` automatically:\n\n```toml\n[[durable_objects.bindings]]\nname = \"BROADCASTER\"\nclass_name = \"Broadcaster\"\n\n[[migrations]]\ntag = \"v1\"\nnew_classes = [\"Broadcaster\"]\n```\n\n## Architecture\n\n```\n 1. POST /ws-ticket\n┌───────────────────────────────────────────────┐ ┌─────────────────┐\n│ Quickback Worker │ ◄──│ Browser Client │\n│ │ ──►│ │\n│ ┌──────────┐ DO binding ┌────────────────┐ │ └───────┬─────────┘\n│ │ Hono API │ ───────────► │ Broadcaster DO │ │ │\n│ └──────────┘ (in-process)└───────┬────────┘ │ 2. WS ?ws_ticket=...\n│ │ │ │\n└────────────────────────────────────┼──────────┘ │\n │◄──────────────────────┘\n WebSocket (verified at upgrade)\n```\n\n1. **Client gets a ticket** — `POST /broadcast/v1/ws-ticket` on the main API (session-authenticated). Returns a 60-second HMAC-signed ticket.\n2. **Client connects** — Opens WebSocket with `?ws_ticket=<ticket>`. The Durable Object verifies the ticket cryptographically at upgrade — no HTTP round-trip.\n3. **API broadcasts** — After CRUD ops, the API calls the Broadcaster DO directly via its binding (in-process, no network hop).\n\n## Best Practices\n\n### Broadcast After Commit\n\nAlways broadcast after the database operation succeeds:\n\n```typescript\n// Good - broadcast after successful insert\nconst [newApp] = await db.insert(applications).values(data).returning();\nawait realtime.insert('applications', newApp, ctx.activeOrgId!);\n\n// Bad - don't broadcast before confirming success\nawait realtime.insert('applications', data, ctx.activeOrgId!);\nawait db.insert(applications).values(data); // Could fail!\n```\n\n### Minimal Payloads\n\nOnly include necessary data in broadcasts:\n\n```typescript\n// Good - minimal payload\nawait realtime.update('applications',\n { id: record.id, stage: 'interview' },\n { id: record.id, stage: 'screening' },\n ctx.activeOrgId!\n);\n\n// Avoid - sending entire record with large content\nawait realtime.update('applications', fullRecord, oldRecord, ctx.activeOrgId!);\n```\n\n### Use Broadcasts for Complex Events\n\nFor events that don't map cleanly to CRUD:\n\n```typescript\n// Hiring pipeline stage completed\nawait realtime.broadcast('pipeline-stage-complete', {\n applicationId: application.id,\n stages: ['applied', 'screening', 'interview'],\n currentStage: 'offer',\n candidateId: application.candidateId\n}, ctx.activeOrgId!);\n```\n\n## Custom Event Namespaces\n\nFor complex applications with many custom events, you can define typed event namespaces using `defineRealtime`. This generates strongly-typed helper methods for your custom events.\n\n### Defining Event Namespaces\n\nCreate a file in `services/realtime/`:\n\n```typescript\n// services/realtime/screening.ts\n\nexport default defineRealtime({\n name: 'screening',\n events: ['started', 'progress', 'completed', 'failed'],\n description: 'Candidate screening pipeline events',\n});\n```\n\n### Generated Helper Methods\n\nAfter compilation, the `createRealtime()` helper includes your custom namespace:\n\n```typescript\n\nexport const execute: ActionExecutor = async ({ ctx, input }) => {\n const realtime = createRealtime(ctx.env);\n\n // Type-safe custom event methods\n await realtime.screening.started({\n applicationId: input.applicationId,\n }, ctx.activeOrgId!);\n\n // Progress updates\n await realtime.screening.progress({\n applicationId: input.applicationId,\n percent: 50,\n step: 'background-check',\n }, ctx.activeOrgId!);\n\n // Completion\n await realtime.screening.completed({\n applicationId: input.applicationId,\n result: 'passed',\n duration: 1234,\n }, ctx.activeOrgId!);\n\n return { success: true };\n};\n```\n\n### Event Format\n\nCustom namespace events use the `broadcast` type with namespaced event names:\n\n```json\n{\n \"type\": \"broadcast\",\n \"event\": \"screening:started\",\n \"payload\": {\n \"applicationId\": \"app_123\"\n }\n}\n```\n\n### Multiple Namespaces\n\nDefine multiple namespaces for different parts of your application:\n\n```typescript\n// services/realtime/notifications.ts\nexport default defineRealtime({\n name: 'notifications',\n events: ['interview-reminder', 'offer-update', 'application-received'],\n description: 'Recruitment notification events',\n});\n\n// services/realtime/presence.ts\nexport default defineRealtime({\n name: 'presence',\n events: ['joined', 'left', 'reviewing', 'idle'],\n description: 'Who is reviewing which candidate',\n});\n```\n\nUsage:\n```typescript\nconst realtime = createRealtime(ctx.env);\n\n// Notification events\nawait realtime.notifications['interview-reminder']({ ... }, ctx.activeOrgId!);\n\n// Presence events — who's reviewing which candidate\nawait realtime.presence.reviewing({ userId: ctx.userId, candidateId: 'cnd_456' }, ctx.activeOrgId!);\n```\n\n### Namespace vs Generic Broadcast\n\n| Use Case | Approach |\n|----------|----------|\n| One-off custom event | `realtime.broadcast('event-name', payload, orgId)` |\n| Repeated event patterns | `defineRealtime` namespace |\n| Type-safe events | `defineRealtime` namespace |\n| Event discovery | `defineRealtime` (appears in generated types) |"
|
|
430
|
+
"content": "Quickback can generate realtime notification helpers for broadcasting changes to connected clients. This enables live updates via WebSocket using Cloudflare Durable Objects.\n\n## Enabling Realtime\n\nAdd `realtime` configuration to individual table definitions:\n\n```typescript\n// features/applications/applications.ts\n\nexport const applications = sqliteTable(\"applications\", {\n id: text(\"id\").primaryKey(),\n candidateId: text(\"candidate_id\").notNull(),\n jobId: text(\"job_id\").notNull(),\n stage: text(\"stage\").notNull(),\n organizationId: text(\"organization_id\").notNull(),\n});\n\nexport default defineTable(applications, {\n firewall: [{ field: 'organizationId', equals: 'ctx.activeOrgId' }],\n realtime: {\n enabled: true, // Enable realtime for this table\n onInsert: true, // Broadcast on INSERT (default: true)\n onUpdate: true, // Broadcast on UPDATE (default: true)\n onDelete: true, // Broadcast on DELETE (default: true)\n requiredRoles: [\"recruiter\", \"hiring-manager\"], // Who receives broadcasts\n fields: [\"id\", \"candidateId\", \"stage\"], // Fields to include (optional)\n },\n // ... guards, crud\n});\n```\n\nWhen any table has realtime enabled, the compiler generates `src/lib/realtime.ts` with helper functions for sending notifications.\n\n## When auto-broadcast fires (and when you call it manually)\n\nQuickback emits auto-broadcasts in **only one place**: the generated CRUD route handlers (`POST /` create, `PATCH /:id` update, `DELETE /:id` delete) for resources with `realtime.enabled` (or covered by `dbConfig.realtime: true`'s project-level default). Those handlers wrap each successful write with a `realtime.insert / update / delete` call before responding.\n\nEverywhere else — action handlers, queue consumers, scheduled jobs, custom Hono routes — you broadcast manually via the `createRealtime(env)` helper described below.\n\n| Mutation site | Auto-broadcast? | Why |\n|---|---|---|\n| Generated CRUD route (`POST /`, `PATCH /:id`, `DELETE /:id`) | Yes | The compiler emits the call after the write returns. |\n| Generated batch route (`/batch/...`) | Yes | Same pattern, emitted per record. |\n| `scoped.insert/update/delete` inside an action handler | No — manual | Scoped-db is a query-shape wrapper (firewall + soft-delete WHERE injection). It deliberately has no side-effects so explicit handlers can write multiple records, conditionally roll back, etc. without surprise broadcasts. |\n| `unsafeDb` writes in actions (or any custom route) | No — manual | Same reasoning — `unsafeDb` is the un-wrapped escape hatch. |\n| Queue consumers, cron jobs, webhook handlers | No — manual | These run outside the CRUD path entirely. |\n\nThe rule of thumb: if your code calls `db.insert(...)` / `scoped.insert(...)` directly, you also call `realtime.insert(...)` directly on the next line. Otherwise the cross-tab live-update you wired up in the SPA won't fire.\n\n## Generated Helper\n\nThe `createRealtime()` factory provides convenient methods for both Postgres Changes (CRUD events) and custom broadcasts:\n\n```typescript\n\nexport const execute: ActionExecutor = async ({ db, ctx, input }) => {\n const realtime = createRealtime(ctx.env);\n\n // After creating a record\n await realtime.insert('applications', newApplication, ctx.activeOrgId!);\n\n // After updating a record\n await realtime.update('applications', newApplication, oldApplication, ctx.activeOrgId!);\n\n // After deleting a record\n await realtime.delete('applications', { id: applicationId }, ctx.activeOrgId!);\n\n return { success: true };\n};\n```\n\n## Event Format\n\nQuickback broadcasts events in a structured JSON format for easy client-side handling.\n\n### Insert Event\n\n```typescript\nawait realtime.insert('applications', {\n id: 'app_123',\n candidateId: 'cnd_456',\n stage: 'applied'\n}, ctx.activeOrgId!);\n```\n\nBroadcasts:\n```json\n{\n \"type\": \"postgres_changes\",\n \"table\": \"applications\",\n \"eventType\": \"INSERT\",\n \"schema\": \"public\",\n \"new\": {\n \"id\": \"app_123\",\n \"candidateId\": \"cnd_456\",\n \"stage\": \"applied\"\n },\n \"old\": null\n}\n```\n\n### Update Event\n\n```typescript\nawait realtime.update('applications',\n { id: 'app_123', stage: 'interview' }, // new\n { id: 'app_123', stage: 'screening' }, // old\n ctx.activeOrgId!\n);\n```\n\nBroadcasts:\n```json\n{\n \"type\": \"postgres_changes\",\n \"table\": \"applications\",\n \"eventType\": \"UPDATE\",\n \"schema\": \"public\",\n \"new\": { \"id\": \"app_123\", \"stage\": \"interview\" },\n \"old\": { \"id\": \"app_123\", \"stage\": \"screening\" }\n}\n```\n\n### Delete Event\n\n```typescript\nawait realtime.delete('applications',\n { id: 'app_123' },\n ctx.activeOrgId!\n);\n```\n\nBroadcasts:\n```json\n{\n \"type\": \"postgres_changes\",\n \"table\": \"applications\",\n \"eventType\": \"DELETE\",\n \"schema\": \"public\",\n \"new\": null,\n \"old\": { \"id\": \"app_123\" }\n}\n```\n\n## Custom Broadcasts\n\nFor arbitrary events that don't map to CRUD operations:\n\n```typescript\nawait realtime.broadcast('screening-complete', {\n applicationId: 'app_123',\n candidateId: 'cnd_456',\n stage: 'interview'\n}, ctx.activeOrgId!);\n```\n\nBroadcasts:\n```json\n{\n \"type\": \"broadcast\",\n \"event\": \"screening-complete\",\n \"payload\": {\n \"applicationId\": \"app_123\",\n \"candidateId\": \"cnd_456\",\n \"stage\": \"interview\"\n }\n}\n```\n\n## User-Specific Broadcasts\n\nTarget a specific user instead of the entire organization:\n\n```typescript\n// Only this user receives the notification\nawait realtime.insert('notifications', newNotification, ctx.activeOrgId!, {\n userId: ctx.userId\n});\n\n// Notify a hiring manager of a new application\nawait realtime.broadcast('application-received', {\n applicationId: 'app_123',\n jobId: 'job_789'\n}, ctx.activeOrgId!, {\n userId: hiringManagerId\n});\n```\n\n## Role-Based Filtering\n\nLimit which roles receive a broadcast using `targetRoles`:\n\n```typescript\n// Only hiring managers and recruiters receive this broadcast\nawait realtime.insert('applications', application, ctx.activeOrgId!, {\n targetRoles: ['hiring-manager', 'recruiter']\n});\n\n// Interviewers only see applications assigned to them\nawait realtime.update('applications', newRecord, oldRecord, ctx.activeOrgId!, {\n targetRoles: ['hiring-manager']\n});\n```\n\nIf `targetRoles` is not specified, all authenticated users in the organization receive the broadcast.\n\n## Per-Role Field Masking\n\nApply different field masking based on the subscriber's role using `maskingConfig`:\n\n```typescript\nawait realtime.insert('candidates', newCandidate, ctx.activeOrgId!, {\n maskingConfig: {\n phone: { type: 'phone', show: { roles: ['owner', 'hiring-manager', 'recruiter'] } },\n email: { type: 'email', show: { roles: ['owner', 'hiring-manager', 'recruiter'] } },\n resumeUrl: { type: 'redact', show: { roles: ['owner', 'hiring-manager', 'recruiter'] } },\n },\n});\n```\n\n**How masking works:**\n- Each subscriber receives a payload masked according to their role\n- Roles in the `show.roles` array see unmasked values\n- All other roles see the masked version\n- Masking is pre-computed per-role (O(roles) not O(subscribers))\n\n**Available mask types:**\n| Type | Example Output |\n|------|----------------|\n| `email` | `j***@y*********.com` |\n| `phone` | `******4567` |\n| `ssn` | `*****6789` |\n| `creditCard` | `**** **** **** 1111` |\n| `name` | `J***` |\n| `redact` | `[REDACTED]` |\n\n### Owner-Based Masking\n\nShow unmasked data to the record owner:\n\n```typescript\nmaskingConfig: {\n phone: {\n type: 'phone',\n show: { roles: ['hiring-manager'], or: 'owner' } // Hiring manager OR owner sees unmasked\n },\n}\n```\n\n## Client-Side Subscription\n\n### WebSocket Authentication\n\nQuickback uses **ticket-based authentication** for WebSocket connections. The client first obtains a short-lived ticket from the main API, then connects with it as a URL parameter. The Broadcaster verifies the ticket cryptographically at upgrade time — no HTTP round-trip needed.\n\n```typescript\n// 1. Get a ws-ticket from your API (requires session auth)\nconst response = await fetch('/broadcast/v1/ws-ticket', {\n method: 'POST',\n headers: { Authorization: `Bearer ${sessionToken}` },\n});\nconst { wsTicket } = await response.json();\n\n// 2. Connect with ticket as URL param\nconst ws = new WebSocket(\n `wss://api.yourdomain.com/broadcast/v1/websocket?ws_ticket=${wsTicket}&organizationId=${activeOrgId}`\n);\n\nws.onopen = () => {\n console.log('Connected and authenticated!');\n // No auth message needed — pre-authenticated at upgrade\n};\n```\n\nTickets expire after 60 seconds, so fetch a fresh one before each connection or reconnection.\n\n### Handling Messages\n\n```typescript\nws.onmessage = (event) => {\n const msg = JSON.parse(event.data);\n\n // Handle CRUD events\n if (msg.type === 'postgres_changes') {\n const { table, eventType, new: newRecord, old: oldRecord } = msg;\n\n if (eventType === 'INSERT') {\n addRecord(table, newRecord);\n } else if (eventType === 'UPDATE') {\n updateRecord(table, newRecord);\n } else if (eventType === 'DELETE') {\n removeRecord(table, oldRecord.id);\n }\n }\n\n // Handle custom broadcasts\n if (msg.type === 'broadcast') {\n const { event, payload } = msg;\n\n if (event === 'screening-complete') {\n refreshApplication(payload.applicationId);\n } else if (event === 'interview-scheduled') {\n showInterviewNotification(payload.applicationId);\n }\n }\n};\n```\n\n## Environment\n\nNo additional environment variables are needed for realtime. The Broadcaster DO runs inline in your main worker and uses `BETTER_AUTH_SECRET` (already required for auth) to sign and verify WebSocket tickets.\n\n| Variable | Description |\n|----------|-------------|\n| `BETTER_AUTH_SECRET` | Signs/verifies WebSocket tickets (already set for auth) |\n\nThe `BROADCASTER` binding is a `DurableObjectNamespace` — the compiler generates this in your `wrangler.toml` automatically:\n\n```toml\n[[durable_objects.bindings]]\nname = \"BROADCASTER\"\nclass_name = \"Broadcaster\"\n\n[[migrations]]\ntag = \"v1\"\nnew_classes = [\"Broadcaster\"]\n```\n\n## Architecture\n\n```\n 1. POST /ws-ticket\n┌───────────────────────────────────────────────┐ ┌─────────────────┐\n│ Quickback Worker │ ◄──│ Browser Client │\n│ │ ──►│ │\n│ ┌──────────┐ DO binding ┌────────────────┐ │ └───────┬─────────┘\n│ │ Hono API │ ───────────► │ Broadcaster DO │ │ │\n│ └──────────┘ (in-process)└───────┬────────┘ │ 2. WS ?ws_ticket=...\n│ │ │ │\n└────────────────────────────────────┼──────────┘ │\n │◄──────────────────────┘\n WebSocket (verified at upgrade)\n```\n\n1. **Client gets a ticket** — `POST /broadcast/v1/ws-ticket` on the main API (session-authenticated). Returns a 60-second HMAC-signed ticket.\n2. **Client connects** — Opens WebSocket with `?ws_ticket=<ticket>`. The Durable Object verifies the ticket cryptographically at upgrade — no HTTP round-trip.\n3. **API broadcasts** — After CRUD ops, the API calls the Broadcaster DO directly via its binding (in-process, no network hop).\n\n## Best Practices\n\n### Broadcast After Commit\n\nAlways broadcast after the database operation succeeds:\n\n```typescript\n// Good - broadcast after successful insert\nconst [newApp] = await db.insert(applications).values(data).returning();\nawait realtime.insert('applications', newApp, ctx.activeOrgId!);\n\n// Bad - don't broadcast before confirming success\nawait realtime.insert('applications', data, ctx.activeOrgId!);\nawait db.insert(applications).values(data); // Could fail!\n```\n\n### Minimal Payloads\n\nOnly include necessary data in broadcasts:\n\n```typescript\n// Good - minimal payload\nawait realtime.update('applications',\n { id: record.id, stage: 'interview' },\n { id: record.id, stage: 'screening' },\n ctx.activeOrgId!\n);\n\n// Avoid - sending entire record with large content\nawait realtime.update('applications', fullRecord, oldRecord, ctx.activeOrgId!);\n```\n\n### Use Broadcasts for Complex Events\n\nFor events that don't map cleanly to CRUD:\n\n```typescript\n// Hiring pipeline stage completed\nawait realtime.broadcast('pipeline-stage-complete', {\n applicationId: application.id,\n stages: ['applied', 'screening', 'interview'],\n currentStage: 'offer',\n candidateId: application.candidateId\n}, ctx.activeOrgId!);\n```\n\n## Custom Event Namespaces\n\nFor complex applications with many custom events, you can define typed event namespaces using `defineRealtime`. This generates strongly-typed helper methods for your custom events.\n\n### Defining Event Namespaces\n\nCreate a file in `services/realtime/`:\n\n```typescript\n// services/realtime/screening.ts\n\nexport default defineRealtime({\n name: 'screening',\n events: ['started', 'progress', 'completed', 'failed'],\n description: 'Candidate screening pipeline events',\n});\n```\n\n### Generated Helper Methods\n\nAfter compilation, the `createRealtime()` helper includes your custom namespace:\n\n```typescript\n\nexport const execute: ActionExecutor = async ({ ctx, input }) => {\n const realtime = createRealtime(ctx.env);\n\n // Type-safe custom event methods\n await realtime.screening.started({\n applicationId: input.applicationId,\n }, ctx.activeOrgId!);\n\n // Progress updates\n await realtime.screening.progress({\n applicationId: input.applicationId,\n percent: 50,\n step: 'background-check',\n }, ctx.activeOrgId!);\n\n // Completion\n await realtime.screening.completed({\n applicationId: input.applicationId,\n result: 'passed',\n duration: 1234,\n }, ctx.activeOrgId!);\n\n return { success: true };\n};\n```\n\n### Event Format\n\nCustom namespace events use the `broadcast` type with namespaced event names:\n\n```json\n{\n \"type\": \"broadcast\",\n \"event\": \"screening:started\",\n \"payload\": {\n \"applicationId\": \"app_123\"\n }\n}\n```\n\n### Multiple Namespaces\n\nDefine multiple namespaces for different parts of your application:\n\n```typescript\n// services/realtime/notifications.ts\nexport default defineRealtime({\n name: 'notifications',\n events: ['interview-reminder', 'offer-update', 'application-received'],\n description: 'Recruitment notification events',\n});\n\n// services/realtime/presence.ts\nexport default defineRealtime({\n name: 'presence',\n events: ['joined', 'left', 'reviewing', 'idle'],\n description: 'Who is reviewing which candidate',\n});\n```\n\nUsage:\n```typescript\nconst realtime = createRealtime(ctx.env);\n\n// Notification events\nawait realtime.notifications['interview-reminder']({ ... }, ctx.activeOrgId!);\n\n// Presence events — who's reviewing which candidate\nawait realtime.presence.reviewing({ userId: ctx.userId, candidateId: 'cnd_456' }, ctx.activeOrgId!);\n```\n\n### Namespace vs Generic Broadcast\n\n| Use Case | Approach |\n|----------|----------|\n| One-off custom event | `realtime.broadcast('event-name', payload, orgId)` |\n| Repeated event patterns | `defineRealtime` namespace |\n| Type-safe events | `defineRealtime` namespace |\n| Event discovery | `defineRealtime` (appears in generated types) |"
|
|
431
431
|
},
|
|
432
432
|
"stack/realtime": {
|
|
433
433
|
"title": "Realtime",
|
package/dist/docs/content.js.map
CHANGED
|
@@ -1 +1 @@
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AwC;IACxC,oCAAoC;IACpC,wBAAwB;IACxB,kBAAkB;IAClB,gCAAgC;IAChC,6BAA6B;IAC7B,iCAAiC;IACjC,yBAAyB;IACzB,qBAAqB;IACrB,wBAAwB;IACxB,YAAY;IACZ,6BAA6B;IAC7B,+BAA+B;IAC/B,4BAA4B;IAC5B,+BAA+B;IAC/B,oBAAoB;IACpB,sCAAsC;IACtC,qBAAqB;IACrB,uBAAuB;IACvB,mBAAmB;IACnB,sBAAsB;IACtB,sBAAsB;IACtB,qBAAqB;IACrB,WAAW;IACX,0BAA0B;IAC1B,iBAAiB;IACjB,0BAA0B;IAC1B,yBAAyB;IACzB,2BAA2B;IAC3B,oBAAoB;IACpB,uBAAuB;IACvB,OAAO;IACP,uBAAuB;IACvB,cAAc;IACd,2BAA2B;IAC3B,gCAAgC;IAChC,gBAAgB;IAChB,kCAAkC;IAClC,+BAA+B;IAC/B,eAAe;IACf,kBAAkB;IAClB,kBAAkB;IAClB,wBAAwB;IACxB,wBAAwB;IACxB,yBAAyB;IACzB,cAAc;IACd,+BAA+B;IAC/B,wBAAwB;IACxB,gBAAgB;IAChB,yBAAyB;CAC1B,CAAC"}
|
|
1
|
+
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/docs/content.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,0DAA0D;AAO1D,MAAM,CAAC,MAAM,IAAI,GAA6B;IAC5C,WAAW,EAAE;QACX,OAAO,EAAE,WAAW;QACpB,SAAS,EAAE,m/mIAAm/mI;KAC//mI;IACD,4BAA4B,EAAE;QAC5B,OAAO,EAAE,oBAAoB;QAC7B,SAAS,EAAE,giRAAgiR;KAC5iR;IACD,wCAAwC,EAAE;QACxC,OAAO,EAAE,gBAAgB;QACzB,SAAS,EAAE,2nEAA2nE;KACvoE;IACD,6BAA6B,EAAE;QAC7B,OAAO,EAAE,eAAe;QACxB,SAAS,EAAE,upQAAupQ;KACnqQ;IACD,mCAAmC,EAAE;QACnC,OAAO,EAAE,WAA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AAgB;IAChB,kCAAkC;IAClC,+BAA+B;IAC/B,eAAe;IACf,kBAAkB;IAClB,kBAAkB;IAClB,wBAAwB;IACxB,wBAAwB;IACxB,yBAAyB;IACzB,cAAc;IACd,+BAA+B;IAC/B,wBAAwB;IACxB,gBAAgB;IAChB,yBAAyB;CAC1B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface CopySourceAppsOptions {
|
|
2
|
+
/** Project root — the parent of the `quickback/` folder. */
|
|
3
|
+
projectRoot: string;
|
|
4
|
+
/** Output root — where `src/` lives. Usually equals projectRoot. */
|
|
5
|
+
outputDir: string;
|
|
6
|
+
/** Paths the compiler is writing this run, relative to outputDir. */
|
|
7
|
+
manifestPaths: Iterable<string>;
|
|
8
|
+
}
|
|
9
|
+
export interface CopySourceAppsResult {
|
|
10
|
+
/** Number of files copied. Zero when the folder is missing or empty. */
|
|
11
|
+
copied: number;
|
|
12
|
+
/** Absolute path of the source folder, for logging — undefined when missing. */
|
|
13
|
+
sourceDir?: string;
|
|
14
|
+
/** Final destination paths, relative to outputDir. */
|
|
15
|
+
destPaths: string[];
|
|
16
|
+
}
|
|
17
|
+
export declare class SourceAppCollisionError extends Error {
|
|
18
|
+
readonly collisions: Array<{
|
|
19
|
+
sourcePath: string;
|
|
20
|
+
manifestPath: string;
|
|
21
|
+
}>;
|
|
22
|
+
constructor(collisions: Array<{
|
|
23
|
+
sourcePath: string;
|
|
24
|
+
manifestPath: string;
|
|
25
|
+
}>);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Copy `<projectRoot>/quickback/apps/**` into `<outputDir>/src/apps/**`.
|
|
29
|
+
*
|
|
30
|
+
* Returns `{ copied: 0 }` when the source folder is absent — apps/ is an
|
|
31
|
+
* opt-in convention, not a required directory.
|
|
32
|
+
*/
|
|
33
|
+
export declare function copySourceApps(options: CopySourceAppsOptions): Promise<CopySourceAppsResult>;
|
|
34
|
+
//# sourceMappingURL=copy-source-apps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-source-apps.d.ts","sourceRoot":"","sources":["../../src/lib/copy-source-apps.ts"],"names":[],"mappings":"AA6CA,MAAM,WAAW,qBAAqB;IACpC,4DAA4D;IAC5D,WAAW,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,SAAS,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,oBAAoB;IACnC,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;gBAE7D,UAAU,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;CAc5E;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,oBAAoB,CAAC,CAoC/B"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source-app passthrough for `quickback/apps/`.
|
|
3
|
+
*
|
|
4
|
+
* Anything under `<projectRoot>/quickback/apps/<name>/` is copied verbatim
|
|
5
|
+
* into `<outputDir>/src/apps/<name>/`, preserving directory structure. The
|
|
6
|
+
* compiler never sees these files — they ride past it as bytes and land
|
|
7
|
+
* alongside the SPA shells the compiler emits.
|
|
8
|
+
*
|
|
9
|
+
* Why a separate folder from `quickback/public/`: `public/` is for static
|
|
10
|
+
* binary assets (logos, fonts, OG images) that ride past the worker as
|
|
11
|
+
* bytes. `apps/` is for hand-authored TypeScript / JavaScript / TSX apps
|
|
12
|
+
* — companion mini-SPAs (e.g. `m/`, `admin/`) that live alongside the
|
|
13
|
+
* compiler-emitted `cms/` and `account/` shells. Different conventions,
|
|
14
|
+
* different ergonomics: this folder additionally skips `node_modules/`,
|
|
15
|
+
* `dist/`, and `build/` so a casual `bun install` inside a hand-authored
|
|
16
|
+
* app folder doesn't drag the world into the worker bundle.
|
|
17
|
+
*
|
|
18
|
+
* Why bytes, not strings: the compiler manifest is a utf-8 string channel
|
|
19
|
+
* which is fine for source code in practice, but corrupts any binary fixture
|
|
20
|
+
* a source-authored app might bundle (sprite sheets, sample WAVs, etc.).
|
|
21
|
+
* Routing the copy through `fs.copyFile` keeps everything intact.
|
|
22
|
+
*
|
|
23
|
+
* Why after the wipe-and-write: `prepareGeneratedDir` wipes `src/` based on
|
|
24
|
+
* the compiler manifest. We restore the user's hand-authored tree on top of
|
|
25
|
+
* the fresh write. Files removed from `quickback/apps/` disappear on the
|
|
26
|
+
* next compile — no orphan tracking needed.
|
|
27
|
+
*
|
|
28
|
+
* Collisions with compiler-emitted paths (e.g. dropping a hand-authored
|
|
29
|
+
* `cms/index.tsx` that would shadow the SPA shell) are rejected with a
|
|
30
|
+
* clear error rather than silently overwritten.
|
|
31
|
+
*/
|
|
32
|
+
import { promises as fs } from 'fs';
|
|
33
|
+
import { join, relative, sep } from 'path';
|
|
34
|
+
const APPS_DIR_NAME = 'apps';
|
|
35
|
+
const TARGET_PREFIX = join('src', 'apps');
|
|
36
|
+
/**
|
|
37
|
+
* Subdirectories we never copy. Symmetric with what a developer would
|
|
38
|
+
* `.gitignore` inside a hand-authored app folder. Not configurable for now —
|
|
39
|
+
* if a user has a compelling case to ship `dist/` through the passthrough,
|
|
40
|
+
* they can stage it under `public/` instead.
|
|
41
|
+
*/
|
|
42
|
+
const SKIP_DIRS = new Set(['node_modules', 'dist', 'build', '.next', '.turbo', '.cache']);
|
|
43
|
+
export class SourceAppCollisionError extends Error {
|
|
44
|
+
collisions;
|
|
45
|
+
constructor(collisions) {
|
|
46
|
+
const lines = collisions.map((c) => ` • quickback/${APPS_DIR_NAME}/${c.sourcePath} → ${c.manifestPath} (already emitted by compiler)`);
|
|
47
|
+
super([
|
|
48
|
+
`quickback/${APPS_DIR_NAME}/ contains ${collisions.length} file(s) that would overwrite compiler output:`,
|
|
49
|
+
...lines,
|
|
50
|
+
`Rename or remove these files. Reserved subpaths under src/apps/ include cms/ and account/ when those SPAs are enabled.`,
|
|
51
|
+
].join('\n'));
|
|
52
|
+
this.name = 'SourceAppCollisionError';
|
|
53
|
+
this.collisions = collisions;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Copy `<projectRoot>/quickback/apps/**` into `<outputDir>/src/apps/**`.
|
|
58
|
+
*
|
|
59
|
+
* Returns `{ copied: 0 }` when the source folder is absent — apps/ is an
|
|
60
|
+
* opt-in convention, not a required directory.
|
|
61
|
+
*/
|
|
62
|
+
export async function copySourceApps(options) {
|
|
63
|
+
const sourceDir = join(options.projectRoot, 'quickback', APPS_DIR_NAME);
|
|
64
|
+
if (!(await isDirectory(sourceDir))) {
|
|
65
|
+
return { copied: 0, destPaths: [] };
|
|
66
|
+
}
|
|
67
|
+
const sources = await collectFiles(sourceDir);
|
|
68
|
+
if (sources.length === 0) {
|
|
69
|
+
return { copied: 0, sourceDir, destPaths: [] };
|
|
70
|
+
}
|
|
71
|
+
const manifestSet = new Set();
|
|
72
|
+
for (const p of options.manifestPaths)
|
|
73
|
+
manifestSet.add(toPosix(p));
|
|
74
|
+
const collisions = [];
|
|
75
|
+
const destPaths = [];
|
|
76
|
+
for (const rel of sources) {
|
|
77
|
+
const dest = join(TARGET_PREFIX, rel);
|
|
78
|
+
const destPosix = toPosix(dest);
|
|
79
|
+
if (manifestSet.has(destPosix)) {
|
|
80
|
+
collisions.push({ sourcePath: toPosix(rel), manifestPath: destPosix });
|
|
81
|
+
}
|
|
82
|
+
destPaths.push(dest);
|
|
83
|
+
}
|
|
84
|
+
if (collisions.length > 0) {
|
|
85
|
+
throw new SourceAppCollisionError(collisions);
|
|
86
|
+
}
|
|
87
|
+
for (const rel of sources) {
|
|
88
|
+
const src = join(sourceDir, rel);
|
|
89
|
+
const dest = join(options.outputDir, TARGET_PREFIX, rel);
|
|
90
|
+
await fs.mkdir(join(dest, '..'), { recursive: true });
|
|
91
|
+
await fs.copyFile(src, dest);
|
|
92
|
+
}
|
|
93
|
+
return { copied: sources.length, sourceDir, destPaths };
|
|
94
|
+
}
|
|
95
|
+
async function isDirectory(p) {
|
|
96
|
+
try {
|
|
97
|
+
const s = await fs.stat(p);
|
|
98
|
+
return s.isDirectory();
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Walk a directory tree and return every regular file as a path relative
|
|
106
|
+
* to the root. Hidden entries (`.DS_Store`, `.git/`, dotfiles) and the
|
|
107
|
+
* `SKIP_DIRS` set (`node_modules/`, `dist/`, `build/`, etc.) are pruned —
|
|
108
|
+
* accidentally bundling those would inflate the worker output and was a
|
|
109
|
+
* top reason `quickback/public/` couldn't simply absorb this use case.
|
|
110
|
+
*/
|
|
111
|
+
async function collectFiles(root) {
|
|
112
|
+
const out = [];
|
|
113
|
+
async function walk(dir) {
|
|
114
|
+
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
115
|
+
for (const entry of entries) {
|
|
116
|
+
if (entry.name.startsWith('.'))
|
|
117
|
+
continue;
|
|
118
|
+
if (entry.isDirectory() && SKIP_DIRS.has(entry.name))
|
|
119
|
+
continue;
|
|
120
|
+
const full = join(dir, entry.name);
|
|
121
|
+
if (entry.isDirectory()) {
|
|
122
|
+
await walk(full);
|
|
123
|
+
}
|
|
124
|
+
else if (entry.isFile()) {
|
|
125
|
+
out.push(relative(root, full));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
await walk(root);
|
|
130
|
+
out.sort();
|
|
131
|
+
return out;
|
|
132
|
+
}
|
|
133
|
+
function toPosix(p) {
|
|
134
|
+
return sep === '/' ? p : p.split(sep).join('/');
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=copy-source-apps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-source-apps.js","sourceRoot":"","sources":["../../src/lib/copy-source-apps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAE3C,MAAM,aAAa,GAAG,MAAM,CAAC;AAC7B,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAoB1F,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IACvC,UAAU,CAAsD;IAEzE,YAAY,UAA+D;QACzE,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAC1B,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAiB,aAAa,IAAI,CAAC,CAAC,UAAU,MAAM,CAAC,CAAC,YAAY,gCAAgC,CAC1G,CAAC;QACF,KAAK,CACH;YACE,aAAa,aAAa,cAAc,UAAU,CAAC,MAAM,gDAAgD;YACzG,GAAG,KAAK;YACR,wHAAwH;SACzH,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;QACtC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;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,KAAK,CAAC,IAAI,CAAC;gBAAE,SAAS;YAC/D,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;YACnC,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;gBACxB,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;YACnB,CAAC;iBAAM,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;gBAC1B,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;IACH,CAAC;IACD,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,GAAG,CAAC,IAAI,EAAE,CAAC;IACX,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,OAAO,CAAC,CAAS;IACxB,OAAO,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-source-apps.test.d.ts","sourceRoot":"","sources":["../../src/lib/copy-source-apps.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { describe, expect, test, beforeEach, afterEach } from 'bun:test';
|
|
2
|
+
import { promises as fs } from 'fs';
|
|
3
|
+
import { join } from 'path';
|
|
4
|
+
import { tmpdir } from 'os';
|
|
5
|
+
import { copySourceApps, SourceAppCollisionError } from './copy-source-apps.js';
|
|
6
|
+
let tmp;
|
|
7
|
+
let projectRoot;
|
|
8
|
+
let outputDir;
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
tmp = await fs.mkdtemp(join(tmpdir(), 'source-apps-'));
|
|
11
|
+
projectRoot = join(tmp, 'project');
|
|
12
|
+
outputDir = projectRoot;
|
|
13
|
+
await fs.mkdir(projectRoot, { recursive: true });
|
|
14
|
+
});
|
|
15
|
+
afterEach(async () => {
|
|
16
|
+
await fs.rm(tmp, { recursive: true, force: true }).catch(() => { });
|
|
17
|
+
});
|
|
18
|
+
async function writeApp(rel, content) {
|
|
19
|
+
const full = join(projectRoot, 'quickback', 'apps', rel);
|
|
20
|
+
await fs.mkdir(join(full, '..'), { recursive: true });
|
|
21
|
+
await fs.writeFile(full, content);
|
|
22
|
+
}
|
|
23
|
+
async function readDest(rel) {
|
|
24
|
+
return fs.readFile(join(outputDir, 'src', 'apps', rel));
|
|
25
|
+
}
|
|
26
|
+
async function pathExists(p) {
|
|
27
|
+
try {
|
|
28
|
+
await fs.access(p);
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
describe('copySourceApps — quickback/apps passthrough', () => {
|
|
36
|
+
test('no-op when apps folder is missing', async () => {
|
|
37
|
+
const result = await copySourceApps({
|
|
38
|
+
projectRoot,
|
|
39
|
+
outputDir,
|
|
40
|
+
manifestPaths: ['src/index.ts'],
|
|
41
|
+
});
|
|
42
|
+
expect(result.copied).toBe(0);
|
|
43
|
+
expect(result.destPaths).toEqual([]);
|
|
44
|
+
expect(await pathExists(join(outputDir, 'src', 'apps'))).toBe(false);
|
|
45
|
+
});
|
|
46
|
+
test('copies hand-authored TSX files into src/apps/<name>/', async () => {
|
|
47
|
+
await writeApp('m/index.tsx', 'export default function App() { return null; }');
|
|
48
|
+
await writeApp('m/styles.css', 'body { margin: 0; }');
|
|
49
|
+
const result = await copySourceApps({
|
|
50
|
+
projectRoot,
|
|
51
|
+
outputDir,
|
|
52
|
+
manifestPaths: ['src/index.ts'],
|
|
53
|
+
});
|
|
54
|
+
expect(result.copied).toBe(2);
|
|
55
|
+
expect(result.destPaths).toContain(join('src', 'apps', 'm', 'index.tsx'));
|
|
56
|
+
expect(result.destPaths).toContain(join('src', 'apps', 'm', 'styles.css'));
|
|
57
|
+
expect((await readDest('m/index.tsx')).toString('utf-8')).toContain('export default');
|
|
58
|
+
});
|
|
59
|
+
test('preserves nested directory structure across multiple apps', async () => {
|
|
60
|
+
await writeApp('m/components/Button.tsx', 'export const Button = () => null;');
|
|
61
|
+
await writeApp('m/lib/utils.ts', 'export const x = 1;');
|
|
62
|
+
await writeApp('admin/index.tsx', 'export default () => null;');
|
|
63
|
+
const result = await copySourceApps({
|
|
64
|
+
projectRoot,
|
|
65
|
+
outputDir,
|
|
66
|
+
manifestPaths: [],
|
|
67
|
+
});
|
|
68
|
+
expect(result.copied).toBe(3);
|
|
69
|
+
expect(result.destPaths).toContain(join('src', 'apps', 'm', 'components', 'Button.tsx'));
|
|
70
|
+
expect(result.destPaths).toContain(join('src', 'apps', 'm', 'lib', 'utils.ts'));
|
|
71
|
+
expect(result.destPaths).toContain(join('src', 'apps', 'admin', 'index.tsx'));
|
|
72
|
+
});
|
|
73
|
+
test('preserves binary fixtures (e.g., sprite sheets) byte-for-byte', async () => {
|
|
74
|
+
const bytes = Buffer.from([0xff, 0xfe, 0x00, 0x80, 0xc0, 0xff]);
|
|
75
|
+
await writeApp('m/assets/sprite.bin', bytes);
|
|
76
|
+
await copySourceApps({ projectRoot, outputDir, manifestPaths: [] });
|
|
77
|
+
const out = await readDest('m/assets/sprite.bin');
|
|
78
|
+
expect(Buffer.compare(out, bytes)).toBe(0);
|
|
79
|
+
});
|
|
80
|
+
test('skips hidden files and directories (.DS_Store, .git/, dotfiles)', async () => {
|
|
81
|
+
await writeApp('m/.DS_Store', 'junk');
|
|
82
|
+
await writeApp('m/.git/HEAD', 'ref: refs/heads/main');
|
|
83
|
+
await writeApp('m/index.tsx', 'export default () => null;');
|
|
84
|
+
const result = await copySourceApps({
|
|
85
|
+
projectRoot,
|
|
86
|
+
outputDir,
|
|
87
|
+
manifestPaths: [],
|
|
88
|
+
});
|
|
89
|
+
expect(result.copied).toBe(1);
|
|
90
|
+
expect(result.destPaths).toContain(join('src', 'apps', 'm', 'index.tsx'));
|
|
91
|
+
expect(await pathExists(join(outputDir, 'src', 'apps', 'm', '.DS_Store'))).toBe(false);
|
|
92
|
+
expect(await pathExists(join(outputDir, 'src', 'apps', 'm', '.git'))).toBe(false);
|
|
93
|
+
});
|
|
94
|
+
test('skips node_modules / dist / build / .next / .turbo / .cache', async () => {
|
|
95
|
+
await writeApp('m/index.tsx', 'export default () => null;');
|
|
96
|
+
await writeApp('m/node_modules/react/index.js', 'module.exports = {};');
|
|
97
|
+
await writeApp('m/dist/bundle.js', 'compiled');
|
|
98
|
+
await writeApp('m/build/main.js', 'compiled');
|
|
99
|
+
await writeApp('m/.next/cache/x', 'x');
|
|
100
|
+
await writeApp('m/.turbo/run.log', 'x');
|
|
101
|
+
await writeApp('m/.cache/blob', 'x');
|
|
102
|
+
const result = await copySourceApps({
|
|
103
|
+
projectRoot,
|
|
104
|
+
outputDir,
|
|
105
|
+
manifestPaths: [],
|
|
106
|
+
});
|
|
107
|
+
expect(result.copied).toBe(1);
|
|
108
|
+
expect(result.destPaths).toEqual([join('src', 'apps', 'm', 'index.tsx')]);
|
|
109
|
+
expect(await pathExists(join(outputDir, 'src', 'apps', 'm', 'node_modules'))).toBe(false);
|
|
110
|
+
expect(await pathExists(join(outputDir, 'src', 'apps', 'm', 'dist'))).toBe(false);
|
|
111
|
+
expect(await pathExists(join(outputDir, 'src', 'apps', 'm', 'build'))).toBe(false);
|
|
112
|
+
});
|
|
113
|
+
test('refuses to overwrite a compiler-emitted manifest path', async () => {
|
|
114
|
+
await writeApp('cms/index.tsx', 'export default () => null;');
|
|
115
|
+
await expect(copySourceApps({
|
|
116
|
+
projectRoot,
|
|
117
|
+
outputDir,
|
|
118
|
+
manifestPaths: ['src/apps/cms/index.tsx', 'src/index.ts'],
|
|
119
|
+
})).rejects.toBeInstanceOf(SourceAppCollisionError);
|
|
120
|
+
// Nothing should have been written when we threw.
|
|
121
|
+
expect(await pathExists(join(outputDir, 'src', 'apps', 'cms'))).toBe(false);
|
|
122
|
+
});
|
|
123
|
+
test('reports every collision in one error, not just the first', async () => {
|
|
124
|
+
await writeApp('cms/index.tsx', 'x');
|
|
125
|
+
await writeApp('account/index.tsx', 'y');
|
|
126
|
+
await writeApp('m/index.tsx', 'z');
|
|
127
|
+
let err;
|
|
128
|
+
try {
|
|
129
|
+
await copySourceApps({
|
|
130
|
+
projectRoot,
|
|
131
|
+
outputDir,
|
|
132
|
+
manifestPaths: ['src/apps/cms/index.tsx', 'src/apps/account/index.tsx'],
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
catch (e) {
|
|
136
|
+
err = e;
|
|
137
|
+
}
|
|
138
|
+
expect(err).toBeInstanceOf(SourceAppCollisionError);
|
|
139
|
+
expect(err.collisions).toHaveLength(2);
|
|
140
|
+
const paths = err.collisions.map((c) => c.sourcePath).sort();
|
|
141
|
+
expect(paths).toEqual(['account/index.tsx', 'cms/index.tsx']);
|
|
142
|
+
});
|
|
143
|
+
test('empty apps folder reports zero copied without erroring', async () => {
|
|
144
|
+
await fs.mkdir(join(projectRoot, 'quickback', 'apps'), { recursive: true });
|
|
145
|
+
const result = await copySourceApps({
|
|
146
|
+
projectRoot,
|
|
147
|
+
outputDir,
|
|
148
|
+
manifestPaths: ['src/index.ts'],
|
|
149
|
+
});
|
|
150
|
+
expect(result.copied).toBe(0);
|
|
151
|
+
expect(result.sourceDir).toBeDefined();
|
|
152
|
+
});
|
|
153
|
+
test('outputDir distinct from projectRoot still resolves correctly', async () => {
|
|
154
|
+
outputDir = join(tmp, 'dist');
|
|
155
|
+
await fs.mkdir(outputDir, { recursive: true });
|
|
156
|
+
await writeApp('m/main.tsx', 'export default () => null;');
|
|
157
|
+
const result = await copySourceApps({
|
|
158
|
+
projectRoot,
|
|
159
|
+
outputDir,
|
|
160
|
+
manifestPaths: [],
|
|
161
|
+
});
|
|
162
|
+
expect(result.copied).toBe(1);
|
|
163
|
+
expect((await fs.readFile(join(outputDir, 'src', 'apps', 'm', 'main.tsx'))).toString())
|
|
164
|
+
.toContain('export default');
|
|
165
|
+
// Source still in projectRoot, untouched.
|
|
166
|
+
expect(await pathExists(join(projectRoot, 'quickback', 'apps', 'm', 'main.tsx')))
|
|
167
|
+
.toBe(true);
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
//# sourceMappingURL=copy-source-apps.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-source-apps.test.js","sourceRoot":"","sources":["../../src/lib/copy-source-apps.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhF,IAAI,GAAW,CAAC;AAChB,IAAI,WAAmB,CAAC;AACxB,IAAI,SAAiB,CAAC;AAEtB,UAAU,CAAC,KAAK,IAAI,EAAE;IACpB,GAAG,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC;IACvD,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IACnC,SAAS,GAAG,WAAW,CAAC;IACxB,MAAM,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AACnD,CAAC,CAAC,CAAC;AAEH,SAAS,CAAC,KAAK,IAAI,EAAE;IACnB,MAAM,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,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,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,8DAA8D,EAAE,KAAK,IAAI,EAAE;QAC9E,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAC9B,MAAM,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/C,MAAM,QAAQ,CAAC,YAAY,EAAE,4BAA4B,CAAC,CAAC;QAC3D,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC;YAClC,WAAW;YACX,SAAS;YACT,aAAa,EAAE,EAAE;SAClB,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC9B,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;aACpF,SAAS,CAAC,gBAAgB,CAAC,CAAC;QAC/B,0CAA0C;QAC1C,MAAM,CAAC,MAAM,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC;aAC9E,IAAI,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -122,7 +122,41 @@ Each in-worker DO entry accepts:
|
|
|
122
122
|
|
|
123
123
|
Where the class file lives: in-worker DO classes go under `quickback/lib/` or `quickback/features/<feature>/lib/` so they survive every compile (the rest of `src/` is wiped). Both copy verbatim into the generated `src/` tree.
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
### `durableObjectMigrations`
|
|
126
|
+
|
|
127
|
+
Cloudflare's `[[migrations]]` list is **append-only** — once a tag is deployed, removing it from `wrangler.toml` causes the next deploy to fail with code 10061 ("Cannot apply migration"). Quickback regenerates `wrangler.toml` from your config on every compile, so any historical lifecycle entries (deleted, renamed, transferred classes) need to live in the config too — otherwise they'd be wiped.
|
|
128
|
+
|
|
129
|
+
`bindings.durableObjectMigrations[]` is the slot for those entries. Compiler emits them **first** in the [[migrations]] list, before the auto-emitted current-class creation tags, so CF sees the chronology it needs.
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
bindings: {
|
|
133
|
+
durableObjects: [
|
|
134
|
+
{ name: "NOTEPAD", className: "Notepad", from: "lib/Notepad" },
|
|
135
|
+
],
|
|
136
|
+
// Historical lifecycle: a previous LegacyNotes class was deleted on
|
|
137
|
+
// 2026-05-09. Without this entry, a recompile would drop the
|
|
138
|
+
// deleted_classes block and the next deploy would 10061.
|
|
139
|
+
durableObjectMigrations: [
|
|
140
|
+
{
|
|
141
|
+
tag: "qb-do-deleted-legacy-notes-2026-05-09",
|
|
142
|
+
deletedClasses: ["LegacyNotes"],
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Each entry accepts:
|
|
149
|
+
|
|
150
|
+
| Field | Notes |
|
|
151
|
+
|-------|-------|
|
|
152
|
+
| `tag` | Migration tag. Once deployed, never change it. Convention: `qb-do-<verb>-<class>-<YYYY-MM-DD>`. |
|
|
153
|
+
| `newClasses` | KV-backed creations. Rare — most DOs use `new_sqlite_classes`. |
|
|
154
|
+
| `newSqliteClasses` | SQLite-backed creations. Use this if you ever need to declare a creation manually instead of letting the auto-emit handle it. |
|
|
155
|
+
| `deletedClasses` | Array of class names to tear down. **Destroys the DO's storage** on deploy — only use when you're sure. |
|
|
156
|
+
| `renamedClasses` | `[{ from, to }]` — class rename without losing storage. |
|
|
157
|
+
| `transferredClasses` | `[{ from, from_script, to }]` — move a class across workers. |
|
|
158
|
+
|
|
159
|
+
**When you remove a DO from `bindings.durableObjects`**, declare the teardown here. Don't hand-edit `wrangler.toml` — those edits get wiped on the next compile.
|
|
126
160
|
|
|
127
161
|
### `vars`
|
|
128
162
|
|
|
@@ -351,6 +351,47 @@ Notes:
|
|
|
351
351
|
- A file in `quickback/public/` that would overwrite a compiler-emitted path (e.g. `quickback/public/cms/index.html`) fails the compile with a clear error rather than silently shadowing the SPA shell.
|
|
352
352
|
- Binaries (images, fonts, PDFs) are copied byte-for-byte — there is no string round-trip.
|
|
353
353
|
|
|
354
|
+
### Source Apps (`quickback/apps/`)
|
|
355
|
+
|
|
356
|
+
For hand-authored TypeScript apps that live alongside the compiler-emitted SPA shells, drop them under `quickback/apps/<name>/`. The CLI copies the tree into `src/apps/<name>/` on every compile, byte-for-byte, after the compiler has finished writing.
|
|
357
|
+
|
|
358
|
+
```
|
|
359
|
+
quickback/apps/ # Source — checked into your repo
|
|
360
|
+
├── m/ # A hand-authored mobile companion app
|
|
361
|
+
│ ├── index.tsx
|
|
362
|
+
│ ├── components/Button.tsx
|
|
363
|
+
│ └── lib/utils.ts
|
|
364
|
+
└── admin/ # A hand-authored admin tool
|
|
365
|
+
└── index.tsx
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
After compile:
|
|
369
|
+
|
|
370
|
+
```
|
|
371
|
+
src/apps/
|
|
372
|
+
├── m/index.tsx # Hand-authored — preserved across compiles
|
|
373
|
+
├── m/components/Button.tsx
|
|
374
|
+
├── m/lib/utils.ts
|
|
375
|
+
├── admin/index.tsx
|
|
376
|
+
├── cms/ # Compiler-emitted SPA (don't shadow)
|
|
377
|
+
└── account/ # Compiler-emitted SPA (don't shadow)
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
When to choose `apps/` vs `public/`:
|
|
381
|
+
|
|
382
|
+
| | `quickback/public/` | `quickback/apps/` |
|
|
383
|
+
|---|---|---|
|
|
384
|
+
| **Use for** | Static binaries (logos, fonts, OG images, PDFs, robots.txt) | Hand-authored TS/TSX/JS app source |
|
|
385
|
+
| **Skips** | Hidden entries only (`.DS_Store`, `.git/`) | Hidden entries + `node_modules/`, `dist/`, `build/`, `.next/`, `.turbo/`, `.cache/` |
|
|
386
|
+
| **Folder layout** | Files at any depth — flat or nested | Apps under named subfolders (`m/`, `admin/`, …) |
|
|
387
|
+
|
|
388
|
+
Notes:
|
|
389
|
+
|
|
390
|
+
- The folder is optional. If it doesn't exist, this step is a no-op.
|
|
391
|
+
- Files removed from `quickback/apps/<name>/` disappear from `src/apps/<name>/` on the next compile — `src/` is wiped and rewritten each run.
|
|
392
|
+
- A file in `quickback/apps/` that would overwrite a compiler-emitted path (e.g. `quickback/apps/cms/index.tsx` while `cms: true`) fails the compile with a clear error.
|
|
393
|
+
- Migrating from hand-edited `src/apps/<name>/`: move the entire folder under `quickback/apps/<name>/` once, then trust the compile cycle. The hermetic `src/` contract holds again.
|
|
394
|
+
|
|
354
395
|
### Generated Wrangler Assets Config
|
|
355
396
|
|
|
356
397
|
The compiler always generates `run_worker_first = true` when SPAs are enabled — the Worker handles all SPA routing (per hostname and per path prefix):
|
|
@@ -171,7 +171,7 @@ Members only see the "summary" view option. Admins and owners see both "summary"
|
|
|
171
171
|
The firewall layer handles tenant isolation — ensuring users can only access data within their organization. This is enforced entirely server-side:
|
|
172
172
|
|
|
173
173
|
- `organization_id` columns are filtered automatically by the API
|
|
174
|
-
- `owner`
|
|
174
|
+
- `owner` predicates restrict records to the creating user
|
|
175
175
|
- The CMS never sees data outside the user's organization scope
|
|
176
176
|
|
|
177
177
|
The CMS does not display firewall config in its UI because there is nothing for the user to control. Tenant isolation is transparent and automatic.
|
|
@@ -35,6 +35,22 @@ export default defineTable(applications, {
|
|
|
35
35
|
|
|
36
36
|
When any table has realtime enabled, the compiler generates `src/lib/realtime.ts` with helper functions for sending notifications.
|
|
37
37
|
|
|
38
|
+
## When auto-broadcast fires (and when you call it manually)
|
|
39
|
+
|
|
40
|
+
Quickback emits auto-broadcasts in **only one place**: the generated CRUD route handlers (`POST /` create, `PATCH /:id` update, `DELETE /:id` delete) for resources with `realtime.enabled` (or covered by `dbConfig.realtime: true`'s project-level default). Those handlers wrap each successful write with a `realtime.insert / update / delete` call before responding.
|
|
41
|
+
|
|
42
|
+
Everywhere else — action handlers, queue consumers, scheduled jobs, custom Hono routes — you broadcast manually via the `createRealtime(env)` helper described below.
|
|
43
|
+
|
|
44
|
+
| Mutation site | Auto-broadcast? | Why |
|
|
45
|
+
|---|---|---|
|
|
46
|
+
| Generated CRUD route (`POST /`, `PATCH /:id`, `DELETE /:id`) | Yes | The compiler emits the call after the write returns. |
|
|
47
|
+
| Generated batch route (`/batch/...`) | Yes | Same pattern, emitted per record. |
|
|
48
|
+
| `scoped.insert/update/delete` inside an action handler | No — manual | Scoped-db is a query-shape wrapper (firewall + soft-delete WHERE injection). It deliberately has no side-effects so explicit handlers can write multiple records, conditionally roll back, etc. without surprise broadcasts. |
|
|
49
|
+
| `unsafeDb` writes in actions (or any custom route) | No — manual | Same reasoning — `unsafeDb` is the un-wrapped escape hatch. |
|
|
50
|
+
| Queue consumers, cron jobs, webhook handlers | No — manual | These run outside the CRUD path entirely. |
|
|
51
|
+
|
|
52
|
+
The rule of thumb: if your code calls `db.insert(...)` / `scoped.insert(...)` directly, you also call `realtime.insert(...)` directly on the next line. Otherwise the cross-tab live-update you wired up in the SPA won't fire.
|
|
53
|
+
|
|
38
54
|
## Generated Helper
|
|
39
55
|
|
|
40
56
|
The `createRealtime()` factory provides convenient methods for both Postgres Changes (CRUD events) and custom broadcasts:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quickback-dev/cli",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.3",
|
|
4
4
|
"description": "CLI for Quickback — define your backend in TypeScript, compile to a fully wired Cloudflare Worker (or Bun / Node) with auth, database, migrations, security, CMS, and Account UI.",
|
|
5
5
|
"author": "Kardoe Incorporated <paul@kardoe.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -122,7 +122,41 @@ Each in-worker DO entry accepts:
|
|
|
122
122
|
|
|
123
123
|
Where the class file lives: in-worker DO classes go under `quickback/lib/` or `quickback/features/<feature>/lib/` so they survive every compile (the rest of `src/` is wiped). Both copy verbatim into the generated `src/` tree.
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
### `durableObjectMigrations`
|
|
126
|
+
|
|
127
|
+
Cloudflare's `[[migrations]]` list is **append-only** — once a tag is deployed, removing it from `wrangler.toml` causes the next deploy to fail with code 10061 ("Cannot apply migration"). Quickback regenerates `wrangler.toml` from your config on every compile, so any historical lifecycle entries (deleted, renamed, transferred classes) need to live in the config too — otherwise they'd be wiped.
|
|
128
|
+
|
|
129
|
+
`bindings.durableObjectMigrations[]` is the slot for those entries. Compiler emits them **first** in the [[migrations]] list, before the auto-emitted current-class creation tags, so CF sees the chronology it needs.
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
bindings: {
|
|
133
|
+
durableObjects: [
|
|
134
|
+
{ name: "NOTEPAD", className: "Notepad", from: "lib/Notepad" },
|
|
135
|
+
],
|
|
136
|
+
// Historical lifecycle: a previous LegacyNotes class was deleted on
|
|
137
|
+
// 2026-05-09. Without this entry, a recompile would drop the
|
|
138
|
+
// deleted_classes block and the next deploy would 10061.
|
|
139
|
+
durableObjectMigrations: [
|
|
140
|
+
{
|
|
141
|
+
tag: "qb-do-deleted-legacy-notes-2026-05-09",
|
|
142
|
+
deletedClasses: ["LegacyNotes"],
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Each entry accepts:
|
|
149
|
+
|
|
150
|
+
| Field | Notes |
|
|
151
|
+
|-------|-------|
|
|
152
|
+
| `tag` | Migration tag. Once deployed, never change it. Convention: `qb-do-<verb>-<class>-<YYYY-MM-DD>`. |
|
|
153
|
+
| `newClasses` | KV-backed creations. Rare — most DOs use `new_sqlite_classes`. |
|
|
154
|
+
| `newSqliteClasses` | SQLite-backed creations. Use this if you ever need to declare a creation manually instead of letting the auto-emit handle it. |
|
|
155
|
+
| `deletedClasses` | Array of class names to tear down. **Destroys the DO's storage** on deploy — only use when you're sure. |
|
|
156
|
+
| `renamedClasses` | `[{ from, to }]` — class rename without losing storage. |
|
|
157
|
+
| `transferredClasses` | `[{ from, from_script, to }]` — move a class across workers. |
|
|
158
|
+
|
|
159
|
+
**When you remove a DO from `bindings.durableObjects`**, declare the teardown here. Don't hand-edit `wrangler.toml` — those edits get wiped on the next compile.
|
|
126
160
|
|
|
127
161
|
### `vars`
|
|
128
162
|
|
|
@@ -351,6 +351,47 @@ Notes:
|
|
|
351
351
|
- A file in `quickback/public/` that would overwrite a compiler-emitted path (e.g. `quickback/public/cms/index.html`) fails the compile with a clear error rather than silently shadowing the SPA shell.
|
|
352
352
|
- Binaries (images, fonts, PDFs) are copied byte-for-byte — there is no string round-trip.
|
|
353
353
|
|
|
354
|
+
### Source Apps (`quickback/apps/`)
|
|
355
|
+
|
|
356
|
+
For hand-authored TypeScript apps that live alongside the compiler-emitted SPA shells, drop them under `quickback/apps/<name>/`. The CLI copies the tree into `src/apps/<name>/` on every compile, byte-for-byte, after the compiler has finished writing.
|
|
357
|
+
|
|
358
|
+
```
|
|
359
|
+
quickback/apps/ # Source — checked into your repo
|
|
360
|
+
├── m/ # A hand-authored mobile companion app
|
|
361
|
+
│ ├── index.tsx
|
|
362
|
+
│ ├── components/Button.tsx
|
|
363
|
+
│ └── lib/utils.ts
|
|
364
|
+
└── admin/ # A hand-authored admin tool
|
|
365
|
+
└── index.tsx
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
After compile:
|
|
369
|
+
|
|
370
|
+
```
|
|
371
|
+
src/apps/
|
|
372
|
+
├── m/index.tsx # Hand-authored — preserved across compiles
|
|
373
|
+
├── m/components/Button.tsx
|
|
374
|
+
├── m/lib/utils.ts
|
|
375
|
+
├── admin/index.tsx
|
|
376
|
+
├── cms/ # Compiler-emitted SPA (don't shadow)
|
|
377
|
+
└── account/ # Compiler-emitted SPA (don't shadow)
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
When to choose `apps/` vs `public/`:
|
|
381
|
+
|
|
382
|
+
| | `quickback/public/` | `quickback/apps/` |
|
|
383
|
+
|---|---|---|
|
|
384
|
+
| **Use for** | Static binaries (logos, fonts, OG images, PDFs, robots.txt) | Hand-authored TS/TSX/JS app source |
|
|
385
|
+
| **Skips** | Hidden entries only (`.DS_Store`, `.git/`) | Hidden entries + `node_modules/`, `dist/`, `build/`, `.next/`, `.turbo/`, `.cache/` |
|
|
386
|
+
| **Folder layout** | Files at any depth — flat or nested | Apps under named subfolders (`m/`, `admin/`, …) |
|
|
387
|
+
|
|
388
|
+
Notes:
|
|
389
|
+
|
|
390
|
+
- The folder is optional. If it doesn't exist, this step is a no-op.
|
|
391
|
+
- Files removed from `quickback/apps/<name>/` disappear from `src/apps/<name>/` on the next compile — `src/` is wiped and rewritten each run.
|
|
392
|
+
- A file in `quickback/apps/` that would overwrite a compiler-emitted path (e.g. `quickback/apps/cms/index.tsx` while `cms: true`) fails the compile with a clear error.
|
|
393
|
+
- Migrating from hand-edited `src/apps/<name>/`: move the entire folder under `quickback/apps/<name>/` once, then trust the compile cycle. The hermetic `src/` contract holds again.
|
|
394
|
+
|
|
354
395
|
### Generated Wrangler Assets Config
|
|
355
396
|
|
|
356
397
|
The compiler always generates `run_worker_first = true` when SPAs are enabled — the Worker handles all SPA routing (per hostname and per path prefix):
|
|
@@ -171,7 +171,7 @@ Members only see the "summary" view option. Admins and owners see both "summary"
|
|
|
171
171
|
The firewall layer handles tenant isolation — ensuring users can only access data within their organization. This is enforced entirely server-side:
|
|
172
172
|
|
|
173
173
|
- `organization_id` columns are filtered automatically by the API
|
|
174
|
-
- `owner`
|
|
174
|
+
- `owner` predicates restrict records to the creating user
|
|
175
175
|
- The CMS never sees data outside the user's organization scope
|
|
176
176
|
|
|
177
177
|
The CMS does not display firewall config in its UI because there is nothing for the user to control. Tenant isolation is transparent and automatic.
|
|
@@ -35,6 +35,22 @@ export default defineTable(applications, {
|
|
|
35
35
|
|
|
36
36
|
When any table has realtime enabled, the compiler generates `src/lib/realtime.ts` with helper functions for sending notifications.
|
|
37
37
|
|
|
38
|
+
## When auto-broadcast fires (and when you call it manually)
|
|
39
|
+
|
|
40
|
+
Quickback emits auto-broadcasts in **only one place**: the generated CRUD route handlers (`POST /` create, `PATCH /:id` update, `DELETE /:id` delete) for resources with `realtime.enabled` (or covered by `dbConfig.realtime: true`'s project-level default). Those handlers wrap each successful write with a `realtime.insert / update / delete` call before responding.
|
|
41
|
+
|
|
42
|
+
Everywhere else — action handlers, queue consumers, scheduled jobs, custom Hono routes — you broadcast manually via the `createRealtime(env)` helper described below.
|
|
43
|
+
|
|
44
|
+
| Mutation site | Auto-broadcast? | Why |
|
|
45
|
+
|---|---|---|
|
|
46
|
+
| Generated CRUD route (`POST /`, `PATCH /:id`, `DELETE /:id`) | Yes | The compiler emits the call after the write returns. |
|
|
47
|
+
| Generated batch route (`/batch/...`) | Yes | Same pattern, emitted per record. |
|
|
48
|
+
| `scoped.insert/update/delete` inside an action handler | No — manual | Scoped-db is a query-shape wrapper (firewall + soft-delete WHERE injection). It deliberately has no side-effects so explicit handlers can write multiple records, conditionally roll back, etc. without surprise broadcasts. |
|
|
49
|
+
| `unsafeDb` writes in actions (or any custom route) | No — manual | Same reasoning — `unsafeDb` is the un-wrapped escape hatch. |
|
|
50
|
+
| Queue consumers, cron jobs, webhook handlers | No — manual | These run outside the CRUD path entirely. |
|
|
51
|
+
|
|
52
|
+
The rule of thumb: if your code calls `db.insert(...)` / `scoped.insert(...)` directly, you also call `realtime.insert(...)` directly on the next line. Otherwise the cross-tab live-update you wired up in the SPA won't fire.
|
|
53
|
+
|
|
38
54
|
## Generated Helper
|
|
39
55
|
|
|
40
56
|
The `createRealtime()` factory provides convenient methods for both Postgres Changes (CRUD events) and custom broadcasts:
|