# jeequan/jeepay architecture

> Architecture diagram of the GitHub repository jeequan/jeepay, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jeequan/jeepay
- Repository: https://github.com/jeequan/jeepay

## Overview

##### High-Level Architecture Components

**[Client Layer]**
- Merchant Applications
- Management UI (Ant Design Vue)
- Payment UI/Cashier

**[Gateway Layer]**
- Payment Gateway (jeepay-payment) [Port:9216]
- Merchant System (jeepay-merchant) [Port:9218]
- Management Platform (jeepay-manager) [Port:9217]

**[Service Layer]**
- Core Services (jeepay-service)
- Components
- MQ Component
- OSS Component

**[Infrastructure Layer]**
- MySQL Database
- Redis Cache
- Message Queue (ActiveMQ/RabbitMQ/RocketMQ)
- Object Storage

##### Key Integration Points

**[Payment Channels]**
- WeChat Pay (V2/V3)
- Alipay
- UnionPay
- Third-party Payment Services

**[External Systems]**
- Merchant Backend Systems
- Bank Systems
- Third-party Services

##### Data Flow Patterns

Main data flows:

**[Payment Flow]**
**Client -> Payment Gateway -> Payment Channel -> Payment Notification -> MQ -> Merchant System**

**[Management Flow]**
**Admin UI -> Management Platform -> Core Services -> Database**

**[Merchant Flow]**
**Merchant UI -> Merchant System -> Core Services -> Database**

##### Important Details

- Service ports (9216, 9217, 9218)
- Security zones
- Load balancers
- Database relationships
- Message queue topics/channels
- API endpoints

##### Technical Stack Indicators

Technology badges for:
- Spring Boot 2.4.5
- MySQL 5.7/8.0
- Redis 3.2.8+
- Java 8
- Ant Design Vue
- MyBatis-Plus

##### Security Layers

Security components:
- Spring Security integration
- API authentication
- Payment signature verification
- Data encryption

- The distributed nature of the system
- High availability features
- Scalability points
- Security boundaries
- Integration flexibility

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef client fill:#E1F5FE,stroke:#01579B
    classDef gateway fill:#E8F5E9,stroke:#1B5E20
    classDef service fill:#FFF3E0,stroke:#E65100
    classDef infra fill:#EFEBE9,stroke:#3E2723
    classDef channel fill:#F3E5F5,stroke:#4A148C
    classDef external fill:#FAFAFA,stroke:#424242

    %% Client Layer
    subgraph ClientLayer["Client Layer"]
        MA[Merchant Applications]:::client
        MUI[Management UI]:::client
        PUI[Payment UI/Cashier]:::client
    end

    %% Gateway Layer
    subgraph GatewayLayer["Gateway Layer"]
        PG["Payment Gateway (9216)"]:::gateway
        MS["Merchant System (9218)"]:::gateway
        MP["Management Platform (9217)"]:::gateway
    end

    %% Service Layer
    subgraph ServiceLayer["Service Layer"]
        CS[Core Services]:::service
        MQC[MQ Component]:::service
        OSSC[OSS Component]:::service
    end

    %% Infrastructure Layer
    subgraph InfraLayer["Infrastructure Layer"]
        DB[(MySQL)]:::infra
        RC[(Redis)]:::infra
        MQ[Message Queue]:::infra
        OS[Object Storage]:::infra
    end

    %% Payment Channels
    subgraph Channels["Payment Channels"]
        WP[WeChat Pay V2/V3]:::channel
        AP[Alipay]:::channel
        UP[UnionPay]:::channel
        TPS[Third-party Services]:::channel
    end

    %% External Systems
    subgraph ExternalSystems["External Systems"]
        MBS[Merchant Backend]:::external
        BS[Bank Systems]:::external
    end

    %% Connections
    MA --> PG
    MUI --> MP
    PUI --> PG
    PG --> CS
    MS --> CS
    MP --> CS
    CS --> DB
    CS --> RC
    CS --> MQC
    CS --> OSSC
    MQC --> MQ
    OSSC --> OS
    PG --> WP & AP & UP & TPS
    WP & AP & UP & TPS --> MBS
    WP & AP & UP & TPS --> BS

    %% Click Events
    click PG "https://github.com/jeequan/jeepay/tree/master/jeepay-payment/"
    click MS "https://github.com/jeequan/jeepay/tree/master/jeepay-merchant/"
    click MP "https://github.com/jeequan/jeepay/tree/master/jeepay-manager/"
    click CS "https://github.com/jeequan/jeepay/tree/master/jeepay-service/"
    click MQC "https://github.com/jeequan/jeepay/tree/master/jeepay-components/jeepay-components-mq/"
    click OSSC "https://github.com/jeequan/jeepay/tree/master/jeepay-components/jeepay-components-oss/"
    click WP "https://github.com/jeequan/jeepay/tree/master/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/channel/wxpay/"
    click AP "https://github.com/jeequan/jeepay/tree/master/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/channel/alipay/"
    click UP "https://github.com/jeequan/jeepay/tree/master/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/channel/plspay/"
    click RC "https://github.com/jeequan/jeepay/blob/master/conf/devCommons/config/application.yml"
    click DB "https://github.com/jeequan/jeepay/tree/master/docs/sql/"
    click MQ "https://github.com/jeequan/jeepay/tree/master/docker/activemq/"
```
