@quickback-dev/cli 0.10.16 → 0.10.20

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.
Files changed (249) hide show
  1. package/dist/commands/compile.d.ts.map +1 -1
  2. package/dist/commands/compile.js +40 -2
  3. package/dist/commands/compile.js.map +1 -1
  4. package/dist/docs/content.js +6 -6
  5. package/dist/docs/content.js.map +1 -1
  6. package/dist/index.js +1 -1
  7. package/dist/skill/SKILL.md +142 -1051
  8. package/dist/skill/agents/quickback-specialist/AGENT.md +36 -0
  9. package/dist/skill/docs/changelog.md +1192 -0
  10. package/dist/skill/docs/compiler/claude-code-skill.md +312 -0
  11. package/dist/skill/docs/compiler/cloud-compiler/authentication.md +63 -0
  12. package/dist/skill/docs/compiler/cloud-compiler/cli.md +307 -0
  13. package/dist/skill/docs/compiler/cloud-compiler/endpoints.md +78 -0
  14. package/dist/skill/docs/compiler/cloud-compiler/index.md +65 -0
  15. package/dist/skill/docs/compiler/cloud-compiler/local-compiler.md +115 -0
  16. package/dist/skill/docs/compiler/cloud-compiler/troubleshooting.md +76 -0
  17. package/dist/skill/docs/compiler/config/agents.md +144 -0
  18. package/dist/skill/docs/compiler/config/auth.md +109 -0
  19. package/dist/skill/docs/compiler/config/bindings.md +176 -0
  20. package/dist/skill/docs/compiler/config/domains.md +149 -0
  21. package/dist/skill/docs/compiler/config/index.md +419 -0
  22. package/dist/skill/docs/compiler/config/output.md +338 -0
  23. package/dist/skill/docs/compiler/config/providers.md +248 -0
  24. package/dist/skill/docs/compiler/config/security.md +255 -0
  25. package/dist/skill/docs/compiler/config/single-tenant.md +128 -0
  26. package/dist/skill/docs/compiler/config/variables.md +157 -0
  27. package/dist/skill/docs/compiler/definitions/access.md +445 -0
  28. package/dist/skill/docs/compiler/definitions/actions.md +884 -0
  29. package/dist/skill/docs/compiler/definitions/concepts.md +52 -0
  30. package/dist/skill/docs/compiler/definitions/feature.md +164 -0
  31. package/dist/skill/docs/compiler/definitions/firewall.md +285 -0
  32. package/dist/skill/docs/compiler/definitions/guards.md +241 -0
  33. package/dist/skill/docs/compiler/definitions/index.md +219 -0
  34. package/dist/skill/docs/compiler/definitions/masking.md +241 -0
  35. package/dist/skill/docs/compiler/definitions/read.md +220 -0
  36. package/dist/skill/docs/compiler/definitions/schema.md +697 -0
  37. package/dist/skill/docs/compiler/definitions/validation.md +35 -0
  38. package/dist/skill/docs/compiler/definitions/views.md +292 -0
  39. package/dist/skill/docs/compiler/getting-started/claude-code.md +126 -0
  40. package/dist/skill/docs/compiler/getting-started/full-example.md +431 -0
  41. package/dist/skill/docs/compiler/getting-started/hand-crafted.md +178 -0
  42. package/dist/skill/docs/compiler/getting-started/index.md +192 -0
  43. package/dist/skill/docs/compiler/getting-started/patterns.md +225 -0
  44. package/dist/skill/docs/compiler/getting-started/template-blog.md +280 -0
  45. package/dist/skill/docs/compiler/getting-started/template-cloudflare.md +260 -0
  46. package/dist/skill/docs/compiler/getting-started/template-empty.md +112 -0
  47. package/dist/skill/docs/compiler/getting-started/templates.md +111 -0
  48. package/dist/skill/docs/compiler/index.md +85 -0
  49. package/dist/skill/docs/compiler/targets/hono-api/cloudflare.md +94 -0
  50. package/dist/skill/docs/compiler/targets/hono-api/database/d1.md +246 -0
  51. package/dist/skill/docs/compiler/targets/hono-api/database/index.md +16 -0
  52. package/dist/skill/docs/compiler/targets/hono-api/database/neon.md +144 -0
  53. package/dist/skill/docs/compiler/targets/hono-api/database/using-d1.md +39 -0
  54. package/dist/skill/docs/compiler/targets/hono-api/index.md +37 -0
  55. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/actions-api.md +323 -0
  56. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/batch-operations.md +357 -0
  57. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/caching.md +105 -0
  58. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/crud.md +652 -0
  59. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/errors.md +224 -0
  60. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/index.md +37 -0
  61. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/openapi.md +203 -0
  62. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/query-params.md +199 -0
  63. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/views-api.md +161 -0
  64. package/dist/skill/docs/compiler/targets/index.md +47 -0
  65. package/dist/skill/docs/compiler/targets/supabase-rls/index.md +55 -0
  66. package/dist/skill/docs/compiler/targets/supabase-rls/limitations.md +48 -0
  67. package/dist/skill/docs/compiler/targets/supabase-rls/mappings.md +99 -0
  68. package/dist/skill/docs/compiler/targets/supabase-rls/setup.md +88 -0
  69. package/dist/skill/docs/compiler/troubleshooting.md +120 -0
  70. package/dist/skill/docs/index.md +77 -0
  71. package/dist/skill/docs/stack/account-ui/customization.md +378 -0
  72. package/dist/skill/docs/stack/account-ui/environment-variables.md +325 -0
  73. package/dist/skill/docs/stack/account-ui/features/admin.md +76 -0
  74. package/dist/skill/docs/stack/account-ui/features/api-keys.md +22 -0
  75. package/dist/skill/docs/stack/account-ui/features/avatars.md +37 -0
  76. package/dist/skill/docs/stack/account-ui/features/cli-authorize.md +21 -0
  77. package/dist/skill/docs/stack/account-ui/features/index.md +291 -0
  78. package/dist/skill/docs/stack/account-ui/features/organizations.md +29 -0
  79. package/dist/skill/docs/stack/account-ui/features/passkeys.md +31 -0
  80. package/dist/skill/docs/stack/account-ui/features/passwordless.md +28 -0
  81. package/dist/skill/docs/stack/account-ui/features/sessions.md +20 -0
  82. package/dist/skill/docs/stack/account-ui/hooks.md +209 -0
  83. package/dist/skill/docs/stack/account-ui/index.md +147 -0
  84. package/dist/skill/docs/stack/account-ui/library-usage.md +257 -0
  85. package/dist/skill/docs/stack/account-ui/standalone.md +149 -0
  86. package/dist/skill/docs/stack/account-ui/with-quickback.md +160 -0
  87. package/dist/skill/docs/stack/account-ui/worker.md +362 -0
  88. package/dist/skill/docs/stack/auth/api-keys.md +15 -0
  89. package/dist/skill/docs/stack/auth/device-auth.md +14 -0
  90. package/dist/skill/docs/stack/auth/index.md +64 -0
  91. package/dist/skill/docs/stack/auth/jwt-optimization.md +245 -0
  92. package/dist/skill/docs/stack/auth/plugins/aws-ses.md +127 -0
  93. package/dist/skill/docs/stack/auth/plugins/combo-auth.md +74 -0
  94. package/dist/skill/docs/stack/auth/plugins/index.md +228 -0
  95. package/dist/skill/docs/stack/auth/plugins/upgrade-anonymous.md +155 -0
  96. package/dist/skill/docs/stack/auth/security.md +455 -0
  97. package/dist/skill/docs/stack/auth/using-auth.md +39 -0
  98. package/dist/skill/docs/stack/cms/actions.md +199 -0
  99. package/dist/skill/docs/stack/cms/components.md +479 -0
  100. package/dist/skill/docs/stack/cms/connecting.md +199 -0
  101. package/dist/skill/docs/stack/cms/dashboard.md +39 -0
  102. package/dist/skill/docs/stack/cms/index.md +158 -0
  103. package/dist/skill/docs/stack/cms/inline-editing.md +136 -0
  104. package/dist/skill/docs/stack/cms/pages.md +275 -0
  105. package/dist/skill/docs/stack/cms/record-layouts.md +151 -0
  106. package/dist/skill/docs/stack/cms/schema-format.md +437 -0
  107. package/dist/skill/docs/stack/cms/schema-registry.md +200 -0
  108. package/dist/skill/docs/stack/cms/security.md +203 -0
  109. package/dist/skill/docs/stack/cms/table-views.md +142 -0
  110. package/dist/skill/docs/stack/index.md +65 -0
  111. package/dist/skill/docs/stack/queues/handlers.md +317 -0
  112. package/dist/skill/docs/stack/queues/index.md +56 -0
  113. package/dist/skill/docs/stack/queues/using-queues.md +192 -0
  114. package/dist/skill/docs/stack/realtime/durable-objects.md +488 -0
  115. package/dist/skill/docs/stack/realtime/index.md +67 -0
  116. package/dist/skill/docs/stack/realtime/using-realtime.md +211 -0
  117. package/dist/skill/docs/stack/storage/index.md +17 -0
  118. package/dist/skill/docs/stack/storage/kv.md +204 -0
  119. package/dist/skill/docs/stack/storage/r2.md +232 -0
  120. package/dist/skill/docs/stack/storage/using-kv.md +70 -0
  121. package/dist/skill/docs/stack/storage/using-r2.md +55 -0
  122. package/dist/skill/docs/stack/vector/embeddings.md +554 -0
  123. package/dist/skill/docs/stack/vector/index.md +44 -0
  124. package/dist/skill/docs/stack/vector/using-embeddings.md +186 -0
  125. package/dist/skill/docs/stack/webhooks/inbound.md +186 -0
  126. package/dist/skill/docs/stack/webhooks/index.md +36 -0
  127. package/dist/skill/docs/stack/webhooks/outbound.md +281 -0
  128. package/package.json +1 -1
  129. package/src/skill/SKILL.md +142 -1051
  130. package/src/skill/agents/quickback-specialist/AGENT.md +36 -0
  131. package/src/skill/docs/changelog.md +1192 -0
  132. package/src/skill/docs/compiler/claude-code-skill.md +312 -0
  133. package/src/skill/docs/compiler/cloud-compiler/authentication.md +63 -0
  134. package/src/skill/docs/compiler/cloud-compiler/cli.md +307 -0
  135. package/src/skill/docs/compiler/cloud-compiler/endpoints.md +78 -0
  136. package/src/skill/docs/compiler/cloud-compiler/index.md +65 -0
  137. package/src/skill/docs/compiler/cloud-compiler/local-compiler.md +115 -0
  138. package/src/skill/docs/compiler/cloud-compiler/troubleshooting.md +76 -0
  139. package/src/skill/docs/compiler/config/agents.md +144 -0
  140. package/src/skill/docs/compiler/config/auth.md +109 -0
  141. package/src/skill/docs/compiler/config/bindings.md +176 -0
  142. package/src/skill/docs/compiler/config/domains.md +149 -0
  143. package/src/skill/docs/compiler/config/index.md +419 -0
  144. package/src/skill/docs/compiler/config/output.md +338 -0
  145. package/src/skill/docs/compiler/config/providers.md +248 -0
  146. package/src/skill/docs/compiler/config/security.md +255 -0
  147. package/src/skill/docs/compiler/config/single-tenant.md +128 -0
  148. package/src/skill/docs/compiler/config/variables.md +157 -0
  149. package/src/skill/docs/compiler/definitions/access.md +445 -0
  150. package/src/skill/docs/compiler/definitions/actions.md +884 -0
  151. package/src/skill/docs/compiler/definitions/concepts.md +52 -0
  152. package/src/skill/docs/compiler/definitions/feature.md +164 -0
  153. package/src/skill/docs/compiler/definitions/firewall.md +285 -0
  154. package/src/skill/docs/compiler/definitions/guards.md +241 -0
  155. package/src/skill/docs/compiler/definitions/index.md +219 -0
  156. package/src/skill/docs/compiler/definitions/masking.md +241 -0
  157. package/src/skill/docs/compiler/definitions/read.md +220 -0
  158. package/src/skill/docs/compiler/definitions/schema.md +697 -0
  159. package/src/skill/docs/compiler/definitions/validation.md +35 -0
  160. package/src/skill/docs/compiler/definitions/views.md +292 -0
  161. package/src/skill/docs/compiler/getting-started/claude-code.md +126 -0
  162. package/src/skill/docs/compiler/getting-started/full-example.md +431 -0
  163. package/src/skill/docs/compiler/getting-started/hand-crafted.md +178 -0
  164. package/src/skill/docs/compiler/getting-started/index.md +192 -0
  165. package/src/skill/docs/compiler/getting-started/patterns.md +225 -0
  166. package/src/skill/docs/compiler/getting-started/template-blog.md +280 -0
  167. package/src/skill/docs/compiler/getting-started/template-cloudflare.md +260 -0
  168. package/src/skill/docs/compiler/getting-started/template-empty.md +112 -0
  169. package/src/skill/docs/compiler/getting-started/templates.md +111 -0
  170. package/src/skill/docs/compiler/index.md +85 -0
  171. package/src/skill/docs/compiler/targets/hono-api/cloudflare.md +94 -0
  172. package/src/skill/docs/compiler/targets/hono-api/database/d1.md +246 -0
  173. package/src/skill/docs/compiler/targets/hono-api/database/index.md +16 -0
  174. package/src/skill/docs/compiler/targets/hono-api/database/neon.md +144 -0
  175. package/src/skill/docs/compiler/targets/hono-api/database/using-d1.md +39 -0
  176. package/src/skill/docs/compiler/targets/hono-api/index.md +37 -0
  177. package/src/skill/docs/compiler/targets/hono-api/using-the-api/actions-api.md +323 -0
  178. package/src/skill/docs/compiler/targets/hono-api/using-the-api/batch-operations.md +357 -0
  179. package/src/skill/docs/compiler/targets/hono-api/using-the-api/caching.md +105 -0
  180. package/src/skill/docs/compiler/targets/hono-api/using-the-api/crud.md +652 -0
  181. package/src/skill/docs/compiler/targets/hono-api/using-the-api/errors.md +224 -0
  182. package/src/skill/docs/compiler/targets/hono-api/using-the-api/index.md +37 -0
  183. package/src/skill/docs/compiler/targets/hono-api/using-the-api/openapi.md +203 -0
  184. package/src/skill/docs/compiler/targets/hono-api/using-the-api/query-params.md +199 -0
  185. package/src/skill/docs/compiler/targets/hono-api/using-the-api/views-api.md +161 -0
  186. package/src/skill/docs/compiler/targets/index.md +47 -0
  187. package/src/skill/docs/compiler/targets/supabase-rls/index.md +55 -0
  188. package/src/skill/docs/compiler/targets/supabase-rls/limitations.md +48 -0
  189. package/src/skill/docs/compiler/targets/supabase-rls/mappings.md +99 -0
  190. package/src/skill/docs/compiler/targets/supabase-rls/setup.md +88 -0
  191. package/src/skill/docs/compiler/troubleshooting.md +120 -0
  192. package/src/skill/docs/index.md +77 -0
  193. package/src/skill/docs/stack/account-ui/customization.md +378 -0
  194. package/src/skill/docs/stack/account-ui/environment-variables.md +325 -0
  195. package/src/skill/docs/stack/account-ui/features/admin.md +76 -0
  196. package/src/skill/docs/stack/account-ui/features/api-keys.md +22 -0
  197. package/src/skill/docs/stack/account-ui/features/avatars.md +37 -0
  198. package/src/skill/docs/stack/account-ui/features/cli-authorize.md +21 -0
  199. package/src/skill/docs/stack/account-ui/features/index.md +291 -0
  200. package/src/skill/docs/stack/account-ui/features/organizations.md +29 -0
  201. package/src/skill/docs/stack/account-ui/features/passkeys.md +31 -0
  202. package/src/skill/docs/stack/account-ui/features/passwordless.md +28 -0
  203. package/src/skill/docs/stack/account-ui/features/sessions.md +20 -0
  204. package/src/skill/docs/stack/account-ui/hooks.md +209 -0
  205. package/src/skill/docs/stack/account-ui/index.md +147 -0
  206. package/src/skill/docs/stack/account-ui/library-usage.md +257 -0
  207. package/src/skill/docs/stack/account-ui/standalone.md +149 -0
  208. package/src/skill/docs/stack/account-ui/with-quickback.md +160 -0
  209. package/src/skill/docs/stack/account-ui/worker.md +362 -0
  210. package/src/skill/docs/stack/auth/api-keys.md +15 -0
  211. package/src/skill/docs/stack/auth/device-auth.md +14 -0
  212. package/src/skill/docs/stack/auth/index.md +64 -0
  213. package/src/skill/docs/stack/auth/jwt-optimization.md +245 -0
  214. package/src/skill/docs/stack/auth/plugins/aws-ses.md +127 -0
  215. package/src/skill/docs/stack/auth/plugins/combo-auth.md +74 -0
  216. package/src/skill/docs/stack/auth/plugins/index.md +228 -0
  217. package/src/skill/docs/stack/auth/plugins/upgrade-anonymous.md +155 -0
  218. package/src/skill/docs/stack/auth/security.md +455 -0
  219. package/src/skill/docs/stack/auth/using-auth.md +39 -0
  220. package/src/skill/docs/stack/cms/actions.md +199 -0
  221. package/src/skill/docs/stack/cms/components.md +479 -0
  222. package/src/skill/docs/stack/cms/connecting.md +199 -0
  223. package/src/skill/docs/stack/cms/dashboard.md +39 -0
  224. package/src/skill/docs/stack/cms/index.md +158 -0
  225. package/src/skill/docs/stack/cms/inline-editing.md +136 -0
  226. package/src/skill/docs/stack/cms/pages.md +275 -0
  227. package/src/skill/docs/stack/cms/record-layouts.md +151 -0
  228. package/src/skill/docs/stack/cms/schema-format.md +437 -0
  229. package/src/skill/docs/stack/cms/schema-registry.md +200 -0
  230. package/src/skill/docs/stack/cms/security.md +203 -0
  231. package/src/skill/docs/stack/cms/table-views.md +142 -0
  232. package/src/skill/docs/stack/index.md +65 -0
  233. package/src/skill/docs/stack/queues/handlers.md +317 -0
  234. package/src/skill/docs/stack/queues/index.md +56 -0
  235. package/src/skill/docs/stack/queues/using-queues.md +192 -0
  236. package/src/skill/docs/stack/realtime/durable-objects.md +488 -0
  237. package/src/skill/docs/stack/realtime/index.md +67 -0
  238. package/src/skill/docs/stack/realtime/using-realtime.md +211 -0
  239. package/src/skill/docs/stack/storage/index.md +17 -0
  240. package/src/skill/docs/stack/storage/kv.md +204 -0
  241. package/src/skill/docs/stack/storage/r2.md +232 -0
  242. package/src/skill/docs/stack/storage/using-kv.md +70 -0
  243. package/src/skill/docs/stack/storage/using-r2.md +55 -0
  244. package/src/skill/docs/stack/vector/embeddings.md +554 -0
  245. package/src/skill/docs/stack/vector/index.md +44 -0
  246. package/src/skill/docs/stack/vector/using-embeddings.md +186 -0
  247. package/src/skill/docs/stack/webhooks/inbound.md +186 -0
  248. package/src/skill/docs/stack/webhooks/index.md +36 -0
  249. package/src/skill/docs/stack/webhooks/outbound.md +281 -0
