# mrlizard12138/heshu architecture

> Architecture diagram of the GitHub repository mrlizard12138/heshu, 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/mrlizard12138/heshu
- Repository: https://github.com/mrlizard12138/heshu

## Overview

合署 is an internal departmental digital-workbench platform with a unified login and entry point. Users administer members and permissions, design and publish surveys, collect and analyze submissions, configure review projects and score live survey or Feishu records, and run efficiency-tool workflows. The map keeps those product stages distinct while showing the shared web/API boundary and platform services. README documentation establishes several capabilities not represented in sampled source; those branches are included at subsystem level, without asserting unsampled internal call sequences.

Main entry points: [`clients/web/src/app/app.tsx`](https://github.com/mrlizard12138/heshu/blob/master/clients/web/src/app/app.tsx) (Web application), [`clients/web/src/app/api.ts`](https://github.com/mrlizard12138/heshu/blob/master/clients/web/src/app/api.ts) (Session and API), [`server/platform/src/app/composition_root.ts`](https://github.com/mrlizard12138/heshu/blob/master/server/platform/src/app/composition_root.ts) (Platform app), [`server/platform/src/modules/review`](https://github.com/mrlizard12138/heshu/tree/master/server/platform/src/modules/review) (Review services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web workbench"]
  node_webapp["Web application<br/>[app.tsx]"]
  node_auth["Session and API<br/>[api.ts]"]
  node_admin["Administration"]
end

subgraph group_survey["Survey lifecycle"]
  node_surveyui["Survey workspace"]
  node_surveylogic["Survey logic<br/>[logicEngine.ts]"]
  node_surveyservice["Survey services"]
  node_surveyfiles[("Survey file store<br/>[object_store.ts]")]
end

subgraph group_review["Review scoring"]
  node_reviewui["Review workspace"]
  node_reviewservice["Review services"]
  node_integrations["External connections"]
end

subgraph group_platform["Platform services"]
  node_contracts["API contracts<br/>[index.ts]"]
  node_platformapp["Platform app"]
  node_database[("MySQL database<br/>[database.ts]")]
  node_adminservice["Admin services"]
end

subgraph group_tools["Efficiency tools"]
  node_toolui["Tool workbench"]
  node_toolsservice["Python tools service"]
end

node_staff(("Department staff"))
node_feishu["Feishu platform"]

node_staff -->|"uses"| node_webapp
node_webapp -->|"requests"| node_auth
node_webapp -->|"opens module"| node_admin
node_webapp -->|"opens module"| node_surveyui
node_webapp -->|"opens module"| node_reviewui
node_webapp -->|"opens module"| node_toolui
node_admin -->|"calls API"| node_auth
node_surveyui -->|"calls API"| node_auth
node_reviewui -->|"calls API"| node_auth
node_toolui -->|"calls API"| node_auth
node_surveyui -->|"evaluates rules"| node_surveylogic
node_auth -->|"sends requests"| node_platformapp
node_platformapp -->|"uses shapes"| node_contracts
node_platformapp -->|"dispatches"| node_adminservice
node_platformapp -->|"dispatches"| node_surveyservice
node_platformapp -->|"dispatches"| node_reviewservice
node_adminservice -->|"reads and writes"| node_database
node_surveyservice -->|"reads and writes"| node_database
node_surveyservice -->|"stores files"| node_surveyfiles
node_reviewservice -->|"reads and writes"| node_database
node_reviewservice -->|"reads survey sources"| node_surveyservice
node_reviewservice -->|"uses connections"| node_integrations
node_integrations -.->|"calls API"| node_feishu
node_toolui -->|"runs workflows"| node_toolsservice

click node_webapp "https://github.com/mrlizard12138/heshu/blob/master/clients/web/src/app/app.tsx"
click node_auth "https://github.com/mrlizard12138/heshu/blob/master/clients/web/src/app/api.ts"
click node_admin "https://github.com/mrlizard12138/heshu/tree/master/clients/web/src/modules/administration"
click node_surveyui "https://github.com/mrlizard12138/heshu/tree/master/clients/web/src/modules/survey"
click node_surveylogic "https://github.com/mrlizard12138/heshu/blob/master/clients/web/src/modules/survey/source/shared/logicEngine.ts"
click node_reviewui "https://github.com/mrlizard12138/heshu/tree/master/clients/web/src/modules/review"
click node_toolui "https://github.com/mrlizard12138/heshu/tree/master/clients/web/src/modules/tools"
click node_contracts "https://github.com/mrlizard12138/heshu/blob/master/packages/contracts/src/index.ts"
click node_platformapp "https://github.com/mrlizard12138/heshu/blob/master/server/platform/src/app/composition_root.ts"
click node_database "https://github.com/mrlizard12138/heshu/blob/master/server/platform/src/infrastructure/database/database.ts"
click node_adminservice "https://github.com/mrlizard12138/heshu/tree/master/server/platform/src/modules/administration"
click node_surveyservice "https://github.com/mrlizard12138/heshu/tree/master/server/platform/src/modules/survey"
click node_surveyfiles "https://github.com/mrlizard12138/heshu/blob/master/server/platform/src/infrastructure/files/object_store.ts"
click node_reviewservice "https://github.com/mrlizard12138/heshu/tree/master/server/platform/src/modules/review"
click node_integrations "https://github.com/mrlizard12138/heshu/tree/master/server/platform/src/modules/integrations"
click node_toolsservice "https://github.com/mrlizard12138/heshu/tree/master/server/tools"

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_webapp,node_auth,node_admin toneBlue
class node_surveyui,node_surveylogic,node_surveyservice,node_surveyfiles toneAmber
class node_reviewui,node_reviewservice,node_integrations toneMint
class node_contracts,node_platformapp,node_database,node_adminservice toneRose
class node_toolui,node_toolsservice,node_staff,node_feishu toneIndigo
```

## Components

### Web workbench

- [Web application](https://github.com/mrlizard12138/heshu/blob/master/clients/web/src/app/app.tsx): `clients/web/src/app/app.tsx`
- [Session and API](https://github.com/mrlizard12138/heshu/blob/master/clients/web/src/app/api.ts): `clients/web/src/app/api.ts`
- [Administration](https://github.com/mrlizard12138/heshu/tree/master/clients/web/src/modules/administration): `clients/web/src/modules/administration`

### Survey lifecycle

- [Survey workspace](https://github.com/mrlizard12138/heshu/tree/master/clients/web/src/modules/survey): `clients/web/src/modules/survey`
- [Survey logic](https://github.com/mrlizard12138/heshu/blob/master/clients/web/src/modules/survey/source/shared/logicEngine.ts): `clients/web/src/modules/survey/source/shared/logicEngine.ts`
- [Survey services](https://github.com/mrlizard12138/heshu/tree/master/server/platform/src/modules/survey): `server/platform/src/modules/survey`
- [Survey file store](https://github.com/mrlizard12138/heshu/blob/master/server/platform/src/infrastructure/files/object_store.ts): `server/platform/src/infrastructure/files/object_store.ts`

### Review scoring

- [Review workspace](https://github.com/mrlizard12138/heshu/tree/master/clients/web/src/modules/review): `clients/web/src/modules/review`
- [Review services](https://github.com/mrlizard12138/heshu/tree/master/server/platform/src/modules/review): `server/platform/src/modules/review`
- [External connections](https://github.com/mrlizard12138/heshu/tree/master/server/platform/src/modules/integrations): `server/platform/src/modules/integrations`

### Platform services

- [API contracts](https://github.com/mrlizard12138/heshu/blob/master/packages/contracts/src/index.ts): `packages/contracts/src/index.ts`
- [Platform app](https://github.com/mrlizard12138/heshu/blob/master/server/platform/src/app/composition_root.ts): `server/platform/src/app/composition_root.ts`
- [MySQL database](https://github.com/mrlizard12138/heshu/blob/master/server/platform/src/infrastructure/database/database.ts): `server/platform/src/infrastructure/database/database.ts`
- [Admin services](https://github.com/mrlizard12138/heshu/tree/master/server/platform/src/modules/administration): `server/platform/src/modules/administration`

### Efficiency tools

- [Tool workbench](https://github.com/mrlizard12138/heshu/tree/master/clients/web/src/modules/tools): `clients/web/src/modules/tools`
- [Python tools service](https://github.com/mrlizard12138/heshu/tree/master/server/tools): `server/tools`

### Other components

- **Department staff**
- **Feishu platform**

## Connections

- Department staff → Web application: uses
- Web application → Session and API: requests
- Web application → Administration: opens module
- Web application → Survey workspace: opens module
- Web application → Review workspace: opens module
- Web application → Tool workbench: opens module
- Administration → Session and API: calls API
- Survey workspace → Session and API: calls API
- Review workspace → Session and API: calls API
- Tool workbench → Session and API: calls API
- Survey workspace → Survey logic: evaluates rules
- Session and API → Platform app: sends requests
- Platform app → API contracts: uses shapes
- Platform app → Admin services: dispatches
- Platform app → Survey services: dispatches
- Platform app → Review services: dispatches
- Admin services → MySQL database: reads and writes
- Survey services → MySQL database: reads and writes
- Survey services → Survey file store: stores files
- Review services → MySQL database: reads and writes
- Review services → Survey services: reads survey sources
- Review services → External connections: uses connections
- External connections → Feishu platform: calls API
- Tool workbench → Python tools service: runs workflows
