Files
cyh-tk-backend/README.md
zhxiao1124 ef8c31d3be chore: 初始化TikTok短剧后端项目基础架构
创建了完整的NestJS项目结构,包含配置文件、核心模块、工具类、拦截器、过滤器等基础代码,实现了健康检查、用户认证、管理员RBAC、剧集管理、订单支付、媒体管理等核心功能的基础框架,配置了ESLint、TypeScript、Jest等开发工具链。
2026-07-01 13:55:37 +08:00

79 lines
1.7 KiB
Markdown

# TikTok Short Drama Backend
NestJS backend API for a TikTok Minis short drama app.
## API Contract
All endpoints must follow [docs/api-standard.md](./docs/api-standard.md).
Response shape:
```json
{
"code": 0,
"data": {},
"message": "success",
"timestamp": "2026-06-30T00:00:00.000Z",
"requestId": "0f5c2e16-1e44-4d55-93a4-ef7c66d9d1f2",
"cost": "3ms"
}
```
Paginated list shape:
```json
{
"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
```bash
pnpm install
pnpm run start:dev
pnpm run build
pnpm run test:e2e
```
Swagger is available at:
```text
http://localhost:3000/api/docs
```
Default admin account for local development:
```text
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.