@quickback-dev/cli 0.17.1 → 0.31.1
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 +17 -1
- package/dist/commands/compile.js.map +1 -1
- package/dist/docs/content.d.ts.map +1 -1
- package/dist/docs/content.js +28 -63
- package/dist/docs/content.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/api-client.d.ts +17 -0
- package/dist/lib/api-client.d.ts.map +1 -1
- package/dist/lib/api-client.js.map +1 -1
- package/dist/lib/file-loader.d.ts +24 -0
- package/dist/lib/file-loader.d.ts.map +1 -1
- package/dist/lib/file-loader.js +46 -0
- package/dist/lib/file-loader.js.map +1 -1
- package/dist/skill/docs/changelog.md +780 -1174
- package/dist/skill/docs/compiler/cloud-compiler/cli.md +54 -33
- package/dist/skill/docs/compiler/cloud-compiler/index.md +9 -9
- package/dist/skill/docs/compiler/config/domains.md +44 -10
- package/dist/skill/docs/compiler/config/output.md +1 -1
- package/dist/skill/docs/compiler/config/providers.md +6 -12
- package/dist/skill/docs/compiler/config/variables.md +0 -30
- package/dist/skill/docs/compiler/definitions/access.md +203 -1
- package/dist/skill/docs/compiler/definitions/actions.md +40 -7
- package/dist/skill/docs/compiler/definitions/schema.md +6 -10
- package/dist/skill/docs/compiler/getting-started/template-cloudflare.md +49 -54
- package/dist/skill/docs/compiler/getting-started/templates.md +58 -56
- package/dist/skill/docs/compiler/index.md +15 -34
- package/dist/skill/docs/compiler/targets/hono-api/cloudflare.md +1 -2
- package/dist/skill/docs/compiler/targets/hono-api/database/neon.md +0 -1
- package/dist/skill/docs/compiler/targets/hono-api/using-the-api/actions-api.md +19 -0
- package/dist/skill/docs/compiler/targets/hono-api/using-the-api/batch-operations.md +1 -1
- package/dist/skill/docs/compiler/targets/index.md +6 -34
- package/dist/skill/docs/index.md +11 -5
- package/dist/skill/docs/stack/account-ui/customization.md +2 -14
- package/dist/skill/docs/stack/account-ui/environment-variables.md +7 -1
- package/dist/skill/docs/stack/account-ui/features/avatars.md +2 -4
- package/dist/skill/docs/stack/account-ui/features/index.md +1 -1
- package/dist/skill/docs/stack/account-ui/features/organizations.md +31 -11
- package/dist/skill/docs/stack/account-ui/index.md +5 -43
- package/dist/skill/docs/stack/account-ui/with-quickback.md +2 -75
- package/dist/skill/docs/stack/auth/plugins/index.md +74 -0
- package/dist/skill/docs/stack/index.md +8 -4
- package/package.json +1 -1
- package/src/skill/docs/changelog.md +780 -1174
- package/src/skill/docs/compiler/cloud-compiler/cli.md +54 -33
- package/src/skill/docs/compiler/cloud-compiler/index.md +9 -9
- package/src/skill/docs/compiler/config/domains.md +44 -10
- package/src/skill/docs/compiler/config/output.md +1 -1
- package/src/skill/docs/compiler/config/providers.md +6 -12
- package/src/skill/docs/compiler/config/variables.md +0 -30
- package/src/skill/docs/compiler/definitions/access.md +203 -1
- package/src/skill/docs/compiler/definitions/actions.md +40 -7
- package/src/skill/docs/compiler/definitions/schema.md +6 -10
- package/src/skill/docs/compiler/getting-started/template-cloudflare.md +49 -54
- package/src/skill/docs/compiler/getting-started/templates.md +58 -56
- package/src/skill/docs/compiler/index.md +15 -34
- package/src/skill/docs/compiler/targets/hono-api/cloudflare.md +1 -2
- package/src/skill/docs/compiler/targets/hono-api/database/neon.md +0 -1
- package/src/skill/docs/compiler/targets/hono-api/using-the-api/actions-api.md +19 -0
- package/src/skill/docs/compiler/targets/hono-api/using-the-api/batch-operations.md +1 -1
- package/src/skill/docs/compiler/targets/index.md +6 -34
- package/src/skill/docs/index.md +11 -5
- package/src/skill/docs/stack/account-ui/customization.md +2 -14
- package/src/skill/docs/stack/account-ui/environment-variables.md +7 -1
- package/src/skill/docs/stack/account-ui/features/avatars.md +2 -4
- package/src/skill/docs/stack/account-ui/features/index.md +1 -1
- package/src/skill/docs/stack/account-ui/features/organizations.md +31 -11
- package/src/skill/docs/stack/account-ui/index.md +5 -43
- package/src/skill/docs/stack/account-ui/with-quickback.md +2 -75
- package/src/skill/docs/stack/auth/plugins/index.md +74 -0
- package/src/skill/docs/stack/index.md +8 -4
- package/dist/skill/docs/compiler/targets/supabase-rls/index.md +0 -55
- package/dist/skill/docs/compiler/targets/supabase-rls/limitations.md +0 -48
- package/dist/skill/docs/compiler/targets/supabase-rls/mappings.md +0 -99
- package/dist/skill/docs/compiler/targets/supabase-rls/setup.md +0 -88
- package/dist/skill/docs/stack/account-ui/library-usage.md +0 -257
- package/dist/skill/docs/stack/account-ui/standalone.md +0 -149
- package/dist/skill/docs/stack/account-ui/worker.md +0 -362
- package/src/skill/docs/compiler/targets/supabase-rls/index.md +0 -55
- package/src/skill/docs/compiler/targets/supabase-rls/limitations.md +0 -48
- package/src/skill/docs/compiler/targets/supabase-rls/mappings.md +0 -99
- package/src/skill/docs/compiler/targets/supabase-rls/setup.md +0 -88
- package/src/skill/docs/stack/account-ui/library-usage.md +0 -257
- package/src/skill/docs/stack/account-ui/standalone.md +0 -149
- package/src/skill/docs/stack/account-ui/worker.md +0 -362
|
@@ -1,47 +1,19 @@
|
|
|
1
1
|
# Compile Targets
|
|
2
2
|
|
|
3
|
-
The Quickback Compiler reads a single set of definitions — schema, firewall, access, guards, masking, views, actions — and emits production
|
|
3
|
+
The Quickback Compiler reads a single set of definitions — schema, firewall, access, guards, masking, views, actions — and emits a production Hono application for the **Quickback Stack** on Cloudflare.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## [Quickback for Hono API](/compiler/targets/hono-api)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Generates a complete Hono application: routes, middleware, types, OpenAPI spec, MCP server. Pair with **Cloudflare D1** for SQLite-at-the-edge or **Neon** for full PostgreSQL with database-level RLS.
|
|
7
|
+
Generates a complete Hono application: routes, middleware, types, OpenAPI spec, MCP server, security artifacts. Pair with **Cloudflare D1** for SQLite at the edge or **Neon** for full PostgreSQL via Hyperdrive.
|
|
10
8
|
|
|
11
9
|
```typescript
|
|
12
10
|
providers: {
|
|
13
11
|
runtime: defineRuntime('cloudflare'),
|
|
14
|
-
database: defineDatabase('cloudflare-d1'),
|
|
12
|
+
database: defineDatabase('cloudflare-d1'), // or 'neon'
|
|
15
13
|
auth: defineAuth('better-auth'),
|
|
16
14
|
}
|
|
17
15
|
```
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
### [Quickback for Supabase](/compiler/targets/supabase-rls)
|
|
22
|
-
|
|
23
|
-
Generates PostgreSQL Row Level Security policies for Supabase. Keep Supabase Auth, Storage, and Realtime — Quickback adds the security layer beneath your application code.
|
|
24
|
-
|
|
25
|
-
```typescript
|
|
26
|
-
providers: {
|
|
27
|
-
runtime: defineRuntime('supabase'),
|
|
28
|
-
database: defineDatabase('supabase'),
|
|
29
|
-
auth: defineAuth('supabase-auth'),
|
|
30
|
-
}
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Use this target when you're already on Supabase and want a typed DSL for RLS.
|
|
34
|
-
|
|
35
|
-
## At a glance
|
|
36
|
-
|
|
37
|
-
| | Hono API | Supabase RLS |
|
|
38
|
-
|---|----------|--------------|
|
|
39
|
-
| What's generated | Routes, middleware, types, OpenAPI, MCP, RLS (Neon only) | RLS policies + helper functions only |
|
|
40
|
-
| Database | Cloudflare D1 or Neon Postgres | Supabase Postgres |
|
|
41
|
-
| Auth | Better Auth | Supabase Auth |
|
|
42
|
-
| Application code | Compiler-generated | You write your own |
|
|
43
|
-
| Deployment | `wrangler deploy` (or any Hono runtime) | `supabase db push` |
|
|
44
|
-
|
|
45
|
-
## The shared core
|
|
17
|
+
## The DSL
|
|
46
18
|
|
|
47
|
-
|
|
19
|
+
See [Definitions](/compiler/definitions) for the schema + security DSL — the same input drives every output the compiler emits.
|
package/dist/skill/docs/index.md
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
# Quickback Documentation
|
|
2
2
|
|
|
3
|
-
Quickback is a **backend compiler**. Define your database schema and security rules in TypeScript — Quickback compiles them into a Hono API
|
|
3
|
+
Quickback is a **backend compiler**. Define your database schema and security rules in TypeScript — Quickback compiles them into a Hono API running on Cloudflare Workers, plus the Account UI and CMS that ride alongside it. The Quickback Stack is the Supabase alternative on Cloudflare.
|
|
4
4
|
|
|
5
5
|
## Quick start
|
|
6
6
|
|
|
7
|
+
```bash
|
|
8
|
+
mkdir my-app && cd my-app
|
|
9
|
+
npx @quickback-dev/cli start
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
`start` is interactive — it asks for a template, scaffolds the project on disk, and only prompts for an account just before compiling. If you cancel at the login prompt the scaffold stays put; you can finish later with `quickback compile`.
|
|
13
|
+
|
|
14
|
+
Prefer scripting?
|
|
15
|
+
|
|
7
16
|
```bash
|
|
8
17
|
npm install -g @quickback-dev/cli
|
|
9
18
|
quickback create cloudflare my-app
|
|
@@ -40,12 +49,9 @@ Request → Firewall → Access → Guards → Masking → Response
|
|
|
40
49
|
|
|
41
50
|
### Quickback Compiler
|
|
42
51
|
|
|
43
|
-
[**Quickback Compiler**](/compiler) — the build tool. Define your schema and security rules in TypeScript and compile to
|
|
52
|
+
[**Quickback Compiler**](/compiler) — the build tool. Define your schema and security rules in TypeScript and compile to a complete Hono application on Cloudflare:
|
|
44
53
|
|
|
45
54
|
- **[Quickback for Hono API](/compiler/targets/hono-api)** — A complete Hono application on Cloudflare D1 or Neon, with CRUD, batch endpoints, OpenAPI, and an MCP server.
|
|
46
|
-
- **[Quickback for Supabase](/compiler/targets/supabase-rls)** — PostgreSQL Row Level Security policies for Supabase. Keep Supabase Auth, Storage, and Realtime; Quickback adds the security layer.
|
|
47
|
-
|
|
48
|
-
The same `defineTable()` definitions work for both targets.
|
|
49
55
|
|
|
50
56
|
**Start here:**
|
|
51
57
|
- **[Getting Started](/compiler/getting-started)** — Create your first project
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
# Customization
|
|
2
2
|
|
|
3
|
-
Customize the Account UI to match your brand and messaging.
|
|
4
|
-
|
|
5
|
-
**Standalone (template):** Configure via environment variables, edit `src/config/app.ts` directly, or use `setAppConfig()` for runtime overrides.
|
|
6
|
-
|
|
7
|
-
**Library (npm):** Configure entirely via `setAppConfig()`. Import it from `quickback-better-auth-account-ui` instead of `@/config/app`.
|
|
8
|
-
|
|
9
|
-
> **Library imports**
|
|
10
|
-
>
|
|
11
|
-
> All `setAppConfig` examples below use the standalone import path (`@/config/app`). If you're using library mode, replace with:
|
|
12
|
-
> ```ts
|
|
13
|
-
> import { setAppConfig } from 'quickback-better-auth-account-ui';
|
|
14
|
-
> ```
|
|
15
|
-
|
|
3
|
+
Customize the Account UI to match your brand and messaging. Branding is driven by the `account` block in `quickback.config.ts` and the environment variables the compiler bakes in at build time.
|
|
16
4
|
|
|
17
5
|
## Branding
|
|
18
6
|
|
|
@@ -373,6 +361,6 @@ import './custom-styles.css'; // Your overrides
|
|
|
373
361
|
|
|
374
362
|
## Next Steps
|
|
375
363
|
|
|
376
|
-
- **[
|
|
364
|
+
- **[With Quickback](/stack/account-ui/with-quickback)** - How the compiler builds and bundles your customized UI
|
|
377
365
|
- **[Environment Variables](/stack/account-ui/environment-variables)** - Complete configuration reference
|
|
378
366
|
- **[Feature Flags](/stack/account-ui/features)** - Enable/disable features
|
|
@@ -167,6 +167,11 @@ VITE_ENABLE_FILE_UPLOADS=false
|
|
|
167
167
|
```bash
|
|
168
168
|
# Enable multi-tenant organizations (default: true)
|
|
169
169
|
ENABLE_ORGANIZATIONS=true
|
|
170
|
+
|
|
171
|
+
# Enable Teams (sub-groups within an organization) (default: false)
|
|
172
|
+
# Auto-set to true when the BA config has organization({ teams: { enabled: true } }).
|
|
173
|
+
# When false the Teams tab is hidden and the auth client doesn't expose team APIs.
|
|
174
|
+
VITE_ENABLE_ORG_TEAMS=false
|
|
170
175
|
```
|
|
171
176
|
|
|
172
177
|
### Admin Features
|
|
@@ -218,6 +223,7 @@ ENABLE_PASSKEY=true
|
|
|
218
223
|
ENABLE_EMAIL_OTP=true
|
|
219
224
|
ENABLE_PASSWORD=false
|
|
220
225
|
ENABLE_ORGANIZATIONS=true
|
|
226
|
+
VITE_ENABLE_ORG_TEAMS=true
|
|
221
227
|
ENABLE_ADMIN=true
|
|
222
228
|
VITE_ENABLE_FILE_UPLOADS=true
|
|
223
229
|
DISABLE_EMAIL_STATUS_CHECK=false
|
|
@@ -322,4 +328,4 @@ Check the browser console for configuration warnings.
|
|
|
322
328
|
|
|
323
329
|
- **[Feature Flags](/stack/account-ui/features)** - Detailed feature configuration
|
|
324
330
|
- **[Customization](/stack/account-ui/customization)** - Customize labels and messages
|
|
325
|
-
- **[
|
|
331
|
+
- **[With Quickback](/stack/account-ui/with-quickback)** - How the compiler builds and bundles Account UI
|
|
@@ -13,9 +13,7 @@ account: {
|
|
|
13
13
|
}
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
The compiler emits `VITE_ENABLE_FILE_UPLOADS=true` into the Account SPA's
|
|
17
|
-
build env. For standalone Account UI deployments (built outside the
|
|
18
|
-
compiler), set `VITE_ENABLE_FILE_UPLOADS=true` in `.env` directly.
|
|
16
|
+
The compiler emits `VITE_ENABLE_FILE_UPLOADS=true` into the Account SPA's build env.
|
|
19
17
|
|
|
20
18
|
## Upload Flow
|
|
21
19
|
|
|
@@ -27,7 +25,7 @@ compiler), set `VITE_ENABLE_FILE_UPLOADS=true` in `.env` directly.
|
|
|
27
25
|
|
|
28
26
|
## Requirements
|
|
29
27
|
|
|
30
|
-
- `account.fileUploads: true`
|
|
28
|
+
- `account.fileUploads: true`
|
|
31
29
|
- R2 bucket or S3-compatible storage configured
|
|
32
30
|
- Upload endpoints available in your API
|
|
33
31
|
|
|
@@ -288,4 +288,4 @@ DISABLE_EMAIL_STATUS_CHECK=true # Allow test emails
|
|
|
288
288
|
|
|
289
289
|
- **[Environment Variables](/stack/account-ui/environment-variables)** - Complete variable reference
|
|
290
290
|
- **[Customization](/stack/account-ui/customization)** - Customize UI text and labels
|
|
291
|
-
- **[
|
|
291
|
+
- **[With Quickback](/stack/account-ui/with-quickback)** - How the compiler builds Account UI into your Worker
|
|
@@ -1,27 +1,47 @@
|
|
|
1
1
|
# Organizations
|
|
2
2
|
|
|
3
|
-
Account UI provides a complete organization management interface when `
|
|
3
|
+
Account UI provides a complete organization management interface when `VITE_ENABLE_ORGANIZATIONS=true`. Teams are a separate opt-in (`VITE_ENABLE_ORG_TEAMS`), surfaced when the compiler detects `organization({ teams: { enabled: true } })` in the Better Auth config.
|
|
4
4
|
|
|
5
5
|
## Organization CRUD
|
|
6
6
|
|
|
7
|
-
- Create new organizations
|
|
8
|
-
- Update
|
|
9
|
-
- Delete organizations (owner
|
|
7
|
+
- Create new organizations, with `checkSlug` debounce on the slug field
|
|
8
|
+
- Update name, **slug** (rename navigates to the new URL), **metadata** (JSON object), and logo
|
|
9
|
+
- Delete organizations — gated on the `organization:delete` permission (default: owner)
|
|
10
10
|
|
|
11
11
|
## Member Management
|
|
12
12
|
|
|
13
|
-
- Invite members by email
|
|
13
|
+
- Invite members by email (with an optional team picker when teams are enabled)
|
|
14
14
|
- Assign roles: **owner**, **admin**, **member**
|
|
15
|
-
-
|
|
16
|
-
-
|
|
15
|
+
- Change roles and remove members — actions are filtered per-target by the role hierarchy (non-owners can't manage owner-role members)
|
|
16
|
+
- Leave the organization
|
|
17
|
+
|
|
18
|
+
> **Note:** These three roles (`owner`, `admin`, `member`) are Better Auth's built-in organization roles and map directly to Account UI's role picker. Use the same roles in your Quickback [Access](/compiler/definitions/access) rules — with [`auth.roleHierarchy`](/compiler/definitions/access#role-hierarchy) configured, you can write `roles: ["member+"]` to mean "member and above."
|
|
17
19
|
|
|
18
20
|
## Invitations
|
|
19
21
|
|
|
20
|
-
- Pending invitation list
|
|
21
|
-
- Resend
|
|
22
|
-
-
|
|
22
|
+
- Pending invitation list, per organization
|
|
23
|
+
- Resend, cancel (per-org), accept, and reject (per-user)
|
|
24
|
+
- Pending invites across organizations land on the user's `/dashboard`
|
|
25
|
+
- Invitations carry an optional `teamId` when teams are enabled — the invitee joins that team on accept
|
|
23
26
|
|
|
24
|
-
|
|
27
|
+
## Teams
|
|
28
|
+
|
|
29
|
+
Set `organization({ teams: { enabled: true } })` in your Better Auth config. The compiler emits `VITE_ENABLE_ORG_TEAMS=true` and the SPA exposes:
|
|
30
|
+
|
|
31
|
+
- **Teams tab** on each organization, split into "Your teams" and "Other teams"
|
|
32
|
+
- **Team detail** page with member roster, add/remove members
|
|
33
|
+
- **Active-team picker** in the organization header — switches `session.activeTeamId` via `setActiveTeam`, so server-side handlers can scope by team
|
|
34
|
+
- **Team-aware invitations** — when sending an invite, optionally pick a team; the member is added on accept
|
|
35
|
+
|
|
36
|
+
Per-team actions (create / rename / delete / add-member / remove-member) gate on the `team:create`, `team:update`, and `team:delete` permissions from Better Auth's default statements.
|
|
37
|
+
|
|
38
|
+
## Permission-aware UI
|
|
39
|
+
|
|
40
|
+
Account UI uses Better Auth's `checkRolePermission` API instead of hardcoded role checks. The `OrganizationContext` exposes a `can(resource, action)` helper that handles the default statements (`organization`, `member`, `invitation`, `team`, `ac`) and respects any custom roles you've registered via the BA `ac` option.
|
|
41
|
+
|
|
42
|
+
Multi-role users — Better Auth stores multiple roles as a comma-separated string — are handled by checking each role independently; the action is allowed if any one of them grants it.
|
|
43
|
+
|
|
44
|
+
This means projects that ship custom roles get a UI that matches what their server actually authorizes, without modifying the Account SPA.
|
|
25
45
|
|
|
26
46
|
## Related
|
|
27
47
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Quickback Account UI
|
|
2
2
|
|
|
3
|
-
A complete authentication and account management frontend. It handles login, signup, password reset, profile management, device sessions, passkeys, organizations, and admin — so you don't have to build any of it.
|
|
3
|
+
A complete authentication and account management frontend that ships with the Quickback Stack. It handles login, signup, password reset, profile management, device sessions, passkeys, organizations, and admin — so you don't have to build any of it.
|
|
4
4
|
|
|
5
5
|
## What's Included
|
|
6
6
|
|
|
@@ -20,9 +20,9 @@ Dashboard with org switching, org creation, member invitations, role management,
|
|
|
20
20
|
|
|
21
21
|
User management dashboard — view all users, search, create accounts, ban/unban, reset passwords, and manage sessions. Only accessible to users with the `admin` role. Can be served on its own domain (e.g., `admin.example.com`) via the `adminDomain` config.
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## How to Enable
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
Add `account` to your `quickback.config.ts` and compile. The compiler builds the SPA from source with your project-specific settings baked in and bundles it into your Worker.
|
|
26
26
|
|
|
27
27
|
```typescript title="quickback/quickback.config.ts"
|
|
28
28
|
export default {
|
|
@@ -53,7 +53,7 @@ That's it. The compiler:
|
|
|
53
53
|
2. Generates a `.env` file with the correct `VITE_*` variables
|
|
54
54
|
3. Builds the SPA from source with Vite (inside Docker)
|
|
55
55
|
4. Excludes routes for disabled features (compile-time tree shaking)
|
|
56
|
-
5.
|
|
56
|
+
5. Bundles the built assets into your Worker alongside the API
|
|
57
57
|
|
|
58
58
|
No manual `.env` configuration needed. No separate deployment.
|
|
59
59
|
|
|
@@ -91,42 +91,6 @@ Auth feature flags control which pages are included in the bundle:
|
|
|
91
91
|
|
|
92
92
|
When a flag is `false`, the corresponding route files are **removed before the Vite build** — they never appear in the JavaScript bundle. This keeps production bundles minimal.
|
|
93
93
|
|
|
94
|
-
## Standalone Usage
|
|
95
|
-
|
|
96
|
-
Account UI also works outside of Quickback:
|
|
97
|
-
|
|
98
|
-
### Template (own the source)
|
|
99
|
-
|
|
100
|
-
Clone the repo and customize directly:
|
|
101
|
-
|
|
102
|
-
```bash
|
|
103
|
-
npx degit Kardoe-com/quickback-better-auth-account-ui my-account-app
|
|
104
|
-
cd my-account-app
|
|
105
|
-
npm install
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
Configure via `.env` files and deploy as a standalone Cloudflare Worker. See [Standalone Usage](/stack/account-ui/standalone) for Better Auth backends or [With Quickback](/stack/account-ui/with-quickback) for Quickback-compiled backends.
|
|
109
|
-
|
|
110
|
-
### Library (npm package)
|
|
111
|
-
|
|
112
|
-
Install as a dependency:
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
npm install quickback-better-auth-account-ui
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
```tsx
|
|
119
|
-
import { AuthApp, setAppConfig } from 'quickback-better-auth-account-ui';
|
|
120
|
-
import 'quickback-better-auth-account-ui/styles.css';
|
|
121
|
-
|
|
122
|
-
setAppConfig({
|
|
123
|
-
authRoute: 'quickback',
|
|
124
|
-
name: 'My App',
|
|
125
|
-
});
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
See [Library Usage](/stack/account-ui/library-usage) for details.
|
|
129
|
-
|
|
130
94
|
## Features
|
|
131
95
|
|
|
132
96
|
- **Authentication** — Email/password, passkeys (WebAuthn), email OTP, magic links, email verification, password reset
|
|
@@ -138,9 +102,7 @@ See [Library Usage](/stack/account-ui/library-usage) for details.
|
|
|
138
102
|
|
|
139
103
|
## Next Steps
|
|
140
104
|
|
|
141
|
-
- **[With Quickback](/stack/account-ui/with-quickback)** —
|
|
142
|
-
- **[Standalone Usage](/stack/account-ui/standalone)** — Use with any Better Auth backend
|
|
143
|
-
- **[Library Usage](/stack/account-ui/library-usage)** — Import as an npm package
|
|
105
|
+
- **[With Quickback](/stack/account-ui/with-quickback)** — Configuration reference for the `account` block
|
|
144
106
|
- **[Feature Flags](/stack/account-ui/features)** — Enable and disable features
|
|
145
107
|
- **[Environment Variables](/stack/account-ui/environment-variables)** — Configuration reference
|
|
146
108
|
- **[Customization](/stack/account-ui/customization)** — Branding, labels, and theming
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# With Quickback
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Account UI is part of the Quickback Stack. The compiler builds it from source and bundles it into your Worker — there is no separate npm package or standalone deploy path.
|
|
4
4
|
|
|
5
|
-
## Compiler-Embedded
|
|
5
|
+
## Compiler-Embedded
|
|
6
6
|
|
|
7
7
|
Add `account` to your `quickback.config.ts`:
|
|
8
8
|
|
|
@@ -77,79 +77,6 @@ auth: {
|
|
|
77
77
|
|
|
78
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
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
80
|
## Next Steps
|
|
154
81
|
|
|
155
82
|
- [Configuration](/compiler/config) — CMS and Account config reference
|
|
@@ -331,6 +331,80 @@ Better Auth's older `better-auth/plugins/mcp` is being deprecated in favour of `
|
|
|
331
331
|
|
|
332
332
|
Keep `apiKey` enabled alongside it — server-to-server flows (cron, scripts) want a static key; OAuth is for interactive clients.
|
|
333
333
|
|
|
334
|
+
### Custom plugins (escape hatch)
|
|
335
|
+
|
|
336
|
+
The named plugins above cover the curated set Quickback ships first-class wiring for. For anything else — third-party packages (`@better-auth-kit/audit`, …), Better Auth built-ins outside the registry, or project-local plugins — use `customPlugins`.
|
|
337
|
+
|
|
338
|
+
```ts
|
|
339
|
+
auth: defineAuth("better-auth", {
|
|
340
|
+
emailAndPassword: { enabled: true },
|
|
341
|
+
plugins: { passkey: true, organization: true },
|
|
342
|
+
customPlugins: [
|
|
343
|
+
// (1) Project-local plugin file at quickback/plugins/long-session.ts
|
|
344
|
+
{ from: "./plugins/long-session", export: "longSessionPlugin" },
|
|
345
|
+
// (2) Third-party npm package
|
|
346
|
+
{
|
|
347
|
+
from: "@better-auth-kit/audit",
|
|
348
|
+
export: "auditPlugin",
|
|
349
|
+
args: { events: ["sign-in"] },
|
|
350
|
+
dependencies: { "@better-auth-kit/audit": "^1.0.0" },
|
|
351
|
+
},
|
|
352
|
+
],
|
|
353
|
+
}),
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
Each entry in `customPlugins` is an explicit import descriptor. The compiler runs each through Zod, then emits an `import { <export> } from "<from>"` line in the generated `src/lib/auth.ts` and appends the call (or bare symbol) to the `plugins: [...]` array — after the named plugins, in declared order.
|
|
357
|
+
|
|
358
|
+
#### `from`
|
|
359
|
+
|
|
360
|
+
- **Relative path** (must start with `./` or `../`, must resolve under `./plugins/`): refers to a file you author in `quickback/plugins/`. The CLI auto-discovers `quickback/plugins/**/*.ts` and ships matching files; the compiler copies the source into the generated output at `src/plugins/<name>.ts` and rewrites the emitted import path. Files in `quickback/plugins/` that aren't referenced by any descriptor are uploaded but ignored — the compiler picks only what's needed.
|
|
361
|
+
- **Bare specifier** (any value not starting with `./` or `../`): treated as an npm import, emitted verbatim. Combine with `dependencies` so the package lands in the generated `package.json`.
|
|
362
|
+
|
|
363
|
+
#### `export`
|
|
364
|
+
|
|
365
|
+
The named export to import. Must be a valid JS identifier (e.g. `longSessionPlugin`, `auditPlugin`). Use the symbol's source name from the file or package — Quickback emits the import as-is.
|
|
366
|
+
|
|
367
|
+
#### `args` (optional)
|
|
368
|
+
|
|
369
|
+
- **Omitted** → emits the symbol uncalled (`plugins: [..., longSessionPlugin]`). Use this when your export is already a `BetterAuthPlugin` instance.
|
|
370
|
+
- **Provided** → emits a factory call with JSON-serialized args (`plugins: [..., auditPlugin({"events":["sign-in"]})]`). The value must be JSON-serializable; functions and other non-serializable values fail at compile time. (The user config crosses an HTTP boundary as JSON, so this constraint exists by construction.)
|
|
371
|
+
|
|
372
|
+
#### `dependencies` (optional)
|
|
373
|
+
|
|
374
|
+
`Record<string, string>` of npm packages and version specs. Merged into the generated `package.json` alongside the named-plugin deps. Only meaningful for bare-specifier `from` — relative-path entries don't need to declare anything.
|
|
375
|
+
|
|
376
|
+
#### Project-local plugin shape
|
|
377
|
+
|
|
378
|
+
A plugin file in `quickback/plugins/` is plain Better Auth — the compiler doesn't transform it. Author it like any other BA plugin and let TypeScript check it against the `BetterAuthPlugin` type:
|
|
379
|
+
|
|
380
|
+
```ts
|
|
381
|
+
// quickback/plugins/long-session.ts
|
|
382
|
+
import type { BetterAuthPlugin } from "better-auth";
|
|
383
|
+
|
|
384
|
+
export const longSessionPlugin = {
|
|
385
|
+
id: "long-session",
|
|
386
|
+
databaseHooks: {
|
|
387
|
+
session: {
|
|
388
|
+
create: {
|
|
389
|
+
before: async (session) => ({
|
|
390
|
+
data: {
|
|
391
|
+
...session,
|
|
392
|
+
// 5-year session for an event-app use case
|
|
393
|
+
expiresAt: new Date(Date.now() + 5 * 365 * 24 * 60 * 60 * 1000),
|
|
394
|
+
},
|
|
395
|
+
}),
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
},
|
|
399
|
+
} satisfies BetterAuthPlugin;
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
#### Out of scope
|
|
403
|
+
|
|
404
|
+
- **No schema generation.** If your plugin needs database tables, declare them as a Quickback feature — the compiler does not run schema introspection on custom plugins.
|
|
405
|
+
- **No conditional inclusion.** Every entry in `customPlugins` is always emitted. Gate environment-specific plugins inside the plugin file itself.
|
|
406
|
+
- **No name collision check against the named registry.** Duplicate registration is a Better Auth runtime concern, not a compile-time one — don't reach for `customPlugins` to override a named plugin's options; use the object form on `plugins` instead.
|
|
407
|
+
|
|
334
408
|
## Where This Runs
|
|
335
409
|
|
|
336
410
|
All Better Auth plugin routes are served under your auth base path:
|
|
@@ -51,13 +51,17 @@ Quickback provides the architecture and the code generation. You own the infrast
|
|
|
51
51
|
## Quick start
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
# Scaffold + compile interactively
|
|
55
|
+
mkdir my-app && cd my-app
|
|
56
|
+
npx @quickback-dev/cli start
|
|
57
|
+
|
|
58
|
+
# Deploy to your Cloudflare account
|
|
59
|
+
npm i -g wrangler
|
|
58
60
|
wrangler deploy
|
|
59
61
|
```
|
|
60
62
|
|
|
63
|
+
`start` handles scaffold, login (only when needed), and the first compile in one shot. The deploy step uses your own wrangler auth and ships everything to your Cloudflare account.
|
|
64
|
+
|
|
61
65
|
## See also
|
|
62
66
|
|
|
63
67
|
- [Quickback Compiler](/compiler) — the build tool that generates your API
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quickback-dev/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.1",
|
|
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",
|