# ishekaa12/predictive-maintenance-project architecture

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

- Interactive diagram: https://gitdiagram.com/ishekaa12/predictive-maintenance-project
- Repository: https://github.com/ishekaa12/predictive-maintenance-project

## Overview

This is a multi-machine predictive-maintenance dashboard: users enter CNC, aircraft-engine, or turbine sensor values, submit a prediction, and see risk or remaining-life guidance. A separate chat feature answers machine and model questions and keeps an in-memory conversation history. Offline training selects models from cleaned datasets and saves artifacts consumed by the Flask API. The README also documents health and history operations. Source excerpts support the API, training and browser request paths; preprocessing internals and the rendered page wiring are not sampled, so those connections are omitted.

Main entry points: [`src/train.py`](https://github.com/ishekaa12/predictive-maintenance-project/blob/main/src/train.py) (Model training), [`deployment/app.py`](https://github.com/ishekaa12/predictive-maintenance-project/blob/main/deployment/app.py) (Flask routes), [`deployment/static/script.js`](https://github.com/ishekaa12/predictive-maintenance-project/blob/main/deployment/static/script.js) (Dashboard interactions), [`deployment/templates/index.html`](https://github.com/ishekaa12/predictive-maintenance-project/blob/main/deployment/templates/index.html) (Dashboard UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Web dashboard"]
  node_frontend["Dashboard UI<br/>[index.html]"]
  node_browser["Dashboard interactions<br/>[script.js]"]
end

subgraph group_api["Prediction API"]
  node_flask["Flask routes<br/>[app.py]"]
  node_cnc["CNC prediction<br/>[app.py]"]
  node_engine["Engine prediction<br/>[app.py]"]
  node_turbine["Turbine prediction<br/>[app.py]"]
  node_health["Health endpoint<br/>[app.py]"]
end

subgraph group_models["Model training"]
  node_cncmodel["CNC classifier<br/>[cnc_model.pkl]"]
  node_enginemodel["Engine classifier<br/>[engine_model.pkl]"]
  node_rulmodel["Engine RUL regressor"]
  node_windmodel["Wind classifier<br/>[wind_model.pkl]"]
  node_training["Model training<br/>[train.py]"]
  node_cleaned[("Cleaned datasets")]
end

subgraph group_assistant["Maintenance assistant"]
  node_chat["Chat answers<br/>[app.py]"]
  node_history[("Conversation history<br/>[app.py]")]
end

node_user(("Operator"))

node_user -.->|"uses"| node_frontend
node_frontend -.->|"interacts"| node_browser
node_browser -->|"submits requests"| node_flask
node_flask -->|"routes prediction"| node_cnc
node_flask -->|"routes prediction"| node_engine
node_flask -->|"routes prediction"| node_turbine
node_flask -->|"serves status"| node_health
node_cnc -->|"predicts with"| node_cncmodel
node_engine -.->|"predicts with"| node_enginemodel
node_engine -.->|"estimates RUL"| node_rulmodel
node_turbine -->|"predicts with"| node_windmodel
node_training -->|"reads"| node_cleaned
node_training -->|"saves model"| node_cncmodel
node_training -->|"saves model"| node_enginemodel
node_training -->|"saves model"| node_rulmodel
node_training -->|"saves model"| node_windmodel
node_browser -->|"asks"| node_chat
node_chat -->|"updates"| node_history
node_browser -->|"displays response history"| node_history

click node_frontend "https://github.com/ishekaa12/predictive-maintenance-project/blob/main/deployment/templates/index.html"
click node_browser "https://github.com/ishekaa12/predictive-maintenance-project/blob/main/deployment/static/script.js"
click node_flask "https://github.com/ishekaa12/predictive-maintenance-project/blob/main/deployment/app.py"
click node_cnc "https://github.com/ishekaa12/predictive-maintenance-project/blob/main/deployment/app.py"
click node_engine "https://github.com/ishekaa12/predictive-maintenance-project/blob/main/deployment/app.py"
click node_turbine "https://github.com/ishekaa12/predictive-maintenance-project/blob/main/deployment/app.py"
click node_health "https://github.com/ishekaa12/predictive-maintenance-project/blob/main/deployment/app.py"
click node_cncmodel "https://github.com/ishekaa12/predictive-maintenance-project/blob/main/models/cnc_model.pkl"
click node_enginemodel "https://github.com/ishekaa12/predictive-maintenance-project/blob/main/models/engine_model.pkl"
click node_rulmodel "https://github.com/ishekaa12/predictive-maintenance-project/blob/main/models/engine_rul_model.pkl"
click node_windmodel "https://github.com/ishekaa12/predictive-maintenance-project/blob/main/models/wind_model.pkl"
click node_training "https://github.com/ishekaa12/predictive-maintenance-project/blob/main/src/train.py"
click node_cleaned "https://github.com/ishekaa12/predictive-maintenance-project/tree/main/data/processed"
click node_chat "https://github.com/ishekaa12/predictive-maintenance-project/blob/main/deployment/app.py"
click node_history "https://github.com/ishekaa12/predictive-maintenance-project/blob/main/deployment/app.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_frontend,node_browser toneBlue
class node_flask,node_cnc,node_engine,node_turbine,node_health toneAmber
class node_cncmodel,node_enginemodel,node_rulmodel,node_windmodel,node_training,node_cleaned toneMint
class node_chat,node_history toneRose
class node_user toneIndigo
```

## Components

### Web dashboard

- [Dashboard UI](https://github.com/ishekaa12/predictive-maintenance-project/blob/main/deployment/templates/index.html): `deployment/templates/index.html`
- [Dashboard interactions](https://github.com/ishekaa12/predictive-maintenance-project/blob/main/deployment/static/script.js): `deployment/static/script.js`

### Prediction API

- [Flask routes](https://github.com/ishekaa12/predictive-maintenance-project/blob/main/deployment/app.py): `deployment/app.py`
- [CNC prediction](https://github.com/ishekaa12/predictive-maintenance-project/blob/main/deployment/app.py): `deployment/app.py`
- [Engine prediction](https://github.com/ishekaa12/predictive-maintenance-project/blob/main/deployment/app.py): `deployment/app.py`
- [Turbine prediction](https://github.com/ishekaa12/predictive-maintenance-project/blob/main/deployment/app.py): `deployment/app.py`
- [Health endpoint](https://github.com/ishekaa12/predictive-maintenance-project/blob/main/deployment/app.py): `deployment/app.py`

### Model training

- [CNC classifier](https://github.com/ishekaa12/predictive-maintenance-project/blob/main/models/cnc_model.pkl): `models/cnc_model.pkl`
- [Engine classifier](https://github.com/ishekaa12/predictive-maintenance-project/blob/main/models/engine_model.pkl): `models/engine_model.pkl`
- [Engine RUL regressor](https://github.com/ishekaa12/predictive-maintenance-project/blob/main/models/engine_rul_model.pkl): `models/engine_rul_model.pkl`
- [Wind classifier](https://github.com/ishekaa12/predictive-maintenance-project/blob/main/models/wind_model.pkl): `models/wind_model.pkl`
- [Model training](https://github.com/ishekaa12/predictive-maintenance-project/blob/main/src/train.py): `src/train.py`
- [Cleaned datasets](https://github.com/ishekaa12/predictive-maintenance-project/tree/main/data/processed): `data/processed`

### Maintenance assistant

- [Chat answers](https://github.com/ishekaa12/predictive-maintenance-project/blob/main/deployment/app.py): `deployment/app.py`
- [Conversation history](https://github.com/ishekaa12/predictive-maintenance-project/blob/main/deployment/app.py): `deployment/app.py`

### Other components

- **Operator**

## Connections

- Operator → Dashboard UI: uses (evidence: `README.md`)
- Dashboard UI → Dashboard interactions: interacts (evidence: `README.md`)
- Dashboard interactions → Flask routes: submits requests (evidence: `deployment/static/script.js`)
- Flask routes → CNC prediction: routes prediction (evidence: `deployment/app.py`)
- Flask routes → Engine prediction: routes prediction (evidence: `deployment/app.py`)
- Flask routes → Turbine prediction: routes prediction (evidence: `deployment/app.py`)
- Flask routes → Health endpoint: serves status (evidence: `deployment/app.py`)
- CNC prediction → CNC classifier: predicts with (evidence: `deployment/app.py`)
- Engine prediction → Engine classifier: predicts with
- Engine prediction → Engine RUL regressor: estimates RUL
- Turbine prediction → Wind classifier: predicts with (evidence: `deployment/app.py`)
- Model training → Cleaned datasets: reads (evidence: `src/train.py`)
- Model training → CNC classifier: saves model (evidence: `src/train.py`)
- Model training → Engine classifier: saves model (evidence: `src/train.py`)
- Model training → Engine RUL regressor: saves model (evidence: `src/train.py`)
- Model training → Wind classifier: saves model (evidence: `src/train.py`)
- Dashboard interactions → Chat answers: asks (evidence: `deployment/static/script.js`)
- Chat answers → Conversation history: updates (evidence: `deployment/app.py`)
- Dashboard interactions → Conversation history: displays response history (evidence: `deployment/static/script.js`)
