Files
thebet365/README.md
Mars 31737286b9 refactor(admin): 合并管理后台并移除 apps/agent
- 平台与代理共用 apps/admin,统一登录 manage/auth/login
- 按 userType 展示菜单,修复 token 循环跳转
- 删除独立 apps/agent 前端工程

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 17:50:58 +08:00

107 lines
2.5 KiB
Markdown
Raw 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 |
## 快速开始
### 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 |
## 项目结构
```
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
```