create-kuckit-app 0.3.3 → 0.3.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-kuckit-app",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "Create a new Kuckit application",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -342,6 +342,51 @@ See `.env.example` for required variables:
342
342
  - `PORT` - Server port (default: 3000)
343
343
  - `VITE_API_URL` - API URL for frontend
344
344
 
345
+ ## Troubleshooting
346
+
347
+ ### 404 Errors on API Calls
348
+
349
+ **Symptom**: `POST /rpc/items/list 404 (Not Found)` with multiple retries
350
+
351
+ **Cause**: Server and client modules are out of sync. The client has a module registered but the server doesn't.
352
+
353
+ **Fix**: Ensure both files register the same modules:
354
+
355
+ - `apps/server/src/config/modules.ts` - Server modules
356
+ - `apps/web/src/modules.client.ts` - Client modules
357
+
358
+ **Prevention**: Run `bunx kuckit doctor` to detect mismatches.
359
+
360
+ ### "Relation does not exist" Database Errors
361
+
362
+ **Symptom**: `error: relation "items" does not exist`
363
+
364
+ **Cause**: Module schema not registered in `drizzle.config.ts`.
365
+
366
+ **Fix**: Add the module's schema path to `packages/db/drizzle.config.ts`:
367
+
368
+ ```typescript
369
+ schema: [
370
+ resolve(currentDirPath, './src/schema'),
371
+ resolve(currentDirPath, '../your-module/src/adapters/schema.drizzle.ts'),
372
+ ],
373
+ ```
374
+
375
+ Then run:
376
+
377
+ ```bash
378
+ bun run db:generate
379
+ bun run db:migrate
380
+ ```
381
+
382
+ ### Module Not Appearing in Navigation
383
+
384
+ **Symptom**: Module pages work but nav items don't show.
385
+
386
+ **Cause**: Client module not registered or missing `navItems`.
387
+
388
+ **Fix**: Verify module is in `apps/web/src/modules.client.ts` and defines `navItems` in `defineKuckitClientModule()`.
389
+
345
390
  ## Related Documentation
346
391
 
347
392
  - [Kuckit SDK](https://github.com/draphonix/kuckit)
@@ -1,21 +1,20 @@
1
1
  import type { ModuleSpec } from '@kuckit/sdk'
2
-
3
- // Import your modules here
4
- // import { kuckitModule as itemsModule } from '@__APP_NAME_KEBAB__/items-module'
2
+ import { kuckitModule as itemsModule } from '@__APP_NAME_KEBAB__/items-module'
5
3
 
6
4
  /**
7
5
  * Module specifications for the server application
8
6
  *
9
7
  * Add modules here to configure the server's functionality.
10
8
  * Modules are loaded in order, with dependencies resolved automatically.
9
+ *
10
+ * IMPORTANT: Server and client modules must be kept in sync!
11
+ * If you add/remove a module here, also update apps/web/src/modules.client.ts
11
12
  */
12
13
  export const getModuleSpecs = (): ModuleSpec[] => {
13
14
  const modules: ModuleSpec[] = [
14
- // Add your modules here:
15
- // {
16
- // module: itemsModule,
17
- // config: { ... },
18
- // },
15
+ // KUCKIT_SERVER_MODULES_START
16
+ { module: itemsModule },
17
+ // KUCKIT_SERVER_MODULES_END
19
18
  ]
20
19
 
21
20
  return modules
@@ -0,0 +1,8 @@
1
+ import { defineConfig } from 'tsdown'
2
+
3
+ export default defineConfig({
4
+ entry: './src/server.ts',
5
+ format: 'esm',
6
+ outDir: './dist',
7
+ clean: true,
8
+ })
@@ -15,6 +15,7 @@
15
15
  "@radix-ui/react-avatar": "^1.1.10",
16
16
  "@radix-ui/react-collapsible": "^1.1.11",
17
17
  "@radix-ui/react-dialog": "^1.1.14",
18
+ "@radix-ui/react-dropdown-menu": "^2.1.15",
18
19
  "@radix-ui/react-separator": "^1.1.7",
19
20
  "@radix-ui/react-slot": "^1.2.3",
20
21
  "@radix-ui/react-tooltip": "^1.2.7",
@@ -65,6 +65,31 @@ export const itemsTable = pgTable('items', {
65
65
 
66
66
  The schema is imported by `drizzle.config.ts` for migration generation.
67
67
 
68
+ ### ⚠️ Important: Register Module Schemas
69
+
70
+ **Drizzle only discovers schemas listed in `drizzle.config.ts`**. When adding a new module with database tables:
71
+
72
+ 1. Add the module's schema path to `drizzle.config.ts`:
73
+
74
+ ```typescript
75
+ export default defineConfig({
76
+ schema: [
77
+ resolve(currentDirPath, './src/schema'),
78
+ // Add module schema paths here:
79
+ resolve(currentDirPath, '../your-module/src/adapters/schema.drizzle.ts'),
80
+ ],
81
+ // ...
82
+ })
83
+ ```
84
+
85
+ 2. Generate and apply migration:
86
+ ```bash
87
+ bun run db:generate
88
+ bun run db:migrate
89
+ ```
90
+
91
+ **Common Issue**: If you see "relation does not exist" errors, the module schema likely isn't registered in `drizzle.config.ts`.
92
+
68
93
  ## Connection
69
94
 
70
95
  ```typescript
@@ -12,7 +12,11 @@ dotenv.config({
12
12
  })
13
13
 
14
14
  export default defineConfig({
15
- schema: [resolve(currentDirPath, './src/schema')],
15
+ schema: [
16
+ resolve(currentDirPath, './src/schema'),
17
+ // Module schemas - add new module schema paths here
18
+ resolve(currentDirPath, '../items-module/src/adapters/item.drizzle.ts'),
19
+ ],
16
20
  out: resolve(currentDirPath, './src/migrations'),
17
21
  dialect: 'postgresql',
18
22
  dbCredentials: { url: buildDatabaseUrl() },
@@ -52,3 +52,13 @@ CREATE TABLE IF NOT EXISTS "verification" (
52
52
 
53
53
  ALTER TABLE "session" ADD CONSTRAINT "session_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;
54
54
  ALTER TABLE "account" ADD CONSTRAINT "account_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;
55
+
56
+ -- Items module table
57
+ CREATE TABLE IF NOT EXISTS "items" (
58
+ "id" text PRIMARY KEY NOT NULL,
59
+ "name" text NOT NULL,
60
+ "description" text,
61
+ "created_at" timestamp NOT NULL DEFAULT now(),
62
+ "updated_at" timestamp NOT NULL DEFAULT now(),
63
+ "user_id" text NOT NULL
64
+ );