draft
This commit is contained in:
42
CLAUDE.md
42
CLAUDE.md
@@ -4,21 +4,37 @@
|
||||
|
||||
## 项目概述
|
||||
|
||||
**pay-bridge** 是一个前后端一体的全栈应用,前端使用 React,后端使用 Go。目前处于早期/模板阶段。
|
||||
**pay-bridge** 是一个前后端分离的全栈应用,monorepo 结构。
|
||||
|
||||
- **前端**: React
|
||||
- **后端**: Go (Go 1.25)
|
||||
- **前端**: React,位于 `frontend/`
|
||||
- **后端**: Go (Go 1.24),位于 `backend/`
|
||||
|
||||
## 目录结构
|
||||
|
||||
```
|
||||
pay-bridge/
|
||||
├── backend/ # Go 后端
|
||||
│ ├── cmd/server/ # 程序入口
|
||||
│ ├── internal/ # 业务代码(api/service/repository/model/channel)
|
||||
│ ├── pkg/ # 公共库(config/crypto/logger/sequence)
|
||||
│ ├── configs/ # 配置文件和数据库迁移脚本
|
||||
│ ├── go.mod
|
||||
│ └── go.sum
|
||||
├── frontend/ # React 前端
|
||||
├── docs/ # 设计文档
|
||||
└── CLAUDE.md
|
||||
```
|
||||
|
||||
## 构建与运行命令
|
||||
|
||||
### 后端
|
||||
### 后端(在 `backend/` 目录下执行)
|
||||
|
||||
```bash
|
||||
# 运行
|
||||
go run main.go
|
||||
go run ./cmd/server
|
||||
|
||||
# 构建
|
||||
go build -o pay-bridge .
|
||||
go build -o pay-bridge ./cmd/server
|
||||
|
||||
# 测试
|
||||
go test ./...
|
||||
@@ -30,22 +46,20 @@ go test -run TestName ./path/to/package
|
||||
go vet ./...
|
||||
```
|
||||
|
||||
### 前端
|
||||
### 前端(在 `frontend/` 目录下执行)
|
||||
|
||||
```bash
|
||||
# 安装依赖
|
||||
cd frontend && npm install
|
||||
npm install
|
||||
|
||||
# 开发服务器
|
||||
cd frontend && npm run dev
|
||||
npm run dev
|
||||
|
||||
# 构建
|
||||
cd frontend && npm run build
|
||||
npm run build
|
||||
```
|
||||
|
||||
## 架构
|
||||
|
||||
前后端一体的 monorepo 项目。
|
||||
|
||||
- **后端**: Go 模块 (`module pay-bridge`),提供 API 服务并托管前端静态资源。遵循 Go 标准目录结构 (`cmd/`, `internal/`, `pkg/`)。
|
||||
- **前端**: React 应用,位于 `frontend/` 目录。
|
||||
- **后端**: Go 模块 (`module pay-bridge`),4 层架构:API Handler → Service → Repository → DB/Redis,渠道适配器插件化注册。
|
||||
- **前端**: React 应用,调用后端 REST API。
|
||||
|
||||
Reference in New Issue
Block a user