zhxiao1124 e84351e8ed refactor: 重构项目目录与代码结构,清理冗余文件
本次提交进行了大规模的项目结构调整:
1. 调整文件目录归属,将模块代码按功能域重新组织
2. 删除多处冗余的DTO、实体类和模块文件
3. 统一了常量、装饰器、工具类的存放位置
4. 修复了`.gitignore`的日志目录匹配规则
5. 新增了健康检查、认证、用户、剧集、订单等核心业务模块
2026-07-02 19:17:43 +08:00

TikTok Short Drama Backend

NestJS backend API for a TikTok Minis short drama app.

API Contract

All endpoints must follow docs/api-standard.md.

Response shape:

{
  "code": 0,
  "data": {},
  "message": "success",
  "timestamp": "2026-06-30T00:00:00.000Z",
  "requestId": "0f5c2e16-1e44-4d55-93a4-ef7c66d9d1f2",
  "cost": "3ms"
}

Paginated list shape:

{
  "code": 0,
  "data": {
    "list": [],
    "pagination": {
      "page": 1,
      "pageSize": 20,
      "total": 100
    }
  },
  "message": "success",
  "timestamp": "2026-06-30T00:00:00.000Z",
  "requestId": "0f5c2e16-1e44-4d55-93a4-ef7c66d9d1f2",
  "cost": "3ms"
}

Implemented Modules

  • health: app health check.
  • logs: request log lookup by requestId and playback error reporting.
  • dramas: admin drama and episode configuration, app published content listing.
  • auth: TikTok login placeholder that returns a business JWT.
  • orders: paid episode orders, TikTok payment webhook, and playback unlock checks.
  • admin: admin login, RBAC permissions, roles, and admin user management.
  • users: app user listing, detail, and status management for admins.

Commands

pnpm install
pnpm run start:dev
pnpm run build
pnpm run test:e2e

Swagger is available at:

http://localhost:3000/api/docs

Default admin account for local development:

username: admin
password: admin123

Notes

  • The project currently uses in-memory services so the API contract can be developed and tested before MySQL credentials are available.
  • TypeORM entity classes are included for the planned MySQL persistence layer.
  • Replace the TikTok login placeholder with official TikTok Minis login exchange once app credentials are ready.
Description
cyh-tk-backend
Readme 962 KiB
Languages
TypeScript 99.5%
JavaScript 0.5%