Files
pay-bridge/CLAUDE.md
2026-03-13 15:51:59 +08:00

66 lines
1.4 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.
# CLAUDE.md
本文件为 Claude Code (claude.ai/code) 在此仓库中工作时提供指导。
## 项目概述
**pay-bridge** 是一个前后端分离的全栈应用monorepo 结构。
- **前端**: 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 ./cmd/server
# 构建
go build -o pay-bridge ./cmd/server
# 测试
go test ./...
# 运行单个测试
go test -run TestName ./path/to/package
# 代码检查
go vet ./...
```
### 前端(在 `frontend/` 目录下执行)
```bash
# 安装依赖
npm install
# 开发服务器
npm run dev
# 构建
npm run build
```
## 架构
- **后端**: Go 模块 (`module pay-bridge`)4 层架构API Handler → Service → Repository → DB/Redis渠道适配器插件化注册。
- **前端**: React 应用,调用后端 REST API。