# huaye0517/erp architecture

> Architecture diagram of the GitHub repository huaye0517/erp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/huaye0517/erp
- Repository: https://github.com/huaye0517/erp

## Overview

This is a Django ERP whose main user workflow is entering the web application to manage sales, purchasing, inventory, and supporting organization and master data, with records persisted in the configured database. A separate integration pulls sales orders, warehouses, goods, and stock from Jackyun into the ERP; warehouse and goods data are prerequisites for inventory matching. The README also documents workflow approvals and bulk imports. The tree and sampled files establish the modules and Jackyun client, but the domain views, models, and sync implementations were not sampled, so internal call wiring is shown conservatively.

Main entry points: [`mis/urls.py`](https://github.com/huaye0517/erp/blob/master/mis/urls.py) (Web routes), [`mis/settings.py`](https://github.com/huaye0517/erp/blob/master/mis/settings.py) (ERP database), [`jackyun/client.py`](https://github.com/huaye0517/erp/blob/master/jackyun/client.py) (API client), [`jackyun/sync.py`](https://github.com/huaye0517/erp/blob/master/jackyun/sync.py) (Jackyun sync)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g_entry["ERP access"]
  node_routes["Web routes<br/>[urls.py]"]
end

subgraph group_g_ops["Business operations"]
  node_sales["Sales management<br/>[views.py]"]
  node_purchasing["Purchasing<br/>[views.py]"]
  node_inventory["Inventory<br/>[views.py]"]
  node_hr["HR<br/>[views.py]"]
  node_selfservice["Self-service<br/>[views.py]"]
end

subgraph group_g_foundation["ERP foundations"]
  node_masterdata["Master data<br/>[views.py]"]
  node_organization["Organization<br/>[views.py]"]
  node_workflow["Workflow approvals<br/>[views.py]"]
  node_configuration["System configuration<br/>[views.py]"]
end

subgraph group_g_jackyun["Jackyun integration"]
  node_jackyun_sync["Jackyun sync<br/>[sync.py]"]
  node_goods_sync["Goods sync<br/>[sync_goods.py]"]
  node_warehouse_sync["Warehouse sync<br/>[sync_warehouse.py]"]
  node_inventory_sync["Stock sync<br/>[sync_inventory.py]"]
  node_jackyun_client["API client<br/>[client.py]"]
end

subgraph group_g_state["Persistence"]
  node_database[("ERP database<br/>[settings.py]")]
end

node_user(("ERP user"))
node_jackyun_api{{"Jackyun platform"}}

node_user -->|"opens"| node_routes
node_routes -->|"routes requests"| node_sales
node_routes -->|"routes requests"| node_purchasing
node_routes -->|"routes requests"| node_inventory
node_routes -->|"routes requests"| node_hr
node_routes -->|"routes requests"| node_selfservice
node_routes -->|"routes requests"| node_masterdata
node_routes -->|"routes requests"| node_organization
node_routes -->|"routes requests"| node_workflow
node_routes -->|"routes requests"| node_configuration
node_jackyun_sync -->|"uses API client"| node_jackyun_client
node_goods_sync -->|"requests goods"| node_jackyun_client
node_warehouse_sync -->|"requests warehouses"| node_jackyun_client
node_inventory_sync -->|"requests stock"| node_jackyun_client
node_jackyun_client -->|"sends requests"| node_jackyun_api
node_jackyun_api -->|"returns data"| node_jackyun_client
node_jackyun_sync -->|"saves ERP data"| node_database
node_goods_sync -->|"saves ERP data"| node_database
node_warehouse_sync -->|"saves ERP data"| node_database
node_inventory_sync -->|"matches and saves"| node_database
node_sales -->|"reads and writes"| node_database
node_purchasing -->|"reads and writes"| node_database
node_inventory -->|"reads and writes"| node_database
node_masterdata -->|"reads and writes"| node_database

click node_routes "https://github.com/huaye0517/erp/blob/master/mis/urls.py"
click node_sales "https://github.com/huaye0517/erp/blob/master/sale/views.py"
click node_purchasing "https://github.com/huaye0517/erp/blob/master/purchase/views.py"
click node_inventory "https://github.com/huaye0517/erp/blob/master/invent/views.py"
click node_hr "https://github.com/huaye0517/erp/blob/master/hr/views.py"
click node_selfservice "https://github.com/huaye0517/erp/blob/master/selfhelp/views.py"
click node_masterdata "https://github.com/huaye0517/erp/blob/master/basedata/views.py"
click node_organization "https://github.com/huaye0517/erp/blob/master/organ/views.py"
click node_workflow "https://github.com/huaye0517/erp/blob/master/workflow/views.py"
click node_configuration "https://github.com/huaye0517/erp/blob/master/syscfg/views.py"
click node_jackyun_sync "https://github.com/huaye0517/erp/blob/master/jackyun/sync.py"
click node_goods_sync "https://github.com/huaye0517/erp/blob/master/jackyun/sync_goods.py"
click node_warehouse_sync "https://github.com/huaye0517/erp/blob/master/jackyun/sync_warehouse.py"
click node_inventory_sync "https://github.com/huaye0517/erp/blob/master/jackyun/sync_inventory.py"
click node_jackyun_client "https://github.com/huaye0517/erp/blob/master/jackyun/client.py"
click node_database "https://github.com/huaye0517/erp/blob/master/mis/settings.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_routes,node_user toneBlue
class node_sales,node_purchasing,node_inventory,node_hr,node_selfservice toneAmber
class node_masterdata,node_organization,node_workflow,node_configuration toneMint
class node_jackyun_sync,node_goods_sync,node_warehouse_sync,node_inventory_sync,node_jackyun_client toneRose
class node_database,node_jackyun_api toneIndigo
```

## Components

### ERP access

- [Web routes](https://github.com/huaye0517/erp/blob/master/mis/urls.py): `mis/urls.py`

### Business operations

- [Sales management](https://github.com/huaye0517/erp/blob/master/sale/views.py): `sale/views.py`
- [Purchasing](https://github.com/huaye0517/erp/blob/master/purchase/views.py): `purchase/views.py`
- [Inventory](https://github.com/huaye0517/erp/blob/master/invent/views.py): `invent/views.py`
- [HR](https://github.com/huaye0517/erp/blob/master/hr/views.py): `hr/views.py`
- [Self-service](https://github.com/huaye0517/erp/blob/master/selfhelp/views.py): `selfhelp/views.py`

### ERP foundations

- [Master data](https://github.com/huaye0517/erp/blob/master/basedata/views.py): `basedata/views.py`
- [Organization](https://github.com/huaye0517/erp/blob/master/organ/views.py): `organ/views.py`
- [Workflow approvals](https://github.com/huaye0517/erp/blob/master/workflow/views.py): `workflow/views.py`
- [System configuration](https://github.com/huaye0517/erp/blob/master/syscfg/views.py): `syscfg/views.py`

### Jackyun integration

- [Jackyun sync](https://github.com/huaye0517/erp/blob/master/jackyun/sync.py): `jackyun/sync.py`
- [Goods sync](https://github.com/huaye0517/erp/blob/master/jackyun/sync_goods.py): `jackyun/sync_goods.py`
- [Warehouse sync](https://github.com/huaye0517/erp/blob/master/jackyun/sync_warehouse.py): `jackyun/sync_warehouse.py`
- [Stock sync](https://github.com/huaye0517/erp/blob/master/jackyun/sync_inventory.py): `jackyun/sync_inventory.py`
- [API client](https://github.com/huaye0517/erp/blob/master/jackyun/client.py): `jackyun/client.py`

### Persistence

- [ERP database](https://github.com/huaye0517/erp/blob/master/mis/settings.py): `mis/settings.py`

### Other components

- **ERP user**
- **Jackyun platform**

## Connections

- ERP user → Web routes: opens
- Web routes → Sales management: routes requests
- Web routes → Purchasing: routes requests
- Web routes → Inventory: routes requests
- Web routes → HR: routes requests
- Web routes → Self-service: routes requests
- Web routes → Master data: routes requests
- Web routes → Organization: routes requests
- Web routes → Workflow approvals: routes requests
- Web routes → System configuration: routes requests
- Jackyun sync → API client: uses API client
- Goods sync → API client: requests goods
- Warehouse sync → API client: requests warehouses
- Stock sync → API client: requests stock
- API client → Jackyun platform: sends requests
- Jackyun platform → API client: returns data
- Jackyun sync → ERP database: saves ERP data
- Goods sync → ERP database: saves ERP data
- Warehouse sync → ERP database: saves ERP data
- Stock sync → ERP database: matches and saves
- Sales management → ERP database: reads and writes
- Purchasing → ERP database: reads and writes
- Inventory → ERP database: reads and writes
- Master data → ERP database: reads and writes
