Files
thebet365/README.md
Mars 95abbcb470 feat: 世界杯48强夺冠盘、管理端调赔与项目文档
- 固定48强基准数据、同步种子与后台世界杯夺冠页

- 补全 user_preferences 迁移文件;新增启动指南与默认数据说明

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 16:19:36 +08:00

111 lines
2.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# TheBet365 - 足球投注平台 MVP
Monorepo 项目,包含 NestJS 后端与 Vue 3 三端前端。
## 技术栈
| 层级 | 技术 |
|------|------|
| 后端 | NestJS + Prisma + PostgreSQL + Redis |
| 玩家前台 | Vue 3 + Vite + Pinia (H5 移动端优先) |
| 管理后台(平台+代理) | Vue 3 + Vite + Element Plus单应用 `apps/admin` |
| 包管理 | pnpm workspace |
## 快速开始
> 完整步骤、环境变量、端口、演示账号与排错见 **[docs/项目启动指南.md](docs/项目启动指南.md)**。
### 1. 启动基础设施
```bash
docker compose up -d
```
### 2. 安装依赖
```bash
pnpm install
```
### 3. 配置环境
```bash
cp .env.example apps/api/.env
```
### 4. 数据库迁移与种子数据
```bash
pnpm db:migrate
pnpm db:seed
```
### 5. 启动开发服务
```bash
pnpm dev:api # API http://localhost:3000
pnpm dev:player # 玩家前台 http://localhost:5173
pnpm dev:admin # 管理后台 http://localhost:5174admin/agent 同一入口)
pnpm dev:manage # 同上别名
```
API 文档http://localhost:3000/api/docs
## 测试账号
| 角色 | 用户名 | 密码 |
|------|--------|------|
| 超级管理员 | admin | Admin@123 |
| 一级代理 | agent1 | Agent@123 |
| 二级代理 | agent2 | Agent@123 |
| 玩家 | player1 | Player@123 |
更多默认数据赛事、48 强夺冠、余额、Banner 等)见 **[docs/默认数据说明.md](docs/默认数据说明.md)**。
## 项目结构
```
apps/api/src/
├── domains/ # 8 个业务领域
│ ├── identity/ # 身份与权限auth + users
│ ├── agent/ # 代理网络
│ ├── ledger/ # 账务账本wallet
│ ├── catalog/ # 赛事目录matches
│ ├── odds/ # 盘口赔率markets
│ ├── betting/ # 注单引擎
│ ├── settlement/ # 结算引擎(含 domain/ 纯函数)
│ └── operations/ # 运营支撑audit/cashback/content/i18n
├── applications/ # 三端应用层(编排,不含领域规则)
│ ├── player/
│ ├── admin/
│ └── agent/
├── shared/ # 基础设施
│ ├── prisma/
│ └── common/
├── app.module.ts
└── main.ts
apps/
player/ 玩家 H5 前台
admin/ 管理后台(平台 + 代理,单应用)
packages/
shared/ 共享类型与常量
```
## MVP 功能
- 三端登录鉴权 + RBAC
- 2 级代理 + 信用额度池
- 钱包账变(禁止直接改余额)
- 11 种足球玩法 + 盘口模板
- 单关 / 2~5 串 1 下注
- 结算预览 + 确认入账
- 返水批次
- Banner / 公告 / 多语言
## 测试
```bash
pnpm --filter @thebet365/api test
```