create-questpie 2.0.4 → 2.1.0

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 (152) hide show
  1. package/dist/index.mjs +362 -119
  2. package/package.json +2 -3
  3. package/templates/elysia/AGENTS.md +56 -0
  4. package/templates/elysia/CLAUDE.md +39 -0
  5. package/templates/elysia/Dockerfile +24 -0
  6. package/templates/elysia/README.md +148 -0
  7. package/templates/elysia/docker/init-extensions.sql +11 -0
  8. package/templates/elysia/docker-compose.yml +21 -0
  9. package/templates/elysia/env.example +16 -0
  10. package/templates/elysia/gitignore +6 -0
  11. package/templates/elysia/package.json +47 -0
  12. package/templates/elysia/questpie.config.ts +12 -0
  13. package/templates/elysia/src/index.ts +21 -0
  14. package/templates/elysia/src/lib/auth-client.ts +32 -0
  15. package/templates/elysia/src/lib/client.ts +13 -0
  16. package/templates/elysia/src/lib/env.ts +24 -0
  17. package/templates/elysia/src/lib/query-client.ts +18 -0
  18. package/templates/elysia/src/lib/query.ts +18 -0
  19. package/templates/elysia/src/questpie/server/.generated/context.gen.ts +200 -0
  20. package/templates/elysia/src/questpie/server/.generated/entities.gen.ts +84 -0
  21. package/templates/elysia/src/questpie/server/.generated/factories.ts +65 -0
  22. package/templates/elysia/src/questpie/server/.generated/index.ts +131 -0
  23. package/templates/elysia/src/questpie/server/.generated/names.gen.ts +25 -0
  24. package/templates/elysia/src/questpie/server/app.ts +10 -0
  25. package/templates/elysia/src/questpie/server/collections/index.ts +1 -0
  26. package/templates/elysia/src/questpie/server/collections/posts.collection.ts +10 -0
  27. package/templates/elysia/src/questpie/server/config/auth.ts +8 -0
  28. package/templates/elysia/src/questpie/server/config/openapi.ts +10 -0
  29. package/templates/elysia/src/questpie/server/globals/index.ts +1 -0
  30. package/templates/elysia/src/questpie/server/globals/site-settings.global.ts +10 -0
  31. package/templates/elysia/src/questpie/server/modules.ts +8 -0
  32. package/templates/elysia/src/questpie/server/questpie.config.ts +21 -0
  33. package/templates/elysia/tsconfig.json +28 -0
  34. package/templates/hono/AGENTS.md +56 -0
  35. package/templates/hono/CLAUDE.md +39 -0
  36. package/templates/hono/Dockerfile +24 -0
  37. package/templates/hono/README.md +148 -0
  38. package/templates/hono/docker/init-extensions.sql +11 -0
  39. package/templates/hono/docker-compose.yml +21 -0
  40. package/templates/hono/env.example +16 -0
  41. package/templates/hono/gitignore +6 -0
  42. package/templates/hono/package.json +47 -0
  43. package/templates/hono/questpie.config.ts +12 -0
  44. package/templates/hono/src/index.ts +30 -0
  45. package/templates/hono/src/lib/auth-client.ts +32 -0
  46. package/templates/hono/src/lib/client.ts +13 -0
  47. package/templates/hono/src/lib/env.ts +24 -0
  48. package/templates/hono/src/lib/query-client.ts +18 -0
  49. package/templates/hono/src/lib/query.ts +18 -0
  50. package/templates/hono/src/questpie/server/.generated/context.gen.ts +200 -0
  51. package/templates/hono/src/questpie/server/.generated/entities.gen.ts +84 -0
  52. package/templates/hono/src/questpie/server/.generated/factories.ts +65 -0
  53. package/templates/hono/src/questpie/server/.generated/index.ts +131 -0
  54. package/templates/hono/src/questpie/server/.generated/names.gen.ts +25 -0
  55. package/templates/hono/src/questpie/server/app.ts +10 -0
  56. package/templates/hono/src/questpie/server/collections/index.ts +1 -0
  57. package/templates/hono/src/questpie/server/collections/posts.collection.ts +10 -0
  58. package/templates/hono/src/questpie/server/config/auth.ts +8 -0
  59. package/templates/hono/src/questpie/server/config/openapi.ts +10 -0
  60. package/templates/hono/src/questpie/server/globals/index.ts +1 -0
  61. package/templates/hono/src/questpie/server/globals/site-settings.global.ts +10 -0
  62. package/templates/hono/src/questpie/server/modules.ts +8 -0
  63. package/templates/hono/src/questpie/server/questpie.config.ts +21 -0
  64. package/templates/hono/tsconfig.json +28 -0
  65. package/templates/next/AGENTS.md +55 -0
  66. package/templates/next/CLAUDE.md +39 -0
  67. package/templates/next/Dockerfile +25 -0
  68. package/templates/next/README.md +148 -0
  69. package/templates/next/components.json +22 -0
  70. package/templates/next/docker/init-extensions.sql +11 -0
  71. package/templates/next/docker-compose.yml +21 -0
  72. package/templates/next/env.example +16 -0
  73. package/templates/next/gitignore +10 -0
  74. package/templates/next/next-env.d.ts +5 -0
  75. package/templates/next/next.config.ts +20 -0
  76. package/templates/next/package.json +54 -0
  77. package/templates/next/postcss.config.mjs +8 -0
  78. package/templates/next/public/.gitkeep +0 -0
  79. package/templates/next/questpie.config.ts +12 -0
  80. package/templates/next/src/app/admin/[[...all]]/page.tsx +34 -0
  81. package/templates/next/src/app/admin/admin.css +4 -0
  82. package/templates/next/src/app/admin/layout.tsx +63 -0
  83. package/templates/next/src/app/api/[...all]/route.ts +24 -0
  84. package/templates/next/src/app/layout.tsx +24 -0
  85. package/templates/next/src/app/not-found.tsx +18 -0
  86. package/templates/next/src/app/page.tsx +74 -0
  87. package/templates/next/src/app/providers.tsx +11 -0
  88. package/templates/next/src/lib/auth-client.ts +12 -0
  89. package/templates/next/src/lib/client.ts +13 -0
  90. package/templates/next/src/lib/env.ts +24 -0
  91. package/templates/next/src/lib/query-client.ts +18 -0
  92. package/templates/next/src/lib/query.ts +18 -0
  93. package/templates/next/src/questpie/admin/.generated/client.ts +13 -0
  94. package/templates/next/src/questpie/admin/admin.ts +9 -0
  95. package/templates/next/src/questpie/admin/modules.ts +3 -0
  96. package/templates/next/src/questpie/server/.generated/context.gen.ts +204 -0
  97. package/templates/next/src/questpie/server/.generated/entities.gen.ts +100 -0
  98. package/templates/next/src/questpie/server/.generated/factories.ts +204 -0
  99. package/templates/next/src/questpie/server/.generated/index.ts +139 -0
  100. package/templates/next/src/questpie/server/.generated/names.gen.ts +31 -0
  101. package/templates/next/src/questpie/server/app.ts +10 -0
  102. package/templates/next/src/questpie/server/collections/index.ts +1 -0
  103. package/templates/next/src/questpie/server/collections/posts.collection.ts +58 -0
  104. package/templates/next/src/questpie/server/config/admin.ts +80 -0
  105. package/templates/next/src/questpie/server/config/auth.ts +8 -0
  106. package/templates/next/src/questpie/server/config/openapi.ts +10 -0
  107. package/templates/next/src/questpie/server/globals/index.ts +1 -0
  108. package/templates/next/src/questpie/server/globals/site-settings.global.ts +19 -0
  109. package/templates/next/src/questpie/server/modules.ts +9 -0
  110. package/templates/next/src/questpie/server/questpie.config.ts +21 -0
  111. package/templates/next/src/styles.css +125 -0
  112. package/templates/next/tsconfig.json +37 -0
  113. package/templates/tanstack-start/AGENTS.md +35 -607
  114. package/templates/tanstack-start/CLAUDE.md +26 -134
  115. package/templates/tanstack-start/README.md +13 -1
  116. package/templates/tanstack-start/docker/init-extensions.sql +11 -0
  117. package/templates/tanstack-start/docker-compose.yml +1 -0
  118. package/templates/tanstack-start/src/lib/auth-client.ts +1 -1
  119. package/templates/tanstack-start/src/lib/client.ts +1 -1
  120. package/templates/tanstack-start/src/lib/query.ts +18 -0
  121. package/templates/tanstack-start/src/questpie/server/collections/index.ts +1 -1
  122. package/templates/tanstack-start/src/questpie/server/globals/index.ts +1 -1
  123. package/templates/tanstack-start/src/questpie/server/questpie.config.ts +1 -1
  124. package/templates/tanstack-start/src/routes/__root.tsx +31 -1
  125. package/templates/tanstack-start/src/routes/api/$.ts +1 -1
  126. package/templates/tanstack-start/src/routes/index.tsx +97 -0
  127. package/skills/questpie/AGENTS.md +0 -2871
  128. package/skills/questpie/SKILL.md +0 -293
  129. package/skills/questpie/coverage.json +0 -213
  130. package/skills/questpie/references/auth.md +0 -236
  131. package/skills/questpie/references/business-logic.md +0 -620
  132. package/skills/questpie/references/codegen-plugin-api.md +0 -382
  133. package/skills/questpie/references/crud-api.md +0 -580
  134. package/skills/questpie/references/data-modeling.md +0 -509
  135. package/skills/questpie/references/extend.md +0 -584
  136. package/skills/questpie/references/field-types.md +0 -398
  137. package/skills/questpie/references/infrastructure-adapters.md +0 -720
  138. package/skills/questpie/references/mcp.md +0 -147
  139. package/skills/questpie/references/multi-tenancy.md +0 -363
  140. package/skills/questpie/references/production.md +0 -640
  141. package/skills/questpie/references/query-operators.md +0 -125
  142. package/skills/questpie/references/quickstart.md +0 -562
  143. package/skills/questpie/references/rules.md +0 -454
  144. package/skills/questpie/references/sandbox.md +0 -110
  145. package/skills/questpie/references/tanstack-query.md +0 -543
  146. package/skills/questpie/references/type-inference.md +0 -167
  147. package/skills/questpie/references/workflows.md +0 -155
  148. package/skills/questpie-admin/AGENTS.md +0 -1515
  149. package/skills/questpie-admin/SKILL.md +0 -443
  150. package/skills/questpie-admin/references/blocks.md +0 -331
  151. package/skills/questpie-admin/references/custom-ui.md +0 -305
  152. package/skills/questpie-admin/references/views.md +0 -449
