# doom1817/roms architecture

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

## Overview

This is a reservoir operations management system: signed-in staff use a Vue admin interface to manage reservoirs, equipment, inspections, hazards and monitoring, then review warnings, statistics and AI reports. The frontend’s API clients communicate with the Spring Boot backend; controllers expose the domain operations, and services implement them. Authentication and role checks protect access, while MyBatis-Plus connects backend operations to MySQL. The README documents the overall frontend/backend API link; individual unsampled page-to-client and service-to-mapper wiring is represented only where the tree or sampled code supports it.

Main entry points: [`frontend/src/api`](https://github.com/doom1817/roms/tree/main/frontend/src/api) (API clients), [`frontend/src/layout/AdminLayout.vue`](https://github.com/doom1817/roms/blob/main/frontend/src/layout/AdminLayout.vue) (Admin layout), [`src/main/java/com/reservoir/management/controller`](https://github.com/doom1817/roms/tree/main/src/main/java/com/reservoir/management/controller) (Domain APIs), [`frontend/src/router/index.js`](https://github.com/doom1817/roms/blob/main/frontend/src/router/index.js) (Page router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_app["Vue application<br/>[main.js]"]
  node_router["Page router<br/>[index.js]"]
  node_layout["Admin layout<br/>[AdminLayout.vue]"]
  node_login["Sign in<br/>[index.vue]"]
  node_operations_ui["Operations pages<br/>[index.vue]"]
  node_inspection_ui["Inspection pages<br/>[index.vue]"]
  node_hazard_ui["Hazard pages<br/>[index.vue]"]
  node_equipment_ui["Equipment pages<br/>[index.vue]"]
  node_api_clients["API clients"]
end

subgraph group_access["Access control"]
  node_auth_controller["Authentication API"]
  node_token_service["Token service<br/>[TokenService.java]"]
  node_user_service["User management"]
end

subgraph group_operations["Operations"]
  node_domain_controllers["Domain APIs"]
  node_inspection_service["Inspection service"]
  node_hazard_service["Hazard service<br/>[HazardService.java]"]
end

subgraph group_insight["Monitoring and insight"]
  node_monitor_ui["Monitor pages<br/>[index.vue]"]
  node_warning_ui["Warning pages<br/>[index.vue]"]
  node_dashboard_ui["Dashboard<br/>[index.vue]"]
  node_report_ui["AI reports<br/>[index.vue]"]
  node_monitor_service["Monitoring service"]
  node_warning_service["Warning service"]
  node_statistics_service["Statistics service"]
  node_ai_service["AI report service<br/>[AiService.java]"]
end

subgraph group_backend["Backend foundation"]
  node_mysql[("MySQL database")]
end

node_staff(("Staff user"))
node_ai_provider{{"AI provider"}}

node_staff -->|"uses"| node_app
node_app -->|"installs"| node_router
node_router -->|"routes"| node_login
node_router -->|"routes"| node_layout
node_layout -->|"presents"| node_operations_ui
node_layout -->|"presents"| node_inspection_ui
node_layout -->|"presents"| node_hazard_ui
node_layout -->|"presents"| node_equipment_ui
node_layout -->|"presents"| node_monitor_ui
node_layout -->|"presents"| node_warning_ui
node_layout -->|"presents"| node_dashboard_ui
node_layout -->|"presents"| node_report_ui
node_login -->|"requests"| node_api_clients
node_operations_ui -->|"requests"| node_api_clients
node_inspection_ui -->|"requests"| node_api_clients
node_hazard_ui -->|"requests"| node_api_clients
node_equipment_ui -->|"requests"| node_api_clients
node_monitor_ui -->|"requests"| node_api_clients
node_warning_ui -->|"requests"| node_api_clients
node_dashboard_ui -->|"requests"| node_api_clients
node_report_ui -->|"requests"| node_api_clients
node_api_clients -->|"HTTP requests"| node_auth_controller
node_api_clients -->|"HTTP requests"| node_domain_controllers
node_auth_controller -->|"delegates"| node_user_service
node_user_service -->|"creates tokens"| node_token_service
node_domain_controllers -->|"delegates"| node_inspection_service
node_domain_controllers -->|"delegates"| node_hazard_service
node_domain_controllers -->|"delegates"| node_monitor_service
node_domain_controllers -->|"delegates"| node_warning_service
node_domain_controllers -->|"delegates"| node_statistics_service
node_domain_controllers -->|"delegates"| node_ai_service
node_monitor_service -->|"recomputes warnings"| node_warning_service
node_user_service -->|"reads and writes"| node_mysql
node_inspection_service -->|"reads and writes"| node_mysql
node_hazard_service -->|"reads and writes"| node_mysql
node_monitor_service -->|"reads and writes"| node_mysql
node_warning_service -->|"reads and writes"| node_mysql
node_statistics_service -->|"queries data"| node_mysql
node_ai_service -.->|"generates reports"| node_ai_provider

click node_app "https://github.com/doom1817/roms/blob/main/frontend/src/main.js"
click node_router "https://github.com/doom1817/roms/blob/main/frontend/src/router/index.js"
click node_layout "https://github.com/doom1817/roms/blob/main/frontend/src/layout/AdminLayout.vue"
click node_login "https://github.com/doom1817/roms/blob/main/frontend/src/views/login/index.vue"
click node_operations_ui "https://github.com/doom1817/roms/blob/main/frontend/src/views/reservoir/index.vue"
click node_inspection_ui "https://github.com/doom1817/roms/blob/main/frontend/src/views/inspection/index.vue"
click node_hazard_ui "https://github.com/doom1817/roms/blob/main/frontend/src/views/hazard/index.vue"
click node_equipment_ui "https://github.com/doom1817/roms/blob/main/frontend/src/views/equipment/index.vue"
click node_monitor_ui "https://github.com/doom1817/roms/blob/main/frontend/src/views/monitor/index.vue"
click node_warning_ui "https://github.com/doom1817/roms/blob/main/frontend/src/views/warning/index.vue"
click node_dashboard_ui "https://github.com/doom1817/roms/blob/main/frontend/src/views/dashboard/index.vue"
click node_report_ui "https://github.com/doom1817/roms/blob/main/frontend/src/views/ai-report/index.vue"
click node_api_clients "https://github.com/doom1817/roms/tree/main/frontend/src/api"
click node_auth_controller "https://github.com/doom1817/roms/blob/main/src/main/java/com/reservoir/management/controller/AuthController.java"
click node_token_service "https://github.com/doom1817/roms/blob/main/src/main/java/com/reservoir/management/service/TokenService.java"
click node_user_service "https://github.com/doom1817/roms/blob/main/src/main/java/com/reservoir/management/service/impl/UserServiceImpl.java"
click node_domain_controllers "https://github.com/doom1817/roms/tree/main/src/main/java/com/reservoir/management/controller"
click node_inspection_service "https://github.com/doom1817/roms/blob/main/src/main/java/com/reservoir/management/service/InspectionService.java"
click node_hazard_service "https://github.com/doom1817/roms/blob/main/src/main/java/com/reservoir/management/service/HazardService.java"
click node_monitor_service "https://github.com/doom1817/roms/blob/main/src/main/java/com/reservoir/management/service/MonitorDataService.java"
click node_warning_service "https://github.com/doom1817/roms/blob/main/src/main/java/com/reservoir/management/service/WarningService.java"
click node_statistics_service "https://github.com/doom1817/roms/blob/main/src/main/java/com/reservoir/management/service/StatisticsService.java"
click node_ai_service "https://github.com/doom1817/roms/blob/main/src/main/java/com/reservoir/management/service/AiService.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_app,node_router,node_layout,node_login,node_operations_ui,node_inspection_ui,node_hazard_ui,node_equipment_ui,node_api_clients,node_staff toneBlue
class node_auth_controller,node_token_service,node_user_service toneAmber
class node_domain_controllers,node_inspection_service,node_hazard_service toneMint
class node_monitor_ui,node_warning_ui,node_dashboard_ui,node_report_ui,node_monitor_service,node_warning_service,node_statistics_service,node_ai_service toneRose
class node_mysql,node_ai_provider toneIndigo
```

## Components

### Web interface

- [Vue application](https://github.com/doom1817/roms/blob/main/frontend/src/main.js): `frontend/src/main.js`
- [Page router](https://github.com/doom1817/roms/blob/main/frontend/src/router/index.js): `frontend/src/router/index.js`
- [Admin layout](https://github.com/doom1817/roms/blob/main/frontend/src/layout/AdminLayout.vue): `frontend/src/layout/AdminLayout.vue`
- [Sign in](https://github.com/doom1817/roms/blob/main/frontend/src/views/login/index.vue): `frontend/src/views/login/index.vue`
- [Operations pages](https://github.com/doom1817/roms/blob/main/frontend/src/views/reservoir/index.vue): `frontend/src/views/reservoir/index.vue`
- [Inspection pages](https://github.com/doom1817/roms/blob/main/frontend/src/views/inspection/index.vue): `frontend/src/views/inspection/index.vue`
- [Hazard pages](https://github.com/doom1817/roms/blob/main/frontend/src/views/hazard/index.vue): `frontend/src/views/hazard/index.vue`
- [Equipment pages](https://github.com/doom1817/roms/blob/main/frontend/src/views/equipment/index.vue): `frontend/src/views/equipment/index.vue`
- [API clients](https://github.com/doom1817/roms/tree/main/frontend/src/api): `frontend/src/api`

### Access control

- [Authentication API](https://github.com/doom1817/roms/blob/main/src/main/java/com/reservoir/management/controller/AuthController.java): `src/main/java/com/reservoir/management/controller/AuthController.java`
- [Token service](https://github.com/doom1817/roms/blob/main/src/main/java/com/reservoir/management/service/TokenService.java): `src/main/java/com/reservoir/management/service/TokenService.java`
- [User management](https://github.com/doom1817/roms/blob/main/src/main/java/com/reservoir/management/service/impl/UserServiceImpl.java): `src/main/java/com/reservoir/management/service/impl/UserServiceImpl.java`

### Operations

- [Domain APIs](https://github.com/doom1817/roms/tree/main/src/main/java/com/reservoir/management/controller): `src/main/java/com/reservoir/management/controller`
- [Inspection service](https://github.com/doom1817/roms/blob/main/src/main/java/com/reservoir/management/service/InspectionService.java): `src/main/java/com/reservoir/management/service/InspectionService.java`
- [Hazard service](https://github.com/doom1817/roms/blob/main/src/main/java/com/reservoir/management/service/HazardService.java): `src/main/java/com/reservoir/management/service/HazardService.java`

### Monitoring and insight

- [Monitor pages](https://github.com/doom1817/roms/blob/main/frontend/src/views/monitor/index.vue): `frontend/src/views/monitor/index.vue`
- [Warning pages](https://github.com/doom1817/roms/blob/main/frontend/src/views/warning/index.vue): `frontend/src/views/warning/index.vue`
- [Dashboard](https://github.com/doom1817/roms/blob/main/frontend/src/views/dashboard/index.vue): `frontend/src/views/dashboard/index.vue`
- [AI reports](https://github.com/doom1817/roms/blob/main/frontend/src/views/ai-report/index.vue): `frontend/src/views/ai-report/index.vue`
- [Monitoring service](https://github.com/doom1817/roms/blob/main/src/main/java/com/reservoir/management/service/MonitorDataService.java): `src/main/java/com/reservoir/management/service/MonitorDataService.java`
- [Warning service](https://github.com/doom1817/roms/blob/main/src/main/java/com/reservoir/management/service/WarningService.java): `src/main/java/com/reservoir/management/service/WarningService.java`
- [Statistics service](https://github.com/doom1817/roms/blob/main/src/main/java/com/reservoir/management/service/StatisticsService.java): `src/main/java/com/reservoir/management/service/StatisticsService.java`
- [AI report service](https://github.com/doom1817/roms/blob/main/src/main/java/com/reservoir/management/service/AiService.java): `src/main/java/com/reservoir/management/service/AiService.java`

### Backend foundation

- **MySQL database**

### Other components

- **Staff user**
- **AI provider**

## Connections

- Staff user → Vue application: uses
- Vue application → Page router: installs
- Page router → Sign in: routes
- Page router → Admin layout: routes
- Admin layout → Operations pages: presents
- Admin layout → Inspection pages: presents
- Admin layout → Hazard pages: presents
- Admin layout → Equipment pages: presents
- Admin layout → Monitor pages: presents
- Admin layout → Warning pages: presents
- Admin layout → Dashboard: presents
- Admin layout → AI reports: presents
- Sign in → API clients: requests
- Operations pages → API clients: requests
- Inspection pages → API clients: requests
- Hazard pages → API clients: requests
- Equipment pages → API clients: requests
- Monitor pages → API clients: requests
- Warning pages → API clients: requests
- Dashboard → API clients: requests
- AI reports → API clients: requests
- API clients → Authentication API: HTTP requests
- API clients → Domain APIs: HTTP requests
- Authentication API → User management: delegates
- User management → Token service: creates tokens
- Domain APIs → Inspection service: delegates
- Domain APIs → Hazard service: delegates
- Domain APIs → Monitoring service: delegates
- Domain APIs → Warning service: delegates
- Domain APIs → Statistics service: delegates
- Domain APIs → AI report service: delegates
- Monitoring service → Warning service: recomputes warnings
- User management → MySQL database: reads and writes
- Inspection service → MySQL database: reads and writes
- Hazard service → MySQL database: reads and writes
- Monitoring service → MySQL database: reads and writes
- Warning service → MySQL database: reads and writes
- Statistics service → MySQL database: queries data
- AI report service → AI provider: generates reports
