Initial commit

Made-with: Cursor
This commit is contained in:
Daniel
2026-02-28 18:39:00 +08:00
commit a94bd44c3a
49 changed files with 917 additions and 0 deletions

54
srde/README.md Normal file
View File

@@ -0,0 +1,54 @@
# SRDE - Structured Risk Decision Engine
Deterministic 风控投资系统 Demo
## 项目结构
```
srde/
├── backend/ # FastAPI 后端Python
├── frontend/ # React Web 前端
├── miniprogram/ # 微信小程序前端
└── docker-compose.yml
```
## 快速启动
### 方式一Docker需 Docker Desktop
```bash
cd srde
docker compose up --build
```
- Web 前端: http://localhost
- API: http://localhost:8000
### 方式二:本地开发
**后端**
```bash
cd srde/backend
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# 启动 PostgreSQL 后:
export DATABASE_URL=postgresql://user:pass@localhost:5432/srde
alembic upgrade head
uvicorn app.main:app --reload
```
**Web 前端**
```bash
cd srde/frontend && npm install && npm run dev
```
**微信小程序**
1. 用微信开发者工具打开 `srde/miniprogram`
2. 默认使用模拟数据,可离线浏览
3. 对接后端:修改 `miniprogram/services/api.ts``USE_MOCK=false``BASE_URL`
## Demo 说明
- **Web**:登录、账户、创建交易、交易列表、复盘
- **小程序**:风控首页、分步创建交易、交易详情、复盘、统计、个人中心
- **后端**JWT 认证、风控引擎、仓位计算、回撤/锁仓规则