diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000000000000000000000000000000000000..927574d71bed42c960e3e924e688ad4bb8f1a59b --- /dev/null +++ b/README.en.md @@ -0,0 +1,256 @@ +# Super Super Project + +A fully-featured microservices e-commerce system with a front-end and back-end separated architecture, comprising three applications: customer-facing, merchant-facing, and admin backend. + +## Project Overview + +Super is a comprehensive microservices e-commerce platform built on the Spring Cloud microservices architecture, forming a complete ecosystem centered around core e-commerce business functions. The system includes microservices for authentication, users, products, orders, shops, settlement, search, and more, paired with multi-platform front-end applications to deliver a complete e-commerce solution. + +## Technology Stack + +### Back-end Services (Java) + +- Spring Boot 2.7.x / Spring Cloud +- MySQL 8.0 + MyBatis Plus +- Redis + Redisson +- RabbitMQ (multi-vhost architecture) +- Elasticsearch 8.x +- Nacos (service registration and configuration center) +- OpenJDK 17 + +### Back-end Services (Go) + +- Go 1.20+ +- Gin Web Framework +- GORM +- RabbitMQ +- MySQL + +### Front-end + +- Vue 3 + Vite +- uni-app (mobile) +- TypeScript + +## Microservices Architecture + +``` + ┌─────────────────┐ + │ super-gateway │ + │ Gateway Layer │ + └────────┬────────┘ + │ + ┌──────────────────┬──────────────────┬────┴────┬──────────────────┐ + │ │ │ │ │ +┌───────▼──────┐ ┌───────▼──────┐ ┌───────▼──────┐ ┌───────▼──────┐ ┌───────▼──────┐ +│ auth-service │ │user-service │ │good-service │ │order-service│ │shop-service │ +│ Authentication│ │ User Service│ │ Product Service│ │ Order Service │ │ Shop Service │ +└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ + │ │ │ │ │ + │ │ │ │ │ +┌───────▼──────┐ ┌───────▼──────┐ ┌───────▼──────┐ ┌───────▼──────┐ +│ settlement │ │search-service│ │ common-core │ │ web-service │ +│ Settlement (Go)│ │ Search Service │ │ Common Core │ │ Web Common │ +└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ +``` + +### Service Descriptions + +| Service Name | Tech Stack | Description | Port | +|--------------|------------|-------------|------| +| super-gateway | Java | API Gateway, unified entry point | 8080 | +| auth-service | Java | Authentication service, JWT Token management | 8081 | +| user-service | Java | User service, member / cart / address management | 8082 | +| good-service | Java | Product service, SPU/SKU / categories | 8083 | +| order-service | Java | Order service | 8084 | +| shop-service | Java | Shop service | 8085 | +| settlement-service | Go | Settlement service | 8086 | +| search-service | Java | Search service, Elasticsearch full-text search | 8087 | +| common-core | Java | Common core library | - | +| common-data | Java | Common data definitions | - | +| web-service | Java | Web layer common components | - | + +### Front-end Applications + +| App Name | Framework | Description | +|----------|-----------|-------------| +| client-front | Vue3 + uni-app | Mobile e-commerce app | +| shop-front | Vue3 + Vite | Merchant management system | +| manager-front | Vue3 + Vite | Platform admin backend | + +## Core Features + +### Authentication Service (auth-service) + +- User login / registration +- Access Token / Refresh Token issuance +- Token validation and refresh +- JWT + Redis dual verification +- Password encryption storage (BCrypt) + +### User Service (user-service) + +- Mobile phone SMS login +- Member profile management +- Shopping cart functionality +- Delivery address management +- Bank card binding +- Real-name authentication (OCR ID card recognition) + +### Product Service (good-service) + +- SPU / SKU management +- Product categorization +- Brand management +- Inventory management +- Product listing/unlisting + +### Order Service (order-service) + +- Checkout from shopping cart +- Order creation and payment +- Order status flow +- Order logs +- Settlement batch management + +### Shop Service (shop-service) + +- Shop profile management +- Shop certification +- Shop address management +- Shop status management + +### Search Service (search-service) + +- Elasticsearch integration +- Full-text product search +- Product index management +- Message trace query + +### Settlement Service (settlement-service) - Go + +- Order revenue distribution +- Shop settlement +- Fund transaction records +- Withdrawal management +- Refund processing + +## Project Structure + +``` +├── auth-service/ # Authentication Service +├── common-core/ # Core Common Library +│ └── src/main/java/com/example/ +│ ├── cache/ # Cache management (local + Redis distributed) +│ ├── config/ # Configuration classes +│ ├── mp/ # MyBatis Plus extensions +│ ├── ocr/ # OCR recognition +│ ├── rabbitmq/ # RabbitMQ (multi-vhost) +│ ├── redis/ # Redis utilities +│ ├── rocket/ # RocketMQ +│ ├── thread/ # Thread pool +│ └── util/ # Utility classes +├── common-data/ # Common Data Library +├── web-service/ # Web Common Layer +├── user-service/ # User Service +├── good-service/ # Product Service +├── order-service/ # Order Service +├── shop-service/ # Shop Service +├── search-service/ # Search Service +├── settlement-service/ # Settlement Service (Go) +├── super-gateway/ # Gateway +├── client-front/ # Mobile Front-end +├── shop-front/ # Merchant Front-end +└── manager-front/ # Admin Front-end +``` + +## Quick Start + +### Environment Requirements + +- JDK 17+ +- Maven 3.6+ +- MySQL 8.0 +- Redis 6.0+ +- RabbitMQ 3.8+ +- Elasticsearch 8.x +- Nacos 2.x +- Go 1.20+ (for settlement service only) + +### Build and Run + +```bash +# 1. Build common libraries +cd common-data && mvn clean install -DskipTests +cd common-core && mvn clean install -DskipTests + +# 2. Start individual services +cd auth-service && mvn spring-boot:run +# Or start via IDE +``` + +### Docker Deployment + +Each service includes a Dockerfile for Docker deployment: + +```bash +# Build image +docker build -t auth-service:1.0 -f auth-service/docker-files/Dockerfile . +``` + +### Front-end Execution + +```bash +# Install dependencies +cd client-front && npm install + +# Development mode +npm run dev + +# Production build +npm run build +``` + +## Configuration Guide + +Main configuration files are located at `src/main/resources/bootstrap.yml`. Key configurations include: + +- Nacos address +- MySQL data source +- Redis connection +- RabbitMQ multi-cluster settings +- Service ports and paths + +## API Documentation + +Each service provides complete RESTful APIs: + +- Authentication: JWT token issuance and validation +- User: Registration, login, cart, address +- Product: CRUD operations for SPU/SKU +- Order: Creation, querying, settlement +- Shop: Shop management +- Search: Product retrieval + +Detailed API documentation is available in each service’s `HELP.md` file. + +## Development Guidelines + +- Commit messages must be in Chinese +- Code must follow Google Java Style Guide +- Branch management uses Git Flow +- Use Lombok to reduce boilerplate code +- API responses must conform to the unified `ApiResult` format + +## License + +MIT License + +## Notes + +1. MyBatis Plus is used for database operations; create corresponding database tables according to business requirements. +2. OCR recognition functionality depends on Python 3; ensure Python is installed on the system. +3. RabbitMQ uses a multi-vhost design; configure separate clusters as needed. +4. Some features require integration with the Nacos configuration center. + +For issues, please submit an Issue or contact the maintainers. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9600b25e3a5a1d17022f71d1fa764447f95c3117 --- /dev/null +++ b/README.md @@ -0,0 +1,259 @@ + + +# Super 超级项目 + +一个功能完整的微服务电商系统,采用前后端分离架构,包含用户端、商户端和管理后台三个应用。 + +## 项目简介 + +Super 是一个综合性的微服务电商平台,采用 Spring Cloud 微服务架构,围绕电商核心业务构建了完整的生态体系。系统包含鉴权、用户、商品、订单、店铺、结算、搜索等微服务,配合多端前端应用,提供完整的电商解决方案。 + +## 技术栈 + +### 后端服务 (Java) + +- Spring Boot 2.7.x / Spring Cloud +- MySQL 8.0 + MyBatis Plus +- Redis + Redisson +- RabbitMQ (多 vhost 架构) +- Elasticsearch 8.x +- Nacos (服务注册与配置中心) +- OpenJDK 17 + +### 后端服务 (Go) + +- Go 1.20+ +- Gin Web 框架 +- GORM +- RabbitMQ +- MySQL + +### 前端 + +- Vue 3 + Vite +- uni-app (移动端) +- TypeScript + +## 微服务架构 + +``` + ┌─────────────────┐ + │ super-gateway │ + │ 网关层 │ + └────────┬────────┘ + │ + ┌──────────────────┬──────────────────┬────┴────┬──────────────────┐ + │ │ │ │ │ +┌───────▼──────┐ ┌───────▼──────┐ ┌───────▼──────┐ ┌───────▼──────┐ ┌───────▼──────┐ +│ auth-service │ │user-service │ │good-service │ │order-service│ │shop-service │ +│ 鉴权服务 │ │ 用户服务 │ │ 商品服务 │ │ 订单服务 │ │ 店铺服务 │ +└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ + │ │ │ │ │ + │ │ │ │ │ +┌───────▼──────┐ ┌───────▼──────┐ ┌───────▼──────┐ ┌───────▼──────┐ +│ settlement │ │search-service│ │ common-core │ │ web-service │ +│ 结算服务(Go) │ │ 搜索服务 │ │ 公共底包 │ │ 公共Web │ +└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ +``` + +### 服务说明 + +| 服务名 | 技术栈 | 说明 | 端口 | +|--------|--------|------|------| +| super-gateway | Java | API 网关,统一入口 | 8080 | +| auth-service | Java | 鉴权服务,JWT Token 管理 | 8081 | +| user-service | Java | 用户服务,会员/购物车/地址 | 8082 | +| good-service | Java | 商品服务,SPU/SKU/分类 | 8083 | +| order-service | Java | 订单服务 | 8084 | +| shop-service | Java | 店铺服务 | 8085 | +| settlement-service | Go | 结算服务 | 8086 | +| search-service | Java | 搜索服务,ES 全文检索 | 8087 | +| common-core | Java | 公共依赖包 | - | +| common-data | Java | 公共数据定义 | - | +| web-service | Java | Web 层公共组件 | - | + +### 前端应用 + +| 应用名 | 框架 | 说明 | +|--------|------|------| +| client-front | Vue3+uni-app | 移动端商城 | +| shop-front | Vue3+Vite | 商户管理系统 | +| manager-front | Vue3+Vite | 平台管理后台 | + +## 核心功能 + +### 鉴权服务 (auth-service) + +- 用户登录/注册 +- Access Token / Refresh Token 签发 +- Token 验证与刷新 +- JWT + Redis 双重校验 +- 密码加密存储 (BCrypt) + +### 用户服务 (user-service) + +- 手机号验证码登录 +- 会员信息管理 +- 购物车功能 +- 收货地址管理 +- 银行卡绑定 +- 实名认证 (OCR 身份证识别) + +### 商品服务 (good-service) + +- SPU / SKU 管理 +- 商品分类 +- 品牌管理 +- 库存管理 +- 商品上下架 + +### 订单服务 (order-service) + +- 购物车下单 +- 订单创建与支付 +- 订单状态流转 +- 订单日志 +- 结算批次管理 + +### 店铺服务 (shop-service) + +- 店铺信息管理 +- 店铺认证 +- 店铺地址 +- 店铺状态管理 + +### 搜索服务 (search-service) + +- Elasticsearch 集成 +- 商品全文检索 +- 商品索引管理 +- 消息轨迹查询 + +### 结算服务 (settlement-service) - Go + +- 订单分账 +- 店铺结算 +- 资金流水 +- 提现管理 +- 退款处理 + +## 项目结构 + +``` +├── auth-service/ # 鉴权服务 +├── common-core/ # 核心公共包 +│ └── src/main/java/com/example/ +│ ├── cache/ # 缓存管理 (本地 + Redis 分布式缓存) +│ ├── config/ # 配置类 +│ ├── mp/ # MyBatis Plus 扩展 +│ ├── ocr/ # OCR 识别 +│ ├── rabbitmq/ # RabbitMQ (多vhost) +│ ├── redis/ # Redis 工具类 +│ ├── rocket/ # RocketMQ +│ ├── thread/ # 线程池 +│ └── util/ # 工具类 +├── common-data/ # 数据公共包 +├── web-service/ # Web 公共层 +├── user-service/ # 用户服务 +├── good-service/ # 商品服务 +├── order-service/ # 订单服务 +├── shop-service/ # 店铺服务 +├── search-service/ # 搜索服务 +├── settlement-service/ # 结算服务 (Go) +├── super-gateway/ # 网关 +├── client-front/ # 移动端 +├── shop-front/ # 商户端 +└── manager-front/ # 管理后台 +``` + +## 快速开始 + +### 环境要求 + +- JDK 17+ +- Maven 3.6+ +- MySQL 8.0 +- Redis 6.0+ +- RabbitMQ 3.8+ +- Elasticsearch 8.x +- Nacos 2.x +- Go 1.20+ (仅结算服务) + +### 编译运行 + +```bash +# 1. 编译公共底包 +cd common-data && mvn clean install -DskipTests +cd common-core && mvn clean install -DskipTests + +# 2. 启动各个服务 +cd auth-service && mvn spring-boot:run +# 或使用 IDE 启动 +``` + +### Docker 部署 + +各服务已配置 Dockerfile,支持 Docker 部署: + +```bash +# 构建镜像 +docker build -t auth-service:1.0 -f auth-service/docker-files/Dockerfile . +``` + +### 前端运行 + +```bash +# 安装依赖 +cd client-front && npm install + +# 开发模式 +npm run dev + +# 构建生产 +npm run build +``` + +## 配置说明 + +主要配置文件位于 `src/main/resources/bootstrap.yml`,核心配置项: + +- Nacos 地址配置 +- MySQL 数据源 +- Redis 连接 +- RabbitMQ 多集群配置 +- 服务端口与路径 + +## API 文档 + +各服务提供完整的 RESTful API: + +- 鉴权接口:JWT Token 签发与验证 +- 用户接口:注册、登录、购物车、地址 +- 商品接口:SPU/SKU 增删改查 +- 订单接口:创建、查询、结算 +- 店铺接口:店铺管理 +- 搜索接口:商品检索 + +详细 API 说明见各服务的 HELP.md 文件。 + +## 开发规范 + +- 提交信息使用中文 +- 代码遵循 Google Java Style +- 分支管理使用 Git Flow +- 使用 Lombok 减少样板代码 +- 接口返回统一 ApiResult 格式 + +## 许可证 + +MIT License +``` + +## 注意事项 + +1. 项目中使用 MyBatis Plus 进行数据库操作,需根据业务需求创建对应的数据库表 +2. OCR 识别功能依赖 Python 3 环境,请确保系统已安装 Python +3. RabbitMQ 采用多 vhost 设计,可根据需要配置不同的集群 +4. 部分功能需要配合 Nacos 配置中心使用 + +如有问题,请提交 Issue 或联系维护者。 \ No newline at end of file