@@ -0,0 +1,160 @@
1
+ # With Quickback
2
+
3
+ When using Account UI with a Quickback-compiled backend, the recommended approach is to let the compiler build and embed the SPA directly into your Worker.
4
+
5
+ ## Compiler-Embedded (Recommended)
6
+
7
+ Add `account` to your `quickback.config.ts`:
8
+
9
+ ```typescript title="quickback/quickback.config.ts"
10
+ export default {
11
+ name: "my-app",
12
+ template: "hono",
13
+ account: {
14
+ domain: "auth.example.com",
15
+ name: "My App",
16
+ companyName: "My Company",
17
+ auth: {
18
+ password: true,
19
+ passkey: true,
20
+ organizations: true,
21
+ admin: true,
22
+ },
23
+ },
24
+ // ...providers
25
+ };
26
+ ```
27
+
28
+ Then compile and deploy:
29
+
30
+ ```bash
31
+ quickback compile
32
+ npx wrangler deploy
33
+ ```
34
+
35
+ ### What Happens During Compilation
36
+
37
+ 1. The compiler reads your `account` config and generates a `.env` file with the correct Vite environment variables (`VITE_QUICKBACK_URL`, `VITE_QUICKBACK_API_URL`, `VITE_ENABLE_PASSWORD`, branding, etc.)
38
+ 2. The Account SPA source is copied to a temp directory, with disabled feature routes excluded
39
+ 3. Pre-installed dependencies are symlinked (no `npm install` during build)
40
+ 4. Vite builds the SPA with your settings baked in
41
+ 5. Built assets (content-hashed filenames) are placed in the output directory
42
+
43
+ When CMS is also enabled, Account assets go to `src/apps/account/` and are served at `/account/`. When Account is the only SPA, assets go to `src/apps/` and are served at root.
44
+
45
+ ### Custom Domains
46
+
47
+ With a custom domain, the Account SPA is served at root (`/`) on that domain:
48
+
49
+ ```typescript
50
+ account: { domain: "auth.example.com" }
51
+ ```
52
+
53
+ Add an admin domain to serve the admin panel on its own subdomain:
54
+
55
+ ```typescript
56
+ account: {
57
+ domain: "auth.example.com",
58
+ adminDomain: "admin.example.com",
59
+ }
60
+ ```
61
+
62
+ See [Multi-Domain Architecture](/compiler/config/domains) for details on hostname routing and cross-subdomain cookies.
63
+
64
+ ### Auth Feature Flags
65
+
66
+ Feature flags control which pages are included in the build:
67
+
68
+ ```typescript
69
+ auth: {
70
+ password: true, // Email/password login + inline password change
71
+ emailOTP: false, // Email OTP login flow
72
+ passkey: true, // WebAuthn passkey setup + management
73
+ organizations: true, // Dashboard, org management, invitations
74
+ admin: true, // Admin panel (user management)
75
+ }
76
+ ```
77
+
78
+ Disabled features are excluded at compile time — their route files are removed before the Vite build. See [Configuration](/compiler/config) for all options.
79
+
80
+ ## Manual Deployment
81
+
82
+ If you need Account UI as a separate Worker (not embedded in the API Worker), you can deploy it standalone.
83
+
84
+ ### 1. Clone the Template
85
+
86
+ ```bash
87
+ npx degit Kardoe-com/quickback-better-auth-account-ui my-account-app
88
+ cd my-account-app
89
+ npm install
90
+ ```
91
+
92
+ ### 2. Configure for Quickback
93
+
94
+ Set the auth route mode to `quickback` to match Quickback's API paths:
95
+
96
+ ```bash title=".env"
97
+ VITE_AUTH_ROUTE=quickback
98
+ # One variable points at the Quickback origin — API, Account, and CMS are all derived from it.
99
+ VITE_QUICKBACK_URL=https://secure.example.com
100
+ VITE_ACCOUNT_APP_URL=https://account.example.com
101
+ VITE_QUICKBACK_APP_URL=https://app.example.com
102
+ ```
103
+
104
+ In Quickback mode, Account UI routes requests to three API paths:
105
+
106
+ | Path | Purpose | Examples |
107
+ |------|---------|---------|
108
+ | `/auth/v1/*` | Authentication | Login, signup, sessions, passkeys |
109
+ | `/api/v1/*` | Data API | Organizations, API keys |
110
+ | `/storage/v1/*` | File storage | Avatar uploads, file management |
111
+
112
+ ### 3. Configure Features
113
+
114
+ Match your `quickback.config.ts` plugins:
115
+
116
+ ```bash title=".env"
117
+ VITE_APP_NAME=My App
118
+ VITE_APP_TAGLINE=Build faster, ship sooner
119
+ ENABLE_SIGNUP=true
120
+ ENABLE_ORGANIZATIONS=true
121
+ ENABLE_PASSKEY=true
122
+ ENABLE_ADMIN=true
123
+ ```
124
+
125
+ ### 4. Build and Deploy
126
+
127
+ ```bash
128
+ npm run build
129
+ npx wrangler deploy
130
+ ```
131
+
132
+ ## Library Mode
133
+
134
+ Install as a dependency instead of cloning:
135
+
136
+ ```bash
137
+ npm install quickback-better-auth-account-ui
138
+ ```
139
+
140
+ ```tsx
141
+ import { AuthApp, setAppConfig } from 'quickback-better-auth-account-ui';
142
+ import 'quickback-better-auth-account-ui/styles.css';
143
+
144
+ setAppConfig({
145
+ authRoute: 'quickback',
146
+ name: 'My App',
147
+ companyName: 'My Company',
148
+ });
149
+ ```
150
+
151
+ See [Library Usage](/stack/account-ui/library-usage) for the complete guide.
152
+
153
+ ## Next Steps
154
+
155
+ - [Configuration](/compiler/config) — CMS and Account config reference
156
+ - [Multi-Domain Architecture](/compiler/config/domains) — Custom domains and hostname routing
157
+ - [Environment Variables](/stack/account-ui/environment-variables) — Complete variable reference
158
+ - [Feature Flags](/stack/account-ui/features) — Enable and disable features
159
+ - [Auth Hooks](/stack/account-ui/hooks) — Run project code on signup, login, and session events
160
+ - [Customization](/stack/account-ui/customization) — Branding, labels, and theming
@@ -0,0 +1,362 @@
1
+ # Worker Setup
2
+
3
+ > **Compiler-Embedded is Recommended**
4
+ >
5
+ > Most Quickback projects embed Account UI via the compiler (`account: { ... }` in config). The compiler builds the SPA from source with your settings baked in — no manual Worker setup needed. See [With Quickback](/stack/account-ui/with-quickback) for the recommended approach. This page is for standalone deployments where you need a separate Worker.
6
+
7
+
8
+ # Worker Setup
9
+
10
+ Deploy the Account UI as a Cloudflare Worker with static asset serving.
11
+
12
+ ## Quick Start
13
+
14
+ ### Using the Template
15
+
16
+ ```bash
17
+ npx degit Kardoe-com/quickback-better-auth-account-ui my-account-app
18
+ cd my-account-app
19
+ npm install
20
+ ```
21
+
22
+ ### Using the Library
23
+
24
+ If you're consuming Account UI as an npm package, re-export the worker from the library:
25
+
26
+ ```ts title="src/worker.ts"
27
+ export { default } from 'quickback-better-auth-account-ui/worker';
28
+ ```
29
+
30
+ Then continue with the Wrangler configuration below.
31
+
32
+ ### 2. Configure Wrangler
33
+
34
+ The template includes a `wrangler.toml` pre-configured for Cloudflare Workers:
35
+
36
+ ```toml title="wrangler.toml"
37
+ name = "my-account-app"
38
+ compatibility_date = "2025-01-01"
39
+ compatibility_flags = ["nodejs_compat"]
40
+
41
+ # Custom domain (uncomment and set your domain)
42
+ # routes = [
43
+ # { pattern = "account.example.com", custom_domain = true }
44
+ # ]
45
+
46
+ # Worker entry point
47
+ main = "src/worker.ts"
48
+
49
+ # Static assets
50
+ [assets]
51
+ binding = "ASSETS"
52
+ directory = "dist/client"
53
+ ```
54
+
55
+ ### 3. Build and Deploy
56
+
57
+ ```bash
58
+ npm run build
59
+ npx wrangler deploy
60
+ ```
61
+
62
+ ## Worker Entry Point
63
+
64
+ The worker is at `src/worker.ts`. It serves static assets and handles SPA routing:
65
+
66
+ - Static asset serving via the `ASSETS` binding
67
+ - SPA routing (all routes serve `index.html`)
68
+ - Health check endpoint (`/health`)
69
+
70
+ ### Custom Worker Logic
71
+
72
+ Edit `src/worker.ts` directly to add custom logic:
73
+
74
+ ```ts title="src/worker.ts"
75
+ export default {
76
+ async fetch(request: Request, env: Env): Promise<Response> {
77
+ const url = new URL(request.url);
78
+
79
+ // Custom health check with more info
80
+ if (url.pathname === '/health') {
81
+ return new Response(JSON.stringify({
82
+ status: 'ok',
83
+ app: 'my-account-ui',
84
+ version: '1.0.0',
85
+ timestamp: new Date().toISOString(),
86
+ }), {
87
+ headers: { 'Content-Type': 'application/json' }
88
+ });
89
+ }
90
+
91
+ // Custom analytics or logging
92
+ console.log(`${request.method} ${url.pathname}`);
93
+
94
+ // Try to serve static asset
95
+ const assetResponse = await env.ASSETS.fetch(request);
96
+
97
+ // If asset found, return it
98
+ if (assetResponse.status !== 404) {
99
+ return assetResponse;
100
+ }
101
+
102
+ // SPA routing: serve index.html for all other routes
103
+ const indexRequest = new Request(`${url.origin}/index.html`, request);
104
+ return env.ASSETS.fetch(indexRequest);
105
+ },
106
+ };
107
+ ```
108
+
109
+ ## Wrangler Configuration
110
+
111
+ ### Environment Variables
112
+
113
+ For production deployment, set environment variables in Cloudflare dashboard or via wrangler:
114
+
115
+ ```toml title="wrangler.toml"
116
+ [env.production]
117
+ name = "my-account-app"
118
+
119
+ [env.production.vars]
120
+ # Catch-all: API + Account + CMS URLs all derive from this origin.
121
+ VITE_QUICKBACK_URL = "https://secure.example.com"
122
+ VITE_ACCOUNT_APP_URL = "https://account.example.com"
123
+ VITE_APP_NAME = "My App"
124
+ VITE_QUICKBACK_APP_URL = "https://app.example.com"
125
+ ```
126
+
127
+ > **Build-Time Variables**
128
+ >
129
+ > Vite environment variables (`VITE_*`) are baked into the build at build time. Changing them in `wrangler.toml` requires rebuilding. Use `.env.production` for production builds.
130
+
131
+
132
+ ### Multiple Environments
133
+
134
+ ```toml title="wrangler.toml"
135
+ # Development
136
+ [env.dev]
137
+ name = "my-account-app-dev"
138
+ route = "account-dev.example.com/*"
139
+
140
+ [env.dev.vars]
141
+ VITE_QUICKBACK_URL = "https://secure-dev.example.com"
142
+ VITE_ACCOUNT_APP_URL = "https://account-dev.example.com"
143
+
144
+ # Staging
145
+ [env.staging]
146
+ name = "my-account-app-staging"
147
+ route = "account-staging.example.com/*"
148
+
149
+ [env.staging.vars]
150
+ VITE_QUICKBACK_URL = "https://secure-staging.example.com"
151
+ VITE_ACCOUNT_APP_URL = "https://account-staging.example.com"
152
+
153
+ # Production
154
+ [env.production]
155
+ name = "my-account-app"
156
+ route = "account.example.com/*"
157
+
158
+ [env.production.vars]
159
+ VITE_QUICKBACK_URL = "https://secure.example.com"
160
+ VITE_ACCOUNT_APP_URL = "https://account.example.com"
161
+ ```
162
+
163
+ Deploy to specific environment:
164
+
165
+ ```bash
166
+ wrangler deploy --env staging
167
+ wrangler deploy --env production
168
+ ```
169
+
170
+ ## Cloudflare Pages Alternative
171
+
172
+ You can also deploy to Cloudflare Pages instead of Workers:
173
+
174
+ ### 1. Configure Build
175
+
176
+ ```toml title="wrangler.toml"
177
+ # Remove [assets] section - Pages handles this
178
+
179
+ name = "my-account-app"
180
+ pages_build_output_dir = "dist/client"
181
+ ```
182
+
183
+ ### 2. Deploy to Pages
184
+
185
+ ```bash
186
+ # First time setup
187
+ wrangler pages project create my-account-app
188
+
189
+ # Deploy
190
+ wrangler pages deploy dist/client
191
+ ```
192
+
193
+ ### 3. Configure Environment Variables
194
+
195
+ Set environment variables in Cloudflare Pages dashboard:
196
+ 1. Go to your Pages project
197
+ 2. **Settings** → **Environment Variables**
198
+ 3. Add `VITE_*` variables
199
+ 4. Redeploy
200
+
201
+ > **Pages vs Workers**
202
+ >
203
+ > **Workers**: Better for custom server logic, middleware, edge compute
204
+ > **Pages**: Simpler for static SPAs, automatic preview deployments, built-in analytics
205
+
206
+
207
+ ## Local Development
208
+
209
+ ### Option 1: Vite Dev Server
210
+
211
+ The fastest way to develop locally:
212
+
213
+ ```bash
214
+ npx vite dev
215
+ ```
216
+
217
+ This starts the Vite dev server with hot module replacement on `localhost:5173`.
218
+
219
+ ### Option 2: Wrangler Dev
220
+
221
+ Test the worker locally with `wrangler dev`:
222
+
223
+ ```bash
224
+ npm run build && wrangler dev
225
+ ```
226
+
227
+ This runs the worker on `localhost:8787`.
228
+
229
+ ## Health Check
230
+
231
+ The worker includes a built-in health check endpoint:
232
+
233
+ ```bash
234
+ curl https://account.example.com/health
235
+ ```
236
+
237
+ Response:
238
+
239
+ ```json
240
+ {
241
+ "status": "ok",
242
+ "app": "auth-ui"
243
+ }
244
+ ```
245
+
246
+ Use this for:
247
+ - Uptime monitoring
248
+ - Load balancer health checks
249
+ - Deployment verification
250
+
251
+ ## Security Headers
252
+
253
+ Add security headers by editing `src/worker.ts`:
254
+
255
+ ```ts title="src/worker.ts"
256
+ export default {
257
+ async fetch(request: Request, env: Env): Promise<Response> {
258
+ // ... routing logic ...
259
+
260
+ // Add security headers to response
261
+ const response = await env.ASSETS.fetch(request);
262
+
263
+ const headers = new Headers(response.headers);
264
+ headers.set('X-Frame-Options', 'DENY');
265
+ headers.set('X-Content-Type-Options', 'nosniff');
266
+ headers.set('Referrer-Policy', 'strict-origin-when-cross-origin');
267
+ headers.set('Permissions-Policy', 'geolocation=(), microphone=(), camera=()');
268
+
269
+ return new Response(response.body, {
270
+ status: response.status,
271
+ statusText: response.statusText,
272
+ headers,
273
+ });
274
+ },
275
+ };
276
+ ```
277
+
278
+ ## Custom 404 Page
279
+
280
+ Serve a custom 404 page for unmatched routes:
281
+
282
+ ```ts title="src/worker.ts"
283
+ export default {
284
+ async fetch(request: Request, env: Env): Promise<Response> {
285
+ const url = new URL(request.url);
286
+
287
+ // Try to serve static asset
288
+ const assetResponse = await env.ASSETS.fetch(request);
289
+
290
+ if (assetResponse.status !== 404) {
291
+ return assetResponse;
292
+ }
293
+
294
+ // Serve index.html for SPA routes
295
+ if (!url.pathname.startsWith('/api/')) {
296
+ const indexRequest = new Request(`${url.origin}/index.html`, request);
297
+ return env.ASSETS.fetch(indexRequest);
298
+ }
299
+
300
+ // Custom 404 for API routes
301
+ return new Response('Not Found', { status: 404 });
302
+ },
303
+ };
304
+ ```
305
+
306
+ ## Deployment Checklist
307
+
308
+ Before deploying to production:
309
+
310
+ - [ ] Set all required environment variables (`VITE_QUICKBACK_URL` or `VITE_QUICKBACK_API_URL`, etc.)
311
+ - [ ] Configure custom domain in Cloudflare
312
+ - [ ] Add SSL certificate (automatic with Cloudflare)
313
+ - [ ] Test all authentication flows
314
+ - [ ] Configure DNS records
315
+ - [ ] Set up monitoring/health checks
316
+ - [ ] Test email sending
317
+ - [ ] Verify passkey functionality (requires HTTPS)
318
+ - [ ] Check CORS configuration on API
319
+ - [ ] Review security headers
320
+ - [ ] Test organization invitations
321
+ - [ ] Verify redirection to main app works
322
+
323
+ ## Troubleshooting
324
+
325
+ ### Assets Not Loading
326
+
327
+ **Problem**: 404 errors for static assets (JS, CSS)
328
+
329
+ **Solution**: Check `directory` path in `wrangler.toml`:
330
+
331
+ ```toml
332
+ [assets]
333
+ binding = "ASSETS"
334
+ directory = "dist/client" # Must point to Vite's client build output
335
+ ```
336
+
337
+ ### Environment Variables Not Working
338
+
339
+ **Problem**: Config values are undefined
340
+
341
+ **Solution**: Remember that `VITE_*` variables are build-time. Either:
342
+ 1. Set them in `.env.production` before building
343
+ 2. Use `setAppConfig()` in `src/main.tsx` for runtime overrides
344
+ 3. Edit `src/config/app.ts` defaults directly
345
+
346
+ ### SPA Routing Issues
347
+
348
+ **Problem**: Refreshing on `/profile` returns 404
349
+
350
+ **Solution**: Ensure your worker serves `index.html` for all non-asset routes:
351
+
352
+ ```ts
353
+ if (assetResponse.status === 404 && !url.pathname.startsWith('/api/')) {
354
+ return env.ASSETS.fetch(new Request(`${url.origin}/index.html`, request));
355
+ }
356
+ ```
357
+
358
+ ## Next Steps
359
+
360
+ - **[Environment Variables](/stack/account-ui/environment-variables)** - Configure your deployment
361
+ - **[Feature Flags](/stack/account-ui/features)** - Enable features
362
+ - **[Customization](/stack/account-ui/customization)** - Brand your UI
@@ -0,0 +1,15 @@
1
+ # API Keys
2
+
3
+ API keys provide programmatic access for CI/CD pipelines, scripts, and server-to-server communication.
4
+
5
+ ## Creating API Keys
6
+
7
+ Create API keys from your [Quickback account](https://account.quickback.dev/profile). Each key is scoped to your organization.
8
+
9
+ ## Usage
10
+
11
+ ```bash
12
+ QUICKBACK_API_KEY=your_api_key quickback compile
13
+ ```
14
+
15
+ API keys are validated by the same `/internal/validate` endpoint as session tokens. See [Authentication](/compiler/cloud-compiler/authentication) for details.
@@ -0,0 +1,14 @@
1
+ # Device Authorization
2
+
3
+ The Quickback CLI uses the [OAuth 2.0 Device Authorization Grant](https://datatracker.ietf.org/doc/html/rfc8628) (RFC 8628) for authentication in headless environments.
4
+
5
+ ## Flow
6
+
7
+ 1. CLI requests a device code from the API
8
+ 2. User sees a code in the terminal (e.g., `AUL8-H93S`)
9
+ 3. User visits the approval URL and enters the code
10
+ 4. CLI polls for approval and exchanges for a session token
11
+
12
+ This flow works in SSH sessions, containers, and WSL where browser redirects aren't possible.
13
+
14
+ See [CLI Reference](/compiler/cloud-compiler/cli#login) for usage details.
@@ -0,0 +1,64 @@
1
+ # Auth
2
+
3
+ Quickback Stack uses [Better Auth](https://www.better-auth.com/) for authentication, running on Cloudflare Workers with D1 as the session store.
4
+
5
+ ## Overview
6
+
7
+ Better Auth provides:
8
+ - Email/password authentication
9
+ - Session management with cookies
10
+ - Multi-tenant organizations with roles
11
+ - Plugin ecosystem for passwordless auth, passkeys, and more
12
+
13
+ ## Configuration
14
+
15
+ Auth is configured in your `quickback.config.ts`:
16
+
17
+ ```typescript
18
+ import { defineAuth, defineConfig, defineRuntime, defineDatabase } from "@quickback/compiler";
19
+
20
+ export default defineConfig({
21
+ name: "my-app",
22
+ providers: {
23
+ runtime: defineRuntime("cloudflare"),
24
+ database: defineDatabase("cloudflare-d1"),
25
+ auth: defineAuth("better-auth", {
26
+ emailAndPassword: { enabled: true },
27
+ plugins: ["emailOtp", "passkey", "magicLink"],
28
+ }),
29
+ },
30
+ });
31
+ ```
32
+
33
+ ## Auth Base Path
34
+
35
+ All Better Auth routes are served under:
36
+
37
+ ```
38
+ /auth/v1/*
39
+ ```
40
+
41
+ Common endpoints:
42
+ - `POST /auth/v1/sign-in/email` — Email/password sign in
43
+ - `POST /auth/v1/sign-up/email` — Create account
44
+ - `GET /auth/v1/get-session` — Get current session
45
+ - `POST /auth/v1/sign-out` — Sign out
46
+
47
+ ## Organization Roles
48
+
49
+ | Role | Description |
50
+ |------|-------------|
51
+ | `owner` | Full access — can delete the organization and transfer ownership |
52
+ | `admin` | Full access — can manage members and resources, cannot delete the organization |
53
+ | `member` | Standard access — read and limited write, cannot delete or manage members |
54
+
55
+ These are Better Auth's built-in organization roles — no configuration needed. The `creatorRole` defaults to `owner`.
56
+
57
+ > **Tip:** Account UI's role picker uses these exact three roles. Use `["owner", "admin", "member"]` in your [Access](/compiler/definitions/access) rules so generated projects plug into Better Auth and Account UI seamlessly.
58
+
59
+ Roles are used throughout the security layers — in [Access](/compiler/definitions/access) rules, [Firewall](/compiler/definitions/firewall) owner checks, and RLS policies.
60
+
61
+ ## Next Steps
62
+
63
+ - [Plugins](/stack/auth/plugins) — Email OTP, passkeys, magic links, and more
64
+ - [Security](/stack/auth/security) — Cookies, rate limiting, cross-domain auth