create-questpie 1.0.0 → 2.0.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/README.md +20 -12
- package/dist/index.mjs +10 -3
- package/package.json +21 -21
- package/templates/tanstack-start/AGENTS.md +371 -318
- package/templates/tanstack-start/CLAUDE.md +84 -52
- package/templates/tanstack-start/README.md +65 -52
- package/templates/tanstack-start/components.json +20 -20
- package/templates/tanstack-start/package.json +6 -0
- package/templates/tanstack-start/questpie.config.ts +7 -7
- package/templates/tanstack-start/src/lib/auth-client.ts +3 -3
- package/templates/tanstack-start/src/lib/client.ts +13 -0
- package/templates/tanstack-start/src/lib/env.ts +19 -22
- package/templates/tanstack-start/src/lib/query-client.ts +5 -5
- package/templates/tanstack-start/src/questpie/admin/.generated/client.ts +13 -0
- package/templates/tanstack-start/src/questpie/admin/admin.ts +8 -4
- package/templates/tanstack-start/src/questpie/admin/modules.ts +1 -0
- package/templates/tanstack-start/src/questpie/server/.generated/factories.ts +194 -0
- package/templates/tanstack-start/src/questpie/server/.generated/index.ts +201 -0
- package/templates/tanstack-start/src/questpie/server/app.ts +10 -52
- package/templates/tanstack-start/src/questpie/server/collections/posts.collection.ts +39 -53
- package/templates/tanstack-start/src/questpie/server/config/admin.ts +83 -0
- package/templates/tanstack-start/src/questpie/server/config/auth.ts +8 -0
- package/templates/tanstack-start/src/questpie/server/config/openapi.ts +10 -0
- package/templates/tanstack-start/src/questpie/server/globals/site-settings.global.ts +9 -14
- package/templates/tanstack-start/src/questpie/server/modules.ts +10 -0
- package/templates/tanstack-start/src/questpie/server/questpie.config.ts +20 -0
- package/templates/tanstack-start/src/router.tsx +6 -5
- package/templates/tanstack-start/src/routes/__root.tsx +11 -9
- package/templates/tanstack-start/src/routes/admin/$.tsx +14 -13
- package/templates/tanstack-start/src/routes/admin/index.tsx +11 -10
- package/templates/tanstack-start/src/routes/admin/login.tsx +11 -10
- package/templates/tanstack-start/src/routes/admin.tsx +53 -52
- package/templates/tanstack-start/src/routes/api/{cms/$.ts → $.ts} +6 -20
- package/templates/tanstack-start/src/styles.css +109 -109
- package/templates/tanstack-start/tsconfig.json +27 -25
- package/templates/tanstack-start/vite.config.ts +5 -3
- package/templates/tanstack-start/src/lib/cms-client.ts +0 -12
- package/templates/tanstack-start/src/migrations/index.ts +0 -8
- package/templates/tanstack-start/src/questpie/admin/builder.ts +0 -4
- package/templates/tanstack-start/src/questpie/server/builder.ts +0 -4
- package/templates/tanstack-start/src/questpie/server/dashboard.ts +0 -68
- package/templates/tanstack-start/src/questpie/server/rpc.ts +0 -4
- package/templates/tanstack-start/src/questpie/server/sidebar.ts +0 -26
|
@@ -1,54 +1,74 @@
|
|
|
1
1
|
# CLAUDE.md
|
|
2
2
|
|
|
3
|
-
This is a [QUESTPIE
|
|
3
|
+
This is a [QUESTPIE](https://questpie.com) project scaffolded with `create-questpie`.
|
|
4
4
|
|
|
5
5
|
## Quick Reference
|
|
6
6
|
|
|
7
|
-
| Command
|
|
8
|
-
|
|
|
9
|
-
| `bun dev`
|
|
10
|
-
| `bun build`
|
|
11
|
-
| `bun start`
|
|
12
|
-
| `bun questpie
|
|
13
|
-
| `bun questpie
|
|
14
|
-
| `
|
|
7
|
+
| Command | Purpose |
|
|
8
|
+
| -------------------------------- | ---------------------------------------------- |
|
|
9
|
+
| `bun dev` | Start dev server (port 3000) |
|
|
10
|
+
| `bun build` | Build for production |
|
|
11
|
+
| `bun start` | Start production server |
|
|
12
|
+
| `bun questpie add <type> <name>` | Scaffold a new entity (collection, seed, etc.) |
|
|
13
|
+
| `bun questpie add --list` | List all available scaffold types |
|
|
14
|
+
| `bun questpie generate` | Regenerate .generated/index.ts |
|
|
15
|
+
| `bun questpie migrate:create` | Generate a migration from schema diff |
|
|
16
|
+
| `bun questpie migrate` | Run pending migrations |
|
|
17
|
+
| `bun questpie seed` | Run pending seeds |
|
|
18
|
+
| `docker compose up -d` | Start PostgreSQL |
|
|
15
19
|
|
|
16
20
|
## Project Architecture
|
|
17
21
|
|
|
18
22
|
This project follows QUESTPIE's **server-first** philosophy:
|
|
23
|
+
|
|
19
24
|
- **Server** defines WHAT (schema, validation, access, hooks, jobs)
|
|
20
25
|
- **Client** defines HOW (rendering, themes, custom components)
|
|
21
26
|
|
|
22
27
|
```
|
|
23
28
|
src/questpie/
|
|
24
|
-
server/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
server/ ← WHAT: data contracts and behavior
|
|
30
|
+
questpie.config.ts ← App config: runtimeConfig({ db, app, ... })
|
|
31
|
+
modules.ts ← Module dependencies (adminModule, openApiModule, etc.)
|
|
32
|
+
config/ ← Typed configuration files
|
|
33
|
+
auth.ts ← authConfig({...}) — Better Auth options
|
|
34
|
+
admin.ts ← adminConfig({ sidebar, dashboard, branding, locale })
|
|
35
|
+
openapi.ts ← openApiConfig({ info, scalar })
|
|
36
|
+
app.ts ← (optional) appConfig({ locale, access, hooks, context })
|
|
37
|
+
.generated/ ← Codegen output (app instance + App type)
|
|
38
|
+
index.ts
|
|
39
|
+
collections/ ← One file per collection (auto-discovered)
|
|
40
|
+
globals/ ← One file per global (auto-discovered)
|
|
41
|
+
routes/ ← Server routes via route() (auto-discovered)
|
|
42
|
+
jobs/ ← Background job definitions (auto-discovered)
|
|
43
|
+
blocks/ ← Block definitions (auto-discovered)
|
|
44
|
+
admin/ ← HOW: UI rendering concerns
|
|
45
|
+
admin.ts ← Re-exports generated admin config
|
|
46
|
+
.generated/ ← Codegen output (admin client config)
|
|
47
|
+
client.ts
|
|
35
48
|
```
|
|
36
49
|
|
|
37
50
|
## Key Files
|
|
38
51
|
|
|
39
|
-
- **`src/questpie/server/
|
|
52
|
+
- **`src/questpie/server/questpie.config.ts`** — App config: `runtimeConfig({ db, app, ... })`.
|
|
53
|
+
- **`src/questpie/server/modules.ts`** — Module dependencies: `export default [adminModule, openApiModule] as const`.
|
|
54
|
+
- **`src/questpie/server/config/auth.ts`** — Auth config via `authConfig()` factory.
|
|
55
|
+
- **`src/questpie/server/config/admin.ts`** — Admin config (sidebar, dashboard, branding, locale) via `adminConfig()` factory.
|
|
56
|
+
- **`src/questpie/server/config/app.ts`** — *(optional, not scaffolded)* App config (locale, access, hooks, context) via `appConfig()`. Create when needed.
|
|
57
|
+
- **`src/questpie/server/.generated/index.ts`** — Codegen output. Exports typed `app` instance and `App` type. Run `bunx questpie generate` to regenerate.
|
|
40
58
|
- **`src/lib/env.ts`** — Type-safe env variables via `@t3-oss/env-core`. Add new env vars here with Zod schemas.
|
|
41
59
|
- **`questpie.config.ts`** — CLI config (migration directory, app reference).
|
|
42
|
-
- **`src/routes/api
|
|
60
|
+
- **`src/routes/api/$.ts`** — API catch-all handler. Serves REST + OpenAPI docs at `/api/docs`.
|
|
43
61
|
|
|
44
62
|
## Environment Variables
|
|
45
63
|
|
|
46
64
|
Defined in `src/lib/env.ts` with runtime validation. See `.env.example` for all available variables.
|
|
47
65
|
|
|
48
66
|
Required:
|
|
67
|
+
|
|
49
68
|
- `DATABASE_URL` — PostgreSQL connection string
|
|
50
69
|
|
|
51
70
|
Optional (with defaults):
|
|
71
|
+
|
|
52
72
|
- `APP_URL` — Application URL (default: `http://localhost:3000`)
|
|
53
73
|
- `BETTER_AUTH_SECRET` — Auth secret key
|
|
54
74
|
- `MAIL_ADAPTER` — `console` or `smtp`
|
|
@@ -57,49 +77,61 @@ Optional (with defaults):
|
|
|
57
77
|
|
|
58
78
|
### Add a new collection
|
|
59
79
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
80
|
+
Preferred workflow:
|
|
81
|
+
|
|
82
|
+
1. Run `bun questpie add collection my-thing`
|
|
83
|
+
2. The CLI creates the file and auto-runs codegen
|
|
84
|
+
3. Run `bun questpie migrate:create`
|
|
85
|
+
|
|
86
|
+
Manual workflow:
|
|
87
|
+
|
|
88
|
+
1. Create `src/questpie/server/collections/my-thing.ts` with a named export:
|
|
89
|
+
```ts
|
|
90
|
+
import { collection } from "#questpie/factories";
|
|
91
|
+
export const myThing = collection("my-thing").fields(({ f }) => ({ ... }));
|
|
92
|
+
```
|
|
93
|
+
2. Run `bunx questpie generate` to regenerate `.generated/index.ts`
|
|
94
|
+
3. Run `bun questpie migrate:create` to generate migration
|
|
95
|
+
|
|
96
|
+
Collections are auto-discovered by codegen — no manual registration needed.
|
|
65
97
|
|
|
66
98
|
### Add a new global
|
|
67
99
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
100
|
+
Preferred workflow:
|
|
101
|
+
|
|
102
|
+
1. Run `bun questpie add global my-global`
|
|
103
|
+
2. The CLI creates the file and auto-runs codegen
|
|
104
|
+
3. Run `bun questpie migrate:create`
|
|
105
|
+
|
|
106
|
+
Manual workflow:
|
|
107
|
+
|
|
108
|
+
1. Create `src/questpie/server/globals/my-global.ts` with a named export
|
|
109
|
+
2. Run `bunx questpie generate`
|
|
110
|
+
3. Run `bun questpie migrate:create`
|
|
73
111
|
|
|
74
|
-
### Add
|
|
112
|
+
### Add a server route (end-to-end type-safe)
|
|
75
113
|
|
|
76
|
-
|
|
114
|
+
1. Create `src/questpie/server/routes/my-function.ts`:
|
|
77
115
|
|
|
78
|
-
1. Create `src/questpie/server/functions/my-function.ts`:
|
|
79
116
|
```ts
|
|
80
|
-
import {
|
|
117
|
+
import { route } from "questpie";
|
|
81
118
|
import { z } from "zod";
|
|
82
119
|
|
|
83
|
-
export
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
});
|
|
91
|
-
```
|
|
92
|
-
2. Register in `app.ts` → `appRpc = r.router({ ...adminRpc, myFunction })`
|
|
93
|
-
3. Call from client (fully typed):
|
|
94
|
-
```ts
|
|
95
|
-
const result = await client.rpc.myFunction({ id: "123" });
|
|
96
|
-
// result: { name: string } — inferred from handler return type
|
|
120
|
+
export default route()
|
|
121
|
+
.post()
|
|
122
|
+
.schema(z.object({ id: z.string() }))
|
|
123
|
+
.handler(async ({ input, collections }) => {
|
|
124
|
+
// input: typed from Zod schema; collections, db, session, etc. from AppContext
|
|
125
|
+
return { name: "result" };
|
|
126
|
+
});
|
|
97
127
|
```
|
|
98
128
|
|
|
99
|
-
|
|
129
|
+
2. Run `bunx questpie generate` — route is auto-discovered and available at `/api/my-function`
|
|
130
|
+
|
|
131
|
+
See AGENTS.md for detailed route patterns, access control, and TanStack Query integration.
|
|
100
132
|
|
|
101
133
|
## Documentation
|
|
102
134
|
|
|
103
135
|
- **QUESTPIE Docs**: https://questpie.com/docs
|
|
104
136
|
- **Getting Started**: https://questpie.com/docs/getting-started
|
|
105
|
-
- **API Reference (local)**: http://localhost:3000/api/
|
|
137
|
+
- **API Reference (local)**: http://localhost:3000/api/docs (Scalar UI, available when dev server is running)
|
|
@@ -1,94 +1,107 @@
|
|
|
1
1
|
# {{projectName}}
|
|
2
2
|
|
|
3
|
-
A [QUESTPIE
|
|
3
|
+
A [QUESTPIE](https://questpie.com) app built with TanStack Start.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Quick Start
|
|
6
6
|
|
|
7
7
|
### Prerequisites
|
|
8
8
|
|
|
9
|
-
- [Bun](https://bun.sh)
|
|
10
|
-
- [Docker](https://docker.com) (for PostgreSQL)
|
|
9
|
+
- [Bun](https://bun.sh) v1.3+
|
|
10
|
+
- [Docker](https://docker.com) (for local PostgreSQL)
|
|
11
11
|
|
|
12
12
|
### Setup
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
# Start PostgreSQL
|
|
15
|
+
# 1) Start PostgreSQL
|
|
16
16
|
docker compose up -d
|
|
17
17
|
|
|
18
|
-
# Run
|
|
18
|
+
# 2) Run migrations
|
|
19
19
|
bun questpie migrate
|
|
20
20
|
|
|
21
|
-
# Start
|
|
21
|
+
# 3) Start development server
|
|
22
22
|
bun dev
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
The API docs (Scalar UI) are at [http://localhost:3000/api/cms/docs](http://localhost:3000/api/cms/docs).
|
|
25
|
+
- Admin panel: `http://localhost:3000/admin`
|
|
26
|
+
- API docs (Scalar): `http://localhost:3000/api/docs`
|
|
28
27
|
|
|
29
28
|
## Project Structure
|
|
30
29
|
|
|
31
|
-
```
|
|
30
|
+
```text
|
|
32
31
|
src/
|
|
33
32
|
questpie/
|
|
34
33
|
server/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
questpie.config.ts # Runtime config
|
|
35
|
+
modules.ts # Module list (admin/openapi/...)
|
|
36
|
+
config/
|
|
37
|
+
admin.ts # Admin sidebar/dashboard/branding
|
|
38
|
+
auth.ts # Auth config
|
|
39
|
+
openapi.ts # OpenAPI/Scalar config
|
|
40
|
+
app.ts # Re-export of generated app
|
|
41
|
+
.generated/ # Codegen output (do not edit manually)
|
|
38
42
|
collections/
|
|
39
|
-
posts.collection.ts
|
|
43
|
+
posts.collection.ts
|
|
40
44
|
globals/
|
|
41
|
-
site-settings.global.ts
|
|
45
|
+
site-settings.global.ts
|
|
42
46
|
admin/
|
|
43
|
-
admin.ts
|
|
44
|
-
|
|
47
|
+
admin.ts # Re-export of generated admin config
|
|
48
|
+
modules.ts # Admin client module defaults
|
|
49
|
+
.generated/ # Admin client codegen output
|
|
45
50
|
routes/
|
|
46
|
-
|
|
47
|
-
admin
|
|
48
|
-
|
|
51
|
+
api/$.ts # QUESTPIE fetch handler mount
|
|
52
|
+
admin.tsx
|
|
53
|
+
admin/
|
|
49
54
|
lib/
|
|
50
|
-
env.ts
|
|
51
|
-
|
|
52
|
-
auth-client.ts
|
|
53
|
-
query-client.ts
|
|
54
|
-
|
|
55
|
+
env.ts
|
|
56
|
+
client.ts
|
|
57
|
+
auth-client.ts
|
|
58
|
+
query-client.ts
|
|
59
|
+
migrations/
|
|
55
60
|
```
|
|
56
61
|
|
|
57
62
|
## Scripts
|
|
58
63
|
|
|
59
|
-
| Command
|
|
60
|
-
|
|
|
61
|
-
| `bun dev`
|
|
62
|
-
| `bun build`
|
|
63
|
-
| `bun start`
|
|
64
|
-
| `bun
|
|
65
|
-
| `bun questpie
|
|
64
|
+
| Command | Description |
|
|
65
|
+
| -------------------------------- | --------------------------------------------- |
|
|
66
|
+
| `bun dev` | Start development server |
|
|
67
|
+
| `bun build` | Build for production |
|
|
68
|
+
| `bun start` | Start production server |
|
|
69
|
+
| `bun check-types` | Type check |
|
|
70
|
+
| `bun questpie add <type> <name>` | Scaffold entity files (auto-runs codegen) |
|
|
71
|
+
| `bun questpie migrate` | Run migrations |
|
|
72
|
+
| `bun questpie migrate:create` | Create migration |
|
|
73
|
+
| `bunx questpie generate` | Regenerate `src/questpie/server/.generated/*` |
|
|
66
74
|
|
|
67
|
-
## Adding
|
|
75
|
+
## Adding a Collection
|
|
68
76
|
|
|
69
|
-
|
|
77
|
+
Preferred workflow:
|
|
70
78
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
79
|
+
1. Run `bun questpie add collection products`.
|
|
80
|
+
2. The CLI creates the file and runs codegen automatically.
|
|
81
|
+
3. Run `bun questpie migrate:create`.
|
|
74
82
|
|
|
75
|
-
|
|
83
|
+
Manual workflow (when you create files by hand):
|
|
76
84
|
|
|
77
|
-
|
|
78
|
-
|
|
85
|
+
1. Create a file in `src/questpie/server/collections/`.
|
|
86
|
+
2. Export a collection builder from that file.
|
|
87
|
+
3. Run `bunx questpie generate`.
|
|
88
|
+
4. Run `bun questpie migrate:create`.
|
|
79
89
|
|
|
80
|
-
|
|
81
|
-
.collections({ posts, myCollection })
|
|
82
|
-
```
|
|
90
|
+
Collections are discovered automatically by codegen. No manual `app.ts` registration is required.
|
|
83
91
|
|
|
84
|
-
## Adding
|
|
92
|
+
## Adding a Global
|
|
85
93
|
|
|
86
|
-
|
|
87
|
-
src/questpie/server/globals/my-global.global.ts
|
|
88
|
-
```
|
|
94
|
+
Preferred workflow:
|
|
89
95
|
|
|
90
|
-
|
|
96
|
+
1. Run `bun questpie add global marketing`.
|
|
97
|
+
2. The CLI creates the file and runs codegen automatically.
|
|
98
|
+
3. Run `bun questpie migrate:create`.
|
|
91
99
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
100
|
+
Manual workflow (when you create files by hand):
|
|
101
|
+
|
|
102
|
+
1. Create a file in `src/questpie/server/globals/`.
|
|
103
|
+
2. Export a global builder from that file.
|
|
104
|
+
3. Run `bunx questpie generate`.
|
|
105
|
+
4. Run `bun questpie migrate:create`.
|
|
106
|
+
|
|
107
|
+
Globals are discovered automatically by codegen. No manual `app.ts` registration is required.
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
+
"style": "base-lyra",
|
|
4
|
+
"rsc": false,
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"tailwind": {
|
|
7
|
+
"config": "",
|
|
8
|
+
"css": "src/styles.css",
|
|
9
|
+
"baseColor": "neutral",
|
|
10
|
+
"cssVariables": true,
|
|
11
|
+
"prefix": ""
|
|
12
|
+
},
|
|
13
|
+
"iconLibrary": "hugeicons",
|
|
14
|
+
"aliases": {
|
|
15
|
+
"components": "@/components",
|
|
16
|
+
"utils": "@/lib/utils",
|
|
17
|
+
"ui": "@/components/ui",
|
|
18
|
+
"lib": "@/lib",
|
|
19
|
+
"hooks": "@/hooks"
|
|
20
|
+
},
|
|
21
|
+
"registries": {}
|
|
22
22
|
}
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
"version": "0.0.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
|
+
"imports": {
|
|
7
|
+
"#questpie": "./src/questpie/server/.generated/index.ts",
|
|
8
|
+
"#questpie/*": "./src/questpie/server/.generated/*"
|
|
9
|
+
},
|
|
6
10
|
"scripts": {
|
|
7
11
|
"dev": "bun --bun vite dev --port 3000",
|
|
8
12
|
"build": "vite build",
|
|
@@ -24,6 +28,8 @@
|
|
|
24
28
|
"zod": "^4.2.1"
|
|
25
29
|
},
|
|
26
30
|
"devDependencies": {
|
|
31
|
+
"@iconify/json": ">=2",
|
|
32
|
+
"@questpie/vite-plugin-iconify": "latest",
|
|
27
33
|
"@tailwindcss/vite": "^4.0.0",
|
|
28
34
|
"@tanstack/devtools-vite": "latest",
|
|
29
35
|
"@tanstack/react-devtools": "latest",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { app } from "@/questpie/server/app";
|
|
2
2
|
|
|
3
3
|
export const config = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
app: app,
|
|
5
|
+
cli: {
|
|
6
|
+
migrations: {
|
|
7
|
+
directory: "./src/migrations",
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export default config;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import type { AppConfig } from "@/questpie/server/app.js";
|
|
1
2
|
import { createAdminAuthClient } from "@questpie/admin/client";
|
|
2
|
-
import type { AppCMS } from "@/questpie/server/app.js";
|
|
3
3
|
|
|
4
|
-
export const authClient = createAdminAuthClient<
|
|
4
|
+
export const authClient = createAdminAuthClient<AppConfig>({
|
|
5
5
|
baseURL:
|
|
6
6
|
typeof window !== "undefined"
|
|
7
7
|
? window.location.origin
|
|
8
8
|
: process.env.APP_URL || "http://localhost:3000",
|
|
9
|
-
basePath: "/api/
|
|
9
|
+
basePath: "/api/auth",
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
export type AuthClient = typeof authClient;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createClient } from "questpie/client";
|
|
2
|
+
|
|
3
|
+
import type { AppConfig } from "@/questpie/server/app.js";
|
|
4
|
+
|
|
5
|
+
export const client = createClient<AppConfig>({
|
|
6
|
+
baseURL:
|
|
7
|
+
typeof window !== "undefined"
|
|
8
|
+
? window.location.origin
|
|
9
|
+
: process.env.APP_URL || "http://localhost:3000",
|
|
10
|
+
basePath: "/api",
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export type AppClient = typeof client;
|
|
@@ -2,26 +2,23 @@ import { createEnv } from "@t3-oss/env-core";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
4
|
export const env = createEnv({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
runtimeEnv: process.env,
|
|
26
|
-
emptyStringAsUndefined: true,
|
|
5
|
+
server: {
|
|
6
|
+
DATABASE_URL: z.string().url(),
|
|
7
|
+
APP_URL: z.string().url().default("http://localhost:3000"),
|
|
8
|
+
PORT: z
|
|
9
|
+
.string()
|
|
10
|
+
.transform(Number)
|
|
11
|
+
.pipe(z.number().int().positive())
|
|
12
|
+
.default("3000"),
|
|
13
|
+
BETTER_AUTH_SECRET: z.string().min(1).default("change-me-in-production"),
|
|
14
|
+
MAIL_ADAPTER: z.enum(["console", "smtp"]).default("console"),
|
|
15
|
+
SMTP_HOST: z.string().optional(),
|
|
16
|
+
SMTP_PORT: z
|
|
17
|
+
.string()
|
|
18
|
+
.transform(Number)
|
|
19
|
+
.pipe(z.number().int().positive())
|
|
20
|
+
.optional(),
|
|
21
|
+
},
|
|
22
|
+
runtimeEnv: process.env,
|
|
23
|
+
emptyStringAsUndefined: true,
|
|
27
24
|
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Admin Client Config
|
|
3
|
+
*
|
|
4
|
+
* Auto-generated by questpie codegen — do not edit.
|
|
5
|
+
*
|
|
6
|
+
* Pass this directly to <AdminLayoutProvider admin={admin} />
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { default as _modules } from "../modules";
|
|
10
|
+
|
|
11
|
+
const admin = _modules;
|
|
12
|
+
|
|
13
|
+
export default admin;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Admin Configuration
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the generated admin config.
|
|
5
|
+
* Import directly from "./.generated/client" in new code.
|
|
6
|
+
*/
|
|
7
|
+
export { default as admin } from "./.generated/client";
|
|
2
8
|
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
export type AdminConfig = typeof admin;
|
|
9
|
+
export type AdminConfig = typeof import("./.generated/client").default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "@questpie/admin/client-module";
|