feat: database layer - PostgreSQL schema + memory fallback
Some checks failed
CI / lint-and-typecheck (push) Failing after 16m21s
CI / test (push) Has been skipped
CI / build (push) Has been skipped

- drizzle-orm + postgres dependencies
- Full schema: 12 tables covering all modules
- Graceful fallback: no DATABASE_URL → memory mode
- drizzle-kit config for migrations
- Memory store as generic CRUD layer
- dev.ts auto-initializes DB on startup
This commit is contained in:
xiaohei
2026-04-12 19:05:03 +08:00
parent 2532cf4f4e
commit 15a70e4ecf
7 changed files with 477 additions and 1 deletions

View File

@@ -10,13 +10,17 @@
"build": "tsc && vite build",
"lint": "eslint src/ --ext .ts,.tsx",
"test": "vitest run",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"db:generate": "drizzle-kit generate",
"db:migrate": "drizzle-kit migrate"
},
"dependencies": {
"@arco-design/web-react": "^2.66.0",
"@hono/node-server": "^1.19.13",
"@larksuiteoapi/node-sdk": "^1.60.0",
"drizzle-orm": "^0.45.2",
"hono": "^4.7.0",
"postgres": "^3.4.9",
"react": "^18.3.0",
"react-dom": "^18.3.0"
},