firsh push
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
# 酒店民宿短租预订平台 - 项目指引
|
||||
|
||||
## 项目概述
|
||||
|
||||
集酒店、民宿、短租、青旅预订于一体的综合性平台,包含小程序端、商家管理后台、平台管理后台三大终端。
|
||||
|
||||
## 技术栈
|
||||
|
||||
- **后端**: NestJS + TypeORM + MySQL + Redis + JWT + Swagger
|
||||
- **小程序**: uni-app + Vue3 + Pinia + SCSS
|
||||
- **商家后台**: React 18 + TypeScript + Ant Design + Zustand
|
||||
- **平台后台**: React 18 + TypeScript + Ant Design + Zustand
|
||||
- **部署**: Docker + Kubernetes + Nginx
|
||||
- **包管理**: pnpm (monorepo)
|
||||
|
||||
## 项目结构
|
||||
|
||||
```
|
||||
rent-platform/
|
||||
├── apps/
|
||||
│ ├── server/ # NestJS 后端 (@rent/server)
|
||||
│ ├── miniapp/ # uni-app 小程序 (@rent/miniapp)
|
||||
│ ├── merchant-admin/ # 商家管理后台 (@rent/merchant-admin)
|
||||
│ └── platform-admin/ # 平台管理后台 (@rent/platform-admin)
|
||||
├── packages/
|
||||
│ ├── shared-types/ # 共享类型定义 (@rent/shared-types)
|
||||
│ ├── shared-utils/ # 共享工具函数 (@rent/shared-utils)
|
||||
│ └── shared-config/ # 共享配置 (@rent/shared-config)
|
||||
├── database/
|
||||
│ ├── migrations/ # 数据库迁移脚本
|
||||
│ └── seeds/ # 种子数据
|
||||
├── deploy/
|
||||
│ ├── docker/ # Docker & Docker Compose
|
||||
│ ├── k8s/ # Kubernetes manifests
|
||||
│ └── nginx/ # Nginx 配置
|
||||
└── 项目需求文档.md
|
||||
```
|
||||
|
||||
## 常用命令
|
||||
|
||||
```bash
|
||||
pnpm install # 安装全部依赖
|
||||
pnpm dev:server # 启动后端 (localhost:3000)
|
||||
pnpm dev:miniapp # 启动小程序 (微信开发者工具)
|
||||
pnpm dev:merchant # 商家后台 (localhost:5173)
|
||||
pnpm dev:platform # 平台后台 (localhost:5174)
|
||||
```
|
||||
|
||||
## API 规范
|
||||
|
||||
- 全局前缀: `/api`
|
||||
- 认证方式: Bearer Token (JWT)
|
||||
- 响应格式: `{ code, message, data, timestamp }`
|
||||
- Swagger文档: `http://localhost:3000/api/docs`
|
||||
- 路由分层: 用户路由 `/xxx`、商家路由 `/merchant/xxx`、管理路由 `/admin/xxx`
|
||||
|
||||
## 角色体系
|
||||
|
||||
| 角色 | 说明 | 路由前缀 |
|
||||
|------|------|----------|
|
||||
| user | C端普通用户 | `/orders`, `/rooms`, `/user` |
|
||||
| merchant | B端商家 | `/merchant/xxx` |
|
||||
| admin | 平台管理员 | `/admin/xxx` |
|
||||
|
||||
## 数据库
|
||||
|
||||
- 参见 `database/skills.md` 了解完整表结构和关系
|
||||
|
||||
## 模块需求
|
||||
|
||||
- 参见 `database/modules.md` 了解各模块详细业务规则
|
||||
|
||||
## 开发规范
|
||||
|
||||
- 后端路径别名: `@/` 指向 `src/`
|
||||
- 前端路径别名: `@/` 指向 `src/`
|
||||
- 中文注释,英文变量名
|
||||
- 新增模块需同步更新 entities、DTO、Service、Controller、Module
|
||||
- 后端接口需添加 Swagger 装饰器 (`@ApiTags`, `@ApiOperation`, `@ApiBearerAuth`)
|
||||
Reference in New Issue
Block a user