# horaceyang2019/project-sprayline architecture

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

- Interactive diagram: https://gitdiagram.com/horaceyang2019/project-sprayline
- Repository: https://github.com/horaceyang2019/project-sprayline

## Overview

Project-SprayLine combines production spraying-line data, time-series services, monitoring, recommendations, prediction, and operator interfaces. The principal workflow is sensor and batch data retrieval, time-window selection and state evaluation, followed by alerts or troubleshooting guidance and past/current/future views. The README also describes five ontology stages from sensing through adaptation. The graph emphasizes the SprayLine_3 service generation; repeated dated copies in the tree indicate parallel or historical versions. Unsampled UI and ontology internals are represented cautiously, with documented capabilities distinguished from verified calls.

Main entry points: [`SprayLine_3/webservices/time_series_api/src/service_orchestration_adapter.py`](https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/webservices/time_series_api/src/service_orchestration_adapter.py) (Time orchestration), [`SprayLine_3/webservices/integration_adapter/database_versionb_adapter.py`](https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/webservices/integration_adapter/database_versionb_adapter.py) (Database adapter), [`SprayLine_3/webservices/api_server.py`](https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/webservices/api_server.py) (Service API), [`SprayLine_3/scripts/knowledge_ttl_from_threshold_csv.py`](https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/scripts/knowledge_ttl_from_threshold_csv.py) (SprayLine ontology)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_knowledge["Knowledge and ontology"]
  node_ontology["SprayLine ontology"]
  node_ttlbuild["TTL generation"]
  node_inference["Runtime inference<br/>[infer_sprayline.py]"]
end

subgraph group_runtime["Runtime services"]
  node_api["Service API<br/>[api_server.py]"]
  node_orchestrator["Time orchestration"]
  node_integrated["Integrated service"]
  node_future["Future prediction<br/>[future_service.py]"]
  node_monitor["Monitoring worker"]
  node_troubleshoot["Troubleshooting"]
end

subgraph group_persistence["Data and persistence"]
  node_dbadapter["Database adapter"]
  node_database[("Version B database<br/>[db_connection.py]")]
end

subgraph group_interfaces["User interfaces"]
  node_engineerui["Engineer dashboard<br/>[main.py]"]
  node_managerui["Manager dashboard<br/>[server.py]"]
end

subgraph group_workflow["Engineer workflow"]
  node_taskapi["Task workflow API"]
  node_taskstore[("Task workflow store")]
end

node_engineer(("Plant engineer"))
node_manager(("Manager"))
node_sensors(("Line sensors"))

node_sensors -.->|"supply readings"| node_database
node_ontology -.->|"inform rules"| node_inference
node_ttlbuild -->|"generate TTL"| node_ontology
node_engineer -.->|"request data"| node_api
node_api -.->|"dispatch requests"| node_orchestrator
node_orchestrator -->|"invoke service"| node_integrated
node_orchestrator -->|"invoke prediction"| node_future
node_orchestrator -->|"invoke monitoring"| node_monitor
node_orchestrator -->|"invoke guidance"| node_troubleshoot
node_integrated -.->|"query time series"| node_dbadapter
node_monitor -->|"read and write"| node_dbadapter
node_future -->|"save predictions"| node_dbadapter
node_dbadapter -->|"resolve database functions"| node_database
node_engineer -.->|"review trends"| node_engineerui
node_manager -.->|"review status"| node_managerui
node_engineerui -.->|"request service data"| node_api
node_managerui -.->|"manage assignments"| node_taskapi
node_taskapi -.->|"persist workflow"| node_taskstore