@@ -1,147 +1,39 @@
1
1
  # CLAUDE.md
2
2
 
3
- This is a [QUESTPIE](https://questpie.com) project scaffolded with `create-questpie`.
3
+ This is a [QUESTPIE](https://questpie.com) project. See **`AGENTS.md`** for the
4
+ full agent guide — it is the source of truth and this file mirrors it.
4
5
 
5
- ## Quick Reference
6
+ ## Use the QUESTPIE skills
6
7
 
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 run routes:generate` | Regenerate TanStack Router route tree |
15
- | `bun run questpie:generate` | Regenerate .generated/index.ts |
16
- | `bun run scaffold:generate` | Regenerate route tree and QUESTPIE output |
17
- | `bun run scaffold:verify` | Regenerate codegen and type-check |
18
- | `bun run db:push` | Push schema to local dev database |
19
- | `bun run migrate:create` | Generate a migration from schema diff |
20
- | `bun run migrate` | Run pending migrations |
21
- | `bun questpie seed` | Run pending seeds |
22
- | `docker compose up -d` | Start PostgreSQL |
8
+ - **`questpie`** — collections, globals, routes, jobs, codegen, auth, business
9
+ logic, typed client + TanStack Query.
10
+ - **`questpie-admin`** admin UI: views, blocks, custom fields, branding,
11
+ dashboard, live preview.
23
12
 
24
- ## Project Architecture
13
+ Invoke skills by name (the `/skill` convention); don't work from memory.
25
14
 
26
- This project follows QUESTPIE's **server-first** philosophy:
15
+ **If they aren't installed**, install them and then trim this file to a pointer:
27
16
 
28
- - **Server** defines WHAT (schema, validation, access, hooks, jobs)
29
- - **Client** defines HOW (rendering, themes, custom components)
30
-
31
- ```
32
- src/questpie/
33
- server/ ← WHAT: data contracts and behavior
34
- questpie.config.ts ← App config: runtimeConfig({ db, app, ... })
35
- modules.ts ← Module dependencies (adminModule, openApiModule, etc.)
36
- config/ ← Typed configuration files
37
- auth.ts ← authConfig({...}) — Better Auth options
38
- admin.ts ← adminConfig({ sidebar, dashboard, branding, locale })
39
- openapi.ts ← openApiConfig({ info, scalar })
40
- app.ts ← (optional) appConfig({ locale, access, hooks, context })
41
- .generated/ ← Codegen output (app instance + App type)
42
- index.ts
43
- collections/ ← One file per collection (auto-discovered)
44
- globals/ ← One file per global (auto-discovered)
45
- routes/ ← Server routes via route() (auto-discovered)
46
- jobs/ ← Background job definitions (auto-discovered)
47
- blocks/ ← Block definitions (auto-discovered)
48
- admin/ ← HOW: UI rendering concerns
49
- admin.ts ← Re-exports generated admin config
50
- .generated/ ← Codegen output (admin client config)
51
- client.ts
17
+ ```bash
18
+ bunx skills add questpie/questpie
52
19
  ```
53
20
 
54
- ## Key Files
55
-
56
- - **`src/questpie/server/questpie.config.ts`** — App config: `runtimeConfig({ db, app, ... })`.
57
- - **`src/questpie/server/modules.ts`** — Module dependencies: `export default [adminModule, openApiModule] as const`.
58
- - **`src/questpie/server/config/auth.ts`** — Auth config via `authConfig()` factory.
59
- - **`src/questpie/server/config/admin.ts`** — Admin config (sidebar, dashboard, branding, locale) via `adminConfig()` factory.
60
- - **`src/questpie/server/config/app.ts`** — _(optional, not scaffolded)_ App config (locale, access, hooks, context) via `appConfig()`. Create when needed.
61
- - **`src/questpie/server/.generated/index.ts`** — Codegen output. Exports typed `app` instance and `App` type. Run `bun run questpie:generate` to regenerate.
62
- - **`src/lib/env.ts`** — Type-safe env variables via `@t3-oss/env-core`. Add new env vars here with Zod schemas.
63
- - **`questpie.config.ts`** — CLI config (migration directory, app reference).
64
- - **`src/routes/api/$.ts`** — API catch-all handler. Serves REST + OpenAPI docs at `/api/docs`.
65
-
66
- ## Admin User Contract
67
-
68
- `adminModule` includes the starter auth model and owns the canonical Better Auth `user` collection shape used by admin setup and login guards. That contract includes `user.role` (`admin` or `user`).
69
-
70
- Do **not** create a replacement `collection("user")` from scratch. If you need custom user fields or admin layout, merge `starterModule.collections.user` or `adminModule.collections.user` and extend it. Replacing the user collection breaks admin setup/login.
71
-
72
- ## Environment Variables
73
-
74
- Defined in `src/lib/env.ts` with runtime validation. See `.env.example` for all available variables.
75
-
76
- Required:
77
-
78
- - `DATABASE_URL` — PostgreSQL connection string
79
-
80
- Optional (with defaults):
81
-
82
- - `APP_URL` — Application URL (default: `http://localhost:3000`)
83
- - `BETTER_AUTH_SECRET` — Auth secret key
84
- - `MAIL_ADAPTER` — `console` or `smtp`
85
-
86
- ## Common Tasks
87
-
88
- ### Add a new collection
89
-
90
- Preferred workflow:
21
+ ## Docs for LLMs
91
22
 
92
- 1. Run `bun questpie add collection my-thing`
93
- 2. The CLI creates the file and auto-runs codegen
94
- 3. Run `bun run db:push` for local development, or `bun run migrate:create` for production migrations.
23
+ - https://questpie.com/llms.txt doc sitemap
24
+ - https://questpie.com/llms-full.txt full docs in one LLM-optimized file
25
+ - http://localhost:3000/api/docs live API reference (dev server running)
95
26
 
96
- Manual workflow:
27
+ ## This project
97
28
 
98
- 1. Create `src/questpie/server/collections/my-thing.ts` with a named export:
99
- ```ts
100
- import { collection } from "#questpie/factories";
101
- export const myThing = collection("my-thing").fields(({ f }) => ({ ... }));
102
- ```
103
- 2. Run `bun run questpie:generate` to regenerate `.generated/index.ts`
104
- 3. Run `bun run db:push` for local development, or `bun run migrate:create` for production migrations.
29
+ - **Runtime**: TanStack Start + Vite + Nitro, package manager **Bun**
30
+ - **Database**: PostgreSQL (Drizzle ORM)
31
+ - **Auth**: Better Auth — extend the admin `user` collection, never replace it
32
+ - **Validation**: Zod **v4**
105
33
 
106
- Collections are auto-discovered by codegen — no manual registration needed.
107
-
108
- ### Add a new global
109
-
110
- Preferred workflow:
111
-
112
- 1. Run `bun questpie add global my-global`
113
- 2. The CLI creates the file and auto-runs codegen
114
- 3. Run `bun run db:push` for local development, or `bun run migrate:create` for production migrations.
115
-
116
- Manual workflow:
117
-
118
- 1. Create `src/questpie/server/globals/my-global.ts` with a named export
119
- 2. Run `bun run questpie:generate`
120
- 3. Run `bun run db:push` for local development, or `bun run migrate:create` for production migrations.
121
-
122
- ### Add a server route (end-to-end type-safe)
123
-
124
- 1. Create `src/questpie/server/routes/my-function.ts`:
125
-
126
- ```ts
127
- import { route } from "questpie/services";
128
- import { z } from "zod";
129
-
130
- export default route()
131
- .post()
132
- .schema(z.object({ id: z.string() }))
133
- .handler(async ({ input, collections }) => {
134
- // input: typed from Zod schema; collections, db, session, etc. from AppContext
135
- return { name: "result" };
136
- });
137
- ```
138
-
139
- 2. Run `bun run questpie:generate` — route is auto-discovered and available at `/api/my-function`
140
-
141
- See AGENTS.md for detailed route patterns, access control, and TanStack Query integration.
142
-
143
- ## Documentation
144
-
145
- - **QUESTPIE Docs**: https://questpie.com/docs
146
- - **Getting Started**: https://questpie.com/docs/getting-started
147
- - **API Reference (local)**: http://localhost:3000/api/docs (Scalar UI, available when dev server is running)
34
+ ```bash
35
+ bun dev # Dev server (port 3000)
36
+ bun run scaffold:verify # Regenerate codegen + type-check
37
+ bun run db:push # Push schema to local dev DB
38
+ bun questpie add collection <name> # Scaffold an entity (auto-runs codegen)
39
+ ```
@@ -12,7 +12,7 @@ A [QUESTPIE](https://questpie.com) app built with TanStack Start.
12
12
  ### Setup
13
13
 
14
14
  ```bash
15
- # 1) Start PostgreSQL
15
+ # 1) Start PostgreSQL (also provisions required extensions for local dev)
16
16
  docker compose up -d
17
17
 
18
18
  # 2) Regenerate codegen and type-check
@@ -28,6 +28,18 @@ bun run dev
28
28
  - Admin panel: `http://localhost:3000/admin`
29
29
  - API docs (Scalar): `http://localhost:3000/api/docs`
30
30
 
31
+ ### Database extensions
32
+
33
+ QUESTPIE is drizzle-native and does **not** auto-create Postgres extensions. The
34
+ starter's full-text search relies on `pg_trgm` (trigram matching).
35
+
36
+ - **Local dev:** `docker compose up` provisions `pg_trgm` via
37
+ `docker/init-extensions.sql`, mounted into the postgres container's
38
+ `/docker-entrypoint-initdb.d/` and run once on first cluster init — so
39
+ `db:push` works out of the box.
40
+ - **Managed Postgres:** enable required extensions through your provider before
41
+ deploying. See [the QUESTPIE docs](https://questpie.com/docs) for details.
42
+
31
43
  ## Project Structure
32
44
 
33
45
  ```text
@@ -0,0 +1,11 @@
1
+ -- Postgres extensions provisioned for local development.
2
+ -- Mounted into the postgres container at /docker-entrypoint-initdb.d/ and run
3
+ -- once, on first cluster init, before the app connects.
4
+ --
5
+ -- QUESTPIE is drizzle-native: the app does NOT auto-create extensions. The
6
+ -- starter's full-text search uses pg_trgm (trigram matching), so we provision
7
+ -- it here to keep `db:push` working out-of-the-box while you prototype.
8
+ --
9
+ -- On managed Postgres, enable required extensions via your provider instead.
10
+ -- See https://questpie.com/docs for details.
11
+ CREATE EXTENSION IF NOT EXISTS "pg_trgm";
@@ -10,6 +10,7 @@ services:
10
10
  - "5432:5432"
11
11
  volumes:
12
12
  - postgres_data:/var/lib/postgresql/data
13
+ - ./docker/init-extensions.sql:/docker-entrypoint-initdb.d/init-extensions.sql:ro
13
14
  healthcheck:
14
15
  test: ["CMD-SHELL", "pg_isready -U {{databaseUser}}"]
15
16
  interval: 5s
@@ -1,4 +1,4 @@
1
- import type { AppConfig } from "@/questpie/server/app.js";
1
+ import type { AppConfig } from "@/questpie/server/app";
2
2
  import { createAdminAuthClient } from "@questpie/admin/client";
3
3
 
4
4
  export const authClient = createAdminAuthClient<AppConfig>({
@@ -1,6 +1,6 @@
1
1
  import { createClient } from "questpie/client";
2
2
 
3
- import type { AppConfig } from "@/questpie/server/app.js";
3
+ import type { AppConfig } from "@/questpie/server/app";
4
4
 
5
5
  export const client = createClient<AppConfig>({
6
6
  baseURL:
@@ -0,0 +1,18 @@
1
+ import { createQuestpieQueryOptions } from "@questpie/tanstack-query";
2
+
3
+ import { client } from "@/lib/client";
4
+
5
+ /**
6
+ * Typed TanStack Query option builders for this project.
7
+ *
8
+ * `q.collections.*`, `q.globals.*`, and `q.routes.*` return `queryOptions()` /
9
+ * `mutationOptions()` objects you pass straight into `useQuery` / `useMutation`.
10
+ * Full type inference flows from the server schema via `AppConfig`.
11
+ *
12
+ * @example
13
+ * const { data } = useQuery(q.collections.posts.find({ limit: 10 }));
14
+ * const create = useMutation(q.collections.posts.create());
15
+ */
16
+ export const q = createQuestpieQueryOptions(client);
17
+
18
+ export type QueryOptions = typeof q;
@@ -1 +1 @@
1
- export { posts } from "./posts.collection.js";
1
+ export { posts } from "./posts.collection";
@@ -1 +1 @@
1
- export { siteSettings } from "./site-settings.global.js";
1
+ export { siteSettings } from "./site-settings.global";
@@ -9,7 +9,7 @@
9
9
  import { runtimeConfig } from "questpie/app";
10
10
  import { ConsoleAdapter } from "questpie/adapters/console";
11
11
 
12
- import { env } from "@/lib/env.js";
12
+ import { env } from "@/lib/env";
13
13
 
14
14
  export default runtimeConfig({
15
15
  app: { url: env.APP_URL },
@@ -1,4 +1,11 @@
1
- import { createRootRoute } from "@tanstack/react-router";
1
+ import {
2
+ createRootRoute,
3
+ HeadContent,
4
+ Link,
5
+ Scripts,
6
+ } from "@tanstack/react-router";
7
+
8
+ import appCss from "../styles.css?url";
2
9
 
3
10
  export const Route = createRootRoute({
4
11
  head: () => ({
@@ -7,7 +14,30 @@ export const Route = createRootRoute({
7
14
  { name: "viewport", content: "width=device-width, initial-scale=1" },
8
15
  { title: "{{projectName}}" },
9
16
  ],
17
+ links: [{ rel: "stylesheet", href: appCss }],
10
18
  }),
19
+ notFoundComponent: () => (
20
+ <html lang="en">
21
+ <head>
22
+ <HeadContent />
23
+ </head>
24
+ <body className="bg-background text-foreground min-h-screen antialiased">
25
+ <main className="mx-auto flex min-h-screen max-w-md flex-col items-center justify-center px-6 text-center">
26
+ <h1 className="text-3xl font-bold tracking-tight">Page not found</h1>
27
+ <p className="text-muted-foreground mt-3">
28
+ The page you are looking for does not exist.
29
+ </p>
30
+ <Link
31
+ to="/"
32
+ className="text-primary mt-6 inline-block text-sm font-medium hover:underline"
33
+ >
34
+ Back to homepage
35
+ </Link>
36
+ </main>
37
+ <Scripts />
38
+ </body>
39
+ </html>
40
+ ),
11
41
  shellComponent: RootDocument,
12
42
  });
13
43
 
@@ -1,6 +1,6 @@
1
1
  import { createFileRoute } from "@tanstack/react-router";
2
2
  import { createFetchHandler } from "questpie/http";
3
- import { app } from "@/questpie/server/app.js";
3
+ import { app } from "@/questpie/server/app";
4
4
 
5
5
  const handler = createFetchHandler(app, {
6
6
  basePath: "/api",
@@ -0,0 +1,97 @@
1
+ import {
2
+ createFileRoute,
3
+ HeadContent,
4
+ Link,
5
+ Scripts,
6
+ } from "@tanstack/react-router";
7
+
8
+ import appCss from "@/styles.css?url";
9
+
10
+ export const Route = createFileRoute("/")({
11
+ head: () => ({
12
+ title: "{{projectName}}",
13
+ links: [{ rel: "stylesheet", href: appCss }],
14
+ }),
15
+ component: Home,
16
+ });
17
+
18
+ function Home() {
19
+ return (
20
+ <html lang="en">
21
+ <head>
22
+ <HeadContent />
23
+ </head>
24
+ <body className="bg-background text-foreground min-h-screen antialiased">
25
+ <main className="mx-auto flex min-h-screen max-w-3xl flex-col items-center justify-center px-6 py-16 text-center">
26
+ <span className="text-muted-foreground mb-4 text-xs font-medium uppercase tracking-widest">
27
+ Powered by QUESTPIE
28
+ </span>
29
+ <h1 className="text-4xl font-bold tracking-tight sm:text-5xl">
30
+ {"{{projectName}}"}
31
+ </h1>
32
+ <p className="text-muted-foreground mt-4 text-lg">
33
+ Your QUESTPIE app is running. Here is where to go next.
34
+ </p>
35
+
36
+ <div className="mt-12 grid w-full grid-cols-1 gap-4 text-left sm:grid-cols-3">
37
+ <Link
38
+ to="/admin"
39
+ className="group hover:border-primary/30 block rounded-lg border p-5 transition-all hover:shadow-md"
40
+ >
41
+ <h2 className="group-hover:text-primary font-semibold transition-colors">
42
+ Admin panel
43
+ </h2>
44
+ <p className="text-muted-foreground mt-1 text-sm">
45
+ Manage your content and settings.
46
+ </p>
47
+ <span className="text-primary mt-3 inline-block text-sm font-medium">
48
+ Open /admin →
49
+ </span>
50
+ </Link>
51
+
52
+ <a
53
+ href="/api/docs"
54
+ className="group hover:border-primary/30 block rounded-lg border p-5 transition-all hover:shadow-md"
55
+ >
56
+ <h2 className="group-hover:text-primary font-semibold transition-colors">
57
+ API docs
58
+ </h2>
59
+ <p className="text-muted-foreground mt-1 text-sm">
60
+ Explore the REST API in Scalar.
61
+ </p>
62
+ <span className="text-primary mt-3 inline-block text-sm font-medium">
63
+ Open /api/docs →
64
+ </span>
65
+ </a>
66
+
67
+ <a
68
+ href="https://questpie.com/docs"
69
+ target="_blank"
70
+ rel="noreferrer"
71
+ className="group hover:border-primary/30 block rounded-lg border p-5 transition-all hover:shadow-md"
72
+ >
73
+ <h2 className="group-hover:text-primary font-semibold transition-colors">
74
+ Documentation
75
+ </h2>
76
+ <p className="text-muted-foreground mt-1 text-sm">
77
+ Learn the framework and patterns.
78
+ </p>
79
+ <span className="text-primary mt-3 inline-block text-sm font-medium">
80
+ questpie.com/docs →
81
+ </span>
82
+ </a>
83
+ </div>
84
+
85
+ <p className="text-muted-foreground mt-12 text-sm">
86
+ Edit{" "}
87
+ <code className="bg-muted rounded px-1.5 py-0.5 font-mono text-xs">
88
+ src/routes/index.tsx
89
+ </code>{" "}
90
+ to change this page.
91
+ </p>
92
+ </main>
93
+ <Scripts />
94
+ </body>
95
+ </html>
96
+ );
97
+ }