Files
thebet365/README.md
Mars 14e49374ac 初始化足球投注平台 MVP Monorepo
包含 NestJS 后端、三端前端、Prisma 数据模型、结算引擎测试与 PRD 文档。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 14:35:48 +08:00

89 lines
1.6 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 |
| 包管理 | 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:5174
pnpm dev:agent # 代理后台 http://localhost:5175
```
API 文档http://localhost:3000/api/docs
## 测试账号
| 角色 | 用户名 | 密码 |
|------|--------|------|
| 超级管理员 | admin | Admin@123 |
| 一级代理 | agent1 | Agent@123 |
| 二级代理 | agent2 | Agent@123 |
| 玩家 | player1 | Player@123 |
## 项目结构
```
apps/
api/ NestJS 单体后端
player/ 玩家 H5 前台
admin/ 平台后台
agent/ 代理后台
packages/
shared/ 共享类型与常量
```
## MVP 功能
- 三端登录鉴权 + RBAC
- 2 级代理 + 信用额度池
- 钱包账变(禁止直接改余额)
- 11 种足球玩法 + 盘口模板
- 单关 / 2~5 串 1 下注
- 结算预览 + 确认入账
- 返水批次
- Banner / 公告 / 多语言
## 测试
```bash
pnpm --filter @thebet365/api test
```