Set up Fastify + TypeScript + Drizzle ORM backend with: - Database schema (7 tables: users, categories, questions, knowledge_cards, user_progress, skill_tree, user_chapter_progress) - JWT auth middleware + admin token auth - Route structure for auth, quiz, progress, gamification, payment, and admin - Service stubs for Phase 1b implementation - Zod-validated env config, custom error classes
43 lines
1.0 KiB
JSON
43 lines
1.0 KiB
JSON
{
|
|
"name": "duoqi-api",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "tsx watch src/index.ts",
|
|
"build": "tsc",
|
|
"start": "node dist/index.js",
|
|
"db:generate": "drizzle-kit generate",
|
|
"db:migrate": "drizzle-kit migrate",
|
|
"db:push": "drizzle-kit push",
|
|
"db:studio": "drizzle-kit studio",
|
|
"db:seed": "tsx db/seeds/index.ts",
|
|
"lint": "eslint .",
|
|
"typecheck": "tsc --noEmit"
|
|
},
|
|
"dependencies": {
|
|
"drizzle-orm": "^0.44.0",
|
|
"fastify": "^5.3.0",
|
|
"@fastify/cors": "^11.0.0",
|
|
"@fastify/helmet": "^13.0.0",
|
|
"@fastify/rate-limit": "^10.2.0",
|
|
"@fastify/jwt": "^9.0.0",
|
|
"mysql2": "^3.12.0",
|
|
"dotenv": "^16.5.0",
|
|
"zod": "^3.24.0",
|
|
"pino": "^9.6.0",
|
|
"uuid": "^11.1.0"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/js": "^9.25.0",
|
|
"@types/node": "^24.0.0",
|
|
"@types/uuid": "^10.0.0",
|
|
"drizzle-kit": "^0.31.0",
|
|
"eslint": "^9.25.0",
|
|
"pino-pretty": "^13.1.3",
|
|
"tsx": "^4.19.0",
|
|
"typescript": "~5.8.0",
|
|
"typescript-eslint": "^8.30.0"
|
|
}
|
|
}
|