# piko017/kutangguo-mes architecture

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

- Interactive diagram: https://gitdiagram.com/piko017/kutangguo-mes
- Repository: https://github.com/piko017/kutangguo-mes

## Overview

##### High-Level Architecture Components

**[Client Layer]**
- Web Browser (PC)
- Mobile App (Android)
- Touch Screen Interface
- PDA Interface

**[Application Layer]**
- ktg-admin (Main Application Entry)
- ktg-framework (Core Framework)
- ktg-system (System Management)
- ktg-mes (MES Core Business Logic)
- ktg-quartz (Task Scheduling)
- ktg-print (Printing Service)
- ktg-generator (Code Generator)

**[Infrastructure Layer]**
- Database
- Redis Cache
- File Storage

##### Core Business Modules

**[MES Core Modules]**
- MD (Master Data Management)
- PRO (Production Management)
- QC (Quality Control)
- WM (Warehouse Management)
- DV (Device Management)
- CAL (Calendar/Scheduling)
- TM (Tool Management)

##### Integration Points and Data Flow

Key integration points:
**[External Systems Integration]**
- Barcode System
- Printing System
- Report System (UReport)
- WebSocket for Real-time Communication

##### Detailed Component Relationships

For each major module, show internal components:

**Example for Production Module (PRO):**
- Process Management
- Route Management
- Work Order Management
- Task Management
- Production Feedback
- Production Planning

##### Cross-Cutting Concerns

System-wide components:
**[Common Services]**
- Security/Authentication
- Message Queue
- Logging
- Caching
- File Storage

##### Key Technical Details

- Database connections
- Cache implementation
- Security boundaries
- API endpoints
- Mobile/Web interfaces
- WebSocket connections for real-time data
- File storage integration

##### Scalability points

Remember to:
- Use consistent notation
- Related components
- Clear boundaries between modules

- Database schema overview
- Security flow
- Deployment architecture
- Mobile/Touch screen interface architecture

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client["Client Layer"]
        WB[Web Browser]
        MA[Mobile App]
        TS[Touch Screen]
        PDA[PDA Interface]
    end

    subgraph App["Application Layer"]
        ADMIN["Main Application Entry"]:::app
        FRAMEWORK["Core Framework"]:::app
        SYSTEM["System Management"]:::app
        MES["MES Core"]:::app
        QUARTZ["Task Scheduling"]:::app
        PRINT["Printing Service"]:::app
        GEN["Code Generator"]:::app
    end

    subgraph MESCore["MES Core Modules"]
        MD["Master Data Management"]:::mes
        PRO["Production Management"]:::mes
        QC["Quality Control"]:::mes
        WM["Warehouse Management"]:::mes
        DV["Device Management"]:::mes
        CAL["Calendar/Scheduling"]:::mes
        TM["Tool Management"]:::mes
    end

    subgraph Integration["Integration Systems"]
        BAR["Barcode System"]:::int
        PS["Printing System"]:::int
        REP["Report System"]:::int
        WS["WebSocket"]:::int
    end

    subgraph Common["Common Services"]
        SEC["Security/Authentication"]:::common
        MQ["Message Queue"]:::common
        CACHE["Caching"]:::common
        FS["File Storage"]:::common
    end

    subgraph Infra["Infrastructure Layer"]
        DB[(Database)]
        REDIS[(Redis Cache)]
        STORAGE[("File Storage")]
    end

    %% Client Layer Connections
    WB --> ADMIN
    MA --> ADMIN
    TS --> ADMIN
    PDA --> ADMIN

    %% Application Layer Connections
    ADMIN --> FRAMEWORK
    ADMIN --> SYSTEM
    ADMIN --> MES
    ADMIN --> QUARTZ
    ADMIN --> PRINT

    %% MES Core Connections
    MES --> MD
    MES --> PRO
    MES --> QC
    MES --> WM
    MES --> DV
    MES --> CAL
    MES --> TM

    %% Integration Connections
    WM --> BAR
    MES --> PS
    MES --> REP
    MES --> WS

    %% Common Services Connections
    FRAMEWORK --> SEC
    FRAMEWORK --> MQ
    FRAMEWORK --> CACHE
    FRAMEWORK --> FS

    %% Infrastructure Connections
    CACHE --> REDIS
    FS --> STORAGE
    MES --> DB

    %% Styles
    classDef app fill:#2374ab
    classDef mes fill:#048ba8
    classDef int fill:#f18f01
    classDef common fill:#99c24d
    classDef infra fill:#2e4057

    %% Click Events
    click ADMIN "https://github.com/piko017/KuTangGuo-MES/tree/master/ktg-admin/"
    click FRAMEWORK "https://github.com/piko017/KuTangGuo-MES/tree/master/ktg-framework/"
    click SYSTEM "https://github.com/piko017/KuTangGuo-MES/tree/master/ktg-system/"
    click MES "https://github.com/piko017/KuTangGuo-MES/tree/master/ktg-mes/"
    click QUARTZ "https://github.com/piko017/KuTangGuo-MES/tree/master/ktg-quartz/"
    click PRINT "https://github.com/piko017/KuTangGuo-MES/tree/master/ktg-print/"
    click GEN "https://github.com/piko017/KuTangGuo-MES/tree/master/ktg-generator/"
    click MD "https://github.com/piko017/KuTangGuo-MES/tree/master/ktg-mes/src/main/java/com/ktg/mes/md/"
    click PRO "https://github.com/piko017/KuTangGuo-MES/tree/master/ktg-mes/src/main/java/com/ktg/mes/pro/"
    click QC "https://github.com/piko017/KuTangGuo-MES/tree/master/ktg-mes/src/main/java/com/ktg/mes/qc/"
    click WM "https://github.com/piko017/KuTangGuo-MES/tree/master/ktg-mes/src/main/java/com/ktg/mes/wm/"
    click DV "https://github.com/piko017/KuTangGuo-MES/tree/master/ktg-mes/src/main/java/com/ktg/mes/dv/"
    click CAL "https://github.com/piko017/KuTangGuo-MES/tree/master/ktg-mes/src/main/java/com/ktg/mes/cal/"
    click TM "https://github.com/piko017/KuTangGuo-MES/tree/master/ktg-mes/src/main/java/com/ktg/mes/tm/"
    click BAR "https://github.com/piko017/KuTangGuo-MES/blob/master/ktg-mes/src/main/java/com/ktg/mes/wm/utils/WmBarCodeUtil.java"
    click PS "https://github.com/piko017/KuTangGuo-MES/tree/master/ktg-print/src/main/java/com/ktg/print/"
    click REP "https://github.com/piko017/KuTangGuo-MES/tree/master/ktg-mes/src/main/java/com/ktg/mes/report/"
    click WS "https://github.com/piko017/KuTangGuo-MES/tree/master/ktg-framework/src/main/java/com/ktg/framework/websocket/"
    click SEC "https://github.com/piko017/KuTangGuo-MES/tree/master/ktg-framework/src/main/java/com/ktg/framework/security/"
    click MQ "https://github.com/piko017/KuTangGuo-MES/tree/master/ktg-framework/src/main/java/com/ktg/framework/message/"
    click CACHE "https://github.com/piko017/KuTangGuo-MES/tree/master/ktg-framework/src/main/java/com/ktg/framework/redis/"
    click FS "https://github.com/piko017/KuTangGuo-MES/tree/master/ktg-common/src/main/java/com/ktg/common/utils/file/"
```
