# shenghui-waa/tokenordermgmt architecture

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

- Interactive diagram: https://gitdiagram.com/shenghui-waa/tokenordermgmt
- Repository: https://github.com/shenghui-waa/tokenordermgmt

## Overview

TokenOrderMgmt is a local API-token purchasing and invoicing records manager, not a payment or token-issuance system. Users manage orders, providers, invoice titles, invoices, and trashed orders through a React app; the app loads backend records, applies client-side search/filtering and action validation, then submits changes to Spring services backed by SQLite. The README documents the broader UI capabilities; sampled sources confirm key order and invoice flows, but not every service implementation or frontend API mapping.

Main entry points: [`source/frontend/src/api.ts`](https://github.com/shenghui-waa/tokenordermgmt/blob/main/source/frontend/src/api.ts) (API client), [`source/frontend/src/App.tsx`](https://github.com/shenghui-waa/tokenordermgmt/blob/main/source/frontend/src/App.tsx) (Pages and navigation), [`source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/mapper`](https://github.com/shenghui-waa/tokenordermgmt/tree/main/source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/mapper) (Data access), [`source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/service/impl`](https://github.com/shenghui-waa/tokenordermgmt/tree/main/source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/service/impl) (Provider and title logic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Frontend"]
  node_app["Pages and navigation<br/>[App.tsx]"]
  node_forms["Business forms<br/>[BusinessForm.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_domain["Search and rules<br/>[domain.ts]"]
end

subgraph group_api["HTTP API"]
  node_orders_api["Order endpoints"]
  node_invoice_api["Invoice endpoints"]
  node_provider_api["Provider endpoints"]
  node_title_api["Title endpoints"]
end

subgraph group_logic["Business Services"]
  node_order_service["Order management"]
  node_invoice_service["Invoice lifecycle"]
  node_other_services["Provider and title logic"]
end

subgraph group_data["Persistence"]
  node_mappers["Data access"]
  node_sqlite[("SQLite records")]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"opens forms"| node_forms
node_app -->|"searches and validates"| node_domain
node_app -->|"loads and submits"| node_api_client
node_api_client -->|"HTTP requests"| node_orders_api
node_api_client -->|"HTTP requests"| node_invoice_api
node_api_client -->|"HTTP requests"| node_provider_api
node_api_client -->|"HTTP requests"| node_title_api
node_orders_api -->|"dispatches"| node_order_service
node_invoice_api -->|"dispatches"| node_invoice_service
node_provider_api -->|"dispatches"| node_other_services
node_title_api -->|"dispatches"| node_other_services
node_order_service -->|"reads and writes"| node_mappers
node_invoice_service -->|"reads and writes"| node_mappers
node_other_services -->|"data access"| node_mappers
node_mappers -->|"persists records"| node_sqlite

click node_app "https://github.com/shenghui-waa/tokenordermgmt/blob/main/source/frontend/src/App.tsx"
click node_forms "https://github.com/shenghui-waa/tokenordermgmt/blob/main/source/frontend/src/pages/BusinessForm.tsx"
click node_api_client "https://github.com/shenghui-waa/tokenordermgmt/blob/main/source/frontend/src/api.ts"
click node_domain "https://github.com/shenghui-waa/tokenordermgmt/blob/main/source/frontend/src/domain.ts"
click node_orders_api "https://github.com/shenghui-waa/tokenordermgmt/blob/main/source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/controller/TokenOrderController.java"
click node_invoice_api "https://github.com/shenghui-waa/tokenordermgmt/blob/main/source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/controller/InvoiceController.java"
click node_provider_api "https://github.com/shenghui-waa/tokenordermgmt/blob/main/source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/controller/ProviderController.java"
click node_title_api "https://github.com/shenghui-waa/tokenordermgmt/blob/main/source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/controller/InvoiceTitleController.java"
click node_order_service "https://github.com/shenghui-waa/tokenordermgmt/blob/main/source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/service/impl/TokenOrderServiceImpl.java"
click node_invoice_service "https://github.com/shenghui-waa/tokenordermgmt/blob/main/source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/service/impl/InvoiceServiceImpl.java"
click node_other_services "https://github.com/shenghui-waa/tokenordermgmt/tree/main/source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/service/impl"
click node_mappers "https://github.com/shenghui-waa/tokenordermgmt/tree/main/source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/mapper"

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_app,node_forms,node_api_client,node_domain,node_user toneBlue
class node_orders_api,node_invoice_api,node_provider_api,node_title_api toneAmber
class node_order_service,node_invoice_service,node_other_services toneMint
class node_mappers,node_sqlite toneRose
```

## Components

### Frontend

- [Pages and navigation](https://github.com/shenghui-waa/tokenordermgmt/blob/main/source/frontend/src/App.tsx): `source/frontend/src/App.tsx`
- [Business forms](https://github.com/shenghui-waa/tokenordermgmt/blob/main/source/frontend/src/pages/BusinessForm.tsx): `source/frontend/src/pages/BusinessForm.tsx`
- [API client](https://github.com/shenghui-waa/tokenordermgmt/blob/main/source/frontend/src/api.ts): `source/frontend/src/api.ts`
- [Search and rules](https://github.com/shenghui-waa/tokenordermgmt/blob/main/source/frontend/src/domain.ts): `source/frontend/src/domain.ts`

### HTTP API

- [Order endpoints](https://github.com/shenghui-waa/tokenordermgmt/blob/main/source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/controller/TokenOrderController.java): `source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/controller/TokenOrderController.java`
- [Invoice endpoints](https://github.com/shenghui-waa/tokenordermgmt/blob/main/source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/controller/InvoiceController.java): `source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/controller/InvoiceController.java`
- [Provider endpoints](https://github.com/shenghui-waa/tokenordermgmt/blob/main/source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/controller/ProviderController.java): `source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/controller/ProviderController.java`
- [Title endpoints](https://github.com/shenghui-waa/tokenordermgmt/blob/main/source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/controller/InvoiceTitleController.java): `source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/controller/InvoiceTitleController.java`

### Business Services

- [Order management](https://github.com/shenghui-waa/tokenordermgmt/blob/main/source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/service/impl/TokenOrderServiceImpl.java): `source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/service/impl/TokenOrderServiceImpl.java`
- [Invoice lifecycle](https://github.com/shenghui-waa/tokenordermgmt/blob/main/source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/service/impl/InvoiceServiceImpl.java): `source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/service/impl/InvoiceServiceImpl.java`
- [Provider and title logic](https://github.com/shenghui-waa/tokenordermgmt/tree/main/source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/service/impl): `source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/service/impl`

### Persistence

- [Data access](https://github.com/shenghui-waa/tokenordermgmt/tree/main/source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/mapper): `source/backend/TokenOrderMgmt/src/main/java/com/shuye/tokenordermgmt/mapper`
- **SQLite records**

### Other components

- **User**

## Connections

- User → Pages and navigation: uses
- Pages and navigation → Business forms: opens forms
- Pages and navigation → Search and rules: searches and validates
- Pages and navigation → API client: loads and submits
- API client → Order endpoints: HTTP requests
- API client → Invoice endpoints: HTTP requests
- API client → Provider endpoints: HTTP requests
- API client → Title endpoints: HTTP requests
- Order endpoints → Order management: dispatches
- Invoice endpoints → Invoice lifecycle: dispatches
- Provider endpoints → Provider and title logic: dispatches
- Title endpoints → Provider and title logic: dispatches
- Order management → Data access: reads and writes
- Invoice lifecycle → Data access: reads and writes
- Provider and title logic → Data access: data access
- Data access → SQLite records: persists records