click node_ontology "https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/scripts/knowledge_ttl_from_threshold_csv.py"
click node_ttlbuild "https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/scripts/json_to_sprayline_ttl.py"
click node_inference "https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/scripts/infer_sprayline.py"
click node_api "https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/webservices/api_server.py"
click node_orchestrator "https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/webservices/time_series_api/src/service_orchestration_adapter.py"
click node_integrated "https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/webservices/integrated_service/sprayline_integrated_service.py"
click node_future "https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/webservices/future_service/future_service.py"
click node_monitor "https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/webservices/monitoring_worker/monitoring_worker.py"
click node_troubleshoot "https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/%E5%B0%91%E6%A6%860617_B%E7%89%88/webservices/troubleshooting_service/troubleshooting_service.py"
click node_dbadapter "https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/webservices/integration_adapter/database_versionb_adapter.py"
click node_database "https://github.com/horaceyang2019/project-sprayline/blob/main/Database/versionB/db_connection.py"
click node_engineerui "https://github.com/horaceyang2019/project-sprayline/blob/main/0630/sprayline/ui/engineer/main.py"
click node_managerui "https://github.com/horaceyang2019/project-sprayline/blob/main/0630/sprayline/ui/manager/server.py"
click node_taskapi "https://github.com/horaceyang2019/project-sprayline/blob/main/final_version_1112/api/engineer_task_workflow_service.py"
click node_taskstore "https://github.com/horaceyang2019/project-sprayline/blob/main/final_version_1112/database/db_engineer_task_workflow.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_ontology,node_ttlbuild,node_inference toneBlue
class node_api,node_orchestrator,node_integrated,node_future,node_monitor,node_troubleshoot toneAmber
class node_dbadapter,node_database toneMint
class node_engineerui,node_managerui toneRose
class node_taskapi,node_taskstore,node_engineer,node_manager,node_sensors toneIndigo
```

## Components

### Knowledge and ontology

- [SprayLine ontology](https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/scripts/knowledge_ttl_from_threshold_csv.py): `SprayLine_3/scripts/knowledge_ttl_from_threshold_csv.py`
- [TTL generation](https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/scripts/json_to_sprayline_ttl.py): `SprayLine_3/scripts/json_to_sprayline_ttl.py`
- [Runtime inference](https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/scripts/infer_sprayline.py): `SprayLine_3/scripts/infer_sprayline.py`

### Runtime services

- [Service API](https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/webservices/api_server.py): `SprayLine_3/webservices/api_server.py`
- [Time orchestration](https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/webservices/time_series_api/src/service_orchestration_adapter.py): `SprayLine_3/webservices/time_series_api/src/service_orchestration_adapter.py`
- [Integrated service](https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/webservices/integrated_service/sprayline_integrated_service.py): `SprayLine_3/webservices/integrated_service/sprayline_integrated_service.py`
- [Future prediction](https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/webservices/future_service/future_service.py): `SprayLine_3/webservices/future_service/future_service.py`
- [Monitoring worker](https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/webservices/monitoring_worker/monitoring_worker.py): `SprayLine_3/webservices/monitoring_worker/monitoring_worker.py`
- [Troubleshooting](https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/%E5%B0%91%E6%A6%860617_B%E7%89%88/webservices/troubleshooting_service/troubleshooting_service.py): `SprayLine_3/少榆0617_B版/webservices/troubleshooting_service/troubleshooting_service.py`

### Data and persistence

- [Database adapter](https://github.com/horaceyang2019/project-sprayline/blob/main/SprayLine_3/webservices/integration_adapter/database_versionb_adapter.py): `SprayLine_3/webservices/integration_adapter/database_versionb_adapter.py`
- [Version B database](https://github.com/horaceyang2019/project-sprayline/blob/main/Database/versionB/db_connection.py): `Database/versionB/db_connection.py`

### User interfaces

- [Engineer dashboard](https://github.com/horaceyang2019/project-sprayline/blob/main/0630/sprayline/ui/engineer/main.py): `0630/sprayline/ui/engineer/main.py`
- [Manager dashboard](https://github.com/horaceyang2019/project-sprayline/blob/main/0630/sprayline/ui/manager/server.py): `0630/sprayline/ui/manager/server.py`

### Engineer workflow

- [Task workflow API](https://github.com/horaceyang2019/project-sprayline/blob/main/final_version_1112/api/engineer_task_workflow_service.py): `final_version_1112/api/engineer_task_workflow_service.py`
- [Task workflow store](https://github.com/horaceyang2019/project-sprayline/blob/main/final_version_1112/database/db_engineer_task_workflow.py): `final_version_1112/database/db_engineer_task_workflow.py`

### Other components

- **Plant engineer**
- **Manager**
- **Line sensors**

## Connections

- Line sensors → Version B database: supply readings
- SprayLine ontology → Runtime inference: inform rules
- TTL generation → SprayLine ontology: generate TTL (evidence: `SprayLine_3/pipeline.py`)
- Plant engineer → Service API: request data
- Service API → Time orchestration: dispatch requests
- Time orchestration → Integrated service: invoke service (evidence: `SprayLine_3/webservices/time_series_api/src/service_orchestration_adapter.py`)
- Time orchestration → Future prediction: invoke prediction (evidence: `SprayLine_3/webservices/time_series_api/src/service_orchestration_adapter.py`)
- Time orchestration → Monitoring worker: invoke monitoring (evidence: `SprayLine_3/webservices/time_series_api/src/service_orchestration_adapter.py`)
- Time orchestration → Troubleshooting: invoke guidance (evidence: `SprayLine_3/webservices/time_series_api/src/service_orchestration_adapter.py`)
- Integrated service → Database adapter: query time series (evidence: `SprayLine_3/webservices/integrated_service/sprayline_integrated_service.py`)
- Monitoring worker → Database adapter: read and write (evidence: `SprayLine_3/webservices/monitoring_worker/monitoring_worker.py`)
- Future prediction → Database adapter: save predictions (evidence: `SprayLine_3/webservices/future_service/future_service.py`)
- Database adapter → Version B database: resolve database functions (evidence: `SprayLine_3/webservices/integration_adapter/database_versionb_adapter.py`)
- Plant engineer → Engineer dashboard: review trends
- Manager → Manager dashboard: review status
- Engineer dashboard → Service API: request service data
- Manager dashboard → Task workflow API: manage assignments
- Task workflow API → Task workflow store: persist workflow (evidence: `final_version_1112/api/engineer_task_workflow_service.py`)
