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
30 lines
479 B
Plaintext
30 lines
479 B
Plaintext
# Database
|
|
DATABASE_URL=mysql://root:password@localhost:3306/duoqi
|
|
|
|
# JWT
|
|
JWT_SECRET=change-me-to-a-secure-secret
|
|
JWT_EXPIRES_IN=1h
|
|
JWT_REFRESH_EXPIRES_IN=30d
|
|
|
|
# Admin
|
|
ADMIN_TOKEN=change-me-admin-token
|
|
|
|
# Huawei ID Kit (Phase 1b)
|
|
HUAWEI_CLIENT_ID=
|
|
HUAWEI_CLIENT_SECRET=
|
|
|
|
# Alibaba Cloud OSS
|
|
OSS_ACCESS_KEY_ID=
|
|
OSS_ACCESS_KEY_SECRET=
|
|
OSS_BUCKET=
|
|
OSS_REGION=
|
|
|
|
# Huawei IAP (Phase 1c)
|
|
HUAWEI_IAP_URL=
|
|
HUAWEI_MERCHANT_ID=
|
|
|
|
# Application
|
|
PORT=3000
|
|
NODE_ENV=development
|
|
LOG_LEVEL=info
|