# shirowei/ruoyi-oa-demo architecture

> Architecture diagram of the GitHub repository shirowei/ruoyi-oa-demo, 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/shirowei/ruoyi-oa-demo
- Repository: https://github.com/shirowei/ruoyi-oa-demo

## Overview

RuoYi OA is a workflow-centered office collaboration platform. Employees use the web client through the gateway to submit leave, reimbursement, or travel applications; approval creates a numbered application and flow, creates a linked todo, and later completes that todo when approved or rejected. Separate services provide the todo center, calendar, contacts, and portal dashboard/assistant; the portal aggregates business-service data. System administration and authentication support the platform. The README documents the cross-service links; only selected source excerpts were sampled, so other internal calls are not inferred.

Main entry points: [`ruoyi-gateway/src/main/java/com/ruoyi/gateway`](https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-gateway/src/main/java/com/ruoyi/gateway) (API gateway), [`ruoyi-modules/ruoyi-portal/src/main/java/com/ruoyi/oa/dashboard`](https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-modules/ruoyi-portal/src/main/java/com/ruoyi/oa/dashboard) (Dashboard statistics), [`ruoyi-modules/ruoyi-approval/src/main/java/com/ruoyi/oa/approval`](https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-modules/ruoyi-approval/src/main/java/com/ruoyi/oa/approval) (Approval service), [`ruoyi-modules/ruoyi-portal/src/main/java/com/ruoyi/oa`](https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-modules/ruoyi-portal/src/main/java/com/ruoyi/oa) (Portal aggregator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and identity"]
  node_web["OA web client<br/>[main.js]"]
  node_gateway["API gateway"]
  node_auth["Authentication"]
end

subgraph group_workflow["Approval workflow"]
  node_approval["Approval service"]
  node_todo["Todo service"]
end

subgraph group_collaboration["Office collaboration"]
  node_calendar["Calendar service"]
  node_contacts["Contacts service"]
end

subgraph group_portal["Workplace portal"]
  node_portal["Portal aggregator"]
  node_dashboard["Dashboard statistics"]
  node_assistant["Demo assistant"]
end

subgraph group_platform["Platform administration"]
  node_system["System administration"]
  node_oaapi["OA Feign clients"]
  node_userapi["System Feign clients"]
  node_redis[("Redis cache<br/>[RedisService.java]")]
  node_businessdb[("OA database")]
end

node_employee(("Employee"))

node_employee -->|"uses"| node_web
node_web -->|"sends requests"| node_gateway
node_gateway -->|"routes auth"| node_auth
node_gateway -->|"routes OA"| node_approval
node_gateway -->|"routes OA"| node_todo
node_gateway -->|"routes OA"| node_calendar
node_gateway -->|"routes OA"| node_contacts
node_gateway -->|"routes portal"| node_portal
node_auth -->|"queries users"| node_userapi
node_auth -->|"checks IP cache"| node_redis
node_approval -->|"uses clients"| node_oaapi
node_approval -.->|"creates or completes todo"| node_todo
node_portal -->|"dispatches dashboard"| node_dashboard
node_portal -->|"dispatches assistant"| node_assistant
node_portal -->|"uses clients"| node_oaapi
node_dashboard -.->|"aggregates statistics"| node_approval
node_dashboard -.->|"aggregates statistics"| node_todo
node_dashboard -.->|"aggregates statistics"| node_calendar
node_dashboard -.->|"aggregates statistics"| node_contacts
node_assistant -.->|"uses business statistics"| node_dashboard
node_system -.->|"persists administration"| node_businessdb
node_approval -.->|"persists applications"| node_businessdb
node_todo -.->|"persists todos"| node_businessdb
node_calendar -.->|"persists events"| node_businessdb
node_contacts -.->|"persists contacts"| node_businessdb

click node_web "https://github.com/shirowei/ruoyi-oa-demo/blob/master/ruoyi-ui/src/main.js"
click node_gateway "https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-gateway/src/main/java/com/ruoyi/gateway"
click node_auth "https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-auth/src/main/java/com/ruoyi/auth"
click node_system "https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system"
click node_approval "https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-modules/ruoyi-approval/src/main/java/com/ruoyi/oa/approval"
click node_todo "https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-modules/ruoyi-todo"
click node_calendar "https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-modules/ruoyi-calendar/src/main/java/com/ruoyi/oa/calendar"
click node_contacts "https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-modules/ruoyi-contacts/src/main/java/com/ruoyi/oa/contacts"
click node_portal "https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-modules/ruoyi-portal/src/main/java/com/ruoyi/oa"
click node_dashboard "https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-modules/ruoyi-portal/src/main/java/com/ruoyi/oa/dashboard"
click node_assistant "https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-modules/ruoyi-portal/src/main/java/com/ruoyi/oa/ai"
click node_oaapi "https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-api/ruoyi-api-oa/src/main/java/com/ruoyi/oa/api"
click node_userapi "https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api"
click node_redis "https://github.com/shirowei/ruoyi-oa-demo/blob/master/ruoyi-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/service/RedisService.java"

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_web,node_gateway,node_auth toneBlue
class node_approval,node_todo toneAmber
class node_calendar,node_contacts toneMint
class node_portal,node_dashboard,node_assistant toneRose
class node_system,node_oaapi,node_userapi,node_redis,node_businessdb,node_employee toneIndigo
```

## Components

### Access and identity

- [OA web client](https://github.com/shirowei/ruoyi-oa-demo/blob/master/ruoyi-ui/src/main.js): `ruoyi-ui/src/main.js`
- [API gateway](https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-gateway/src/main/java/com/ruoyi/gateway): `ruoyi-gateway/src/main/java/com/ruoyi/gateway`
- [Authentication](https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-auth/src/main/java/com/ruoyi/auth): `ruoyi-auth/src/main/java/com/ruoyi/auth`

### Approval workflow

- [Approval service](https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-modules/ruoyi-approval/src/main/java/com/ruoyi/oa/approval): `ruoyi-modules/ruoyi-approval/src/main/java/com/ruoyi/oa/approval`
- [Todo service](https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-modules/ruoyi-todo): `ruoyi-modules/ruoyi-todo`

### Office collaboration

- [Calendar service](https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-modules/ruoyi-calendar/src/main/java/com/ruoyi/oa/calendar): `ruoyi-modules/ruoyi-calendar/src/main/java/com/ruoyi/oa/calendar`
- [Contacts service](https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-modules/ruoyi-contacts/src/main/java/com/ruoyi/oa/contacts): `ruoyi-modules/ruoyi-contacts/src/main/java/com/ruoyi/oa/contacts`

### Workplace portal

- [Portal aggregator](https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-modules/ruoyi-portal/src/main/java/com/ruoyi/oa): `ruoyi-modules/ruoyi-portal/src/main/java/com/ruoyi/oa`
- [Dashboard statistics](https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-modules/ruoyi-portal/src/main/java/com/ruoyi/oa/dashboard): `ruoyi-modules/ruoyi-portal/src/main/java/com/ruoyi/oa/dashboard`
- [Demo assistant](https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-modules/ruoyi-portal/src/main/java/com/ruoyi/oa/ai): `ruoyi-modules/ruoyi-portal/src/main/java/com/ruoyi/oa/ai`

### Platform administration

- [System administration](https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system): `ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system`
- [OA Feign clients](https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-api/ruoyi-api-oa/src/main/java/com/ruoyi/oa/api): `ruoyi-api/ruoyi-api-oa/src/main/java/com/ruoyi/oa/api`
- [System Feign clients](https://github.com/shirowei/ruoyi-oa-demo/tree/master/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api): `ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api`
- [Redis cache](https://github.com/shirowei/ruoyi-oa-demo/blob/master/ruoyi-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/service/RedisService.java): `ruoyi-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/service/RedisService.java`
- **OA database**

### Other components

- **Employee**

## Connections

- Employee → OA web client: uses
- OA web client → API gateway: sends requests
- API gateway → Authentication: routes auth
- API gateway → Approval service: routes OA
- API gateway → Todo service: routes OA
- API gateway → Calendar service: routes OA
- API gateway → Contacts service: routes OA
- API gateway → Portal aggregator: routes portal
- Authentication → System Feign clients: queries users
- Authentication → Redis cache: checks IP cache
- Approval service → OA Feign clients: uses clients
- Approval service → Todo service: creates or completes todo
- Portal aggregator → Dashboard statistics: dispatches dashboard
- Portal aggregator → Demo assistant: dispatches assistant
- Portal aggregator → OA Feign clients: uses clients
- Dashboard statistics → Approval service: aggregates statistics
- Dashboard statistics → Todo service: aggregates statistics
- Dashboard statistics → Calendar service: aggregates statistics
- Dashboard statistics → Contacts service: aggregates statistics
- Demo assistant → Dashboard statistics: uses business statistics
- System administration → OA database: persists administration
- Approval service → OA database: persists applications
- Todo service → OA database: persists todos
- Calendar service → OA database: persists events
- Contacts service → OA database: persists contacts
