# manidhar8008/lime-iot-ml-platform- architecture

> Architecture diagram of the GitHub repository manidhar8008/lime-iot-ml-platform-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/manidhar8008/lime-iot-ml-platform-
- Repository: https://github.com/manidhar8008/lime-iot-ml-platform-

## Overview

1. **Repository shape**
   This repo contains a **Streamlit-based fleet intelligence dashboard** with a clear “production” app under `app/` and a smaller legacy/top-level layout at the repository root. For an architecture diagram, treat `app/` as the primary runtime package and the root `app.py` / `src/` files as an older or compatibility path.

2. **Primary runtime entry point**
   The main production entry point is `app/main.py`, launched via Streamlit. The top-level `app.py` is also described as an entry point in the README, so the repo currently supports two launch styles. The actual deployed shape appears to center on the `app/` folder.

3. **Core data/decision pipeline**
   The heart of the system is a sequential pipeline in `app/core/`:
   - `data_loader.py` for reading CSV/demo fleet data
   - `preprocessing.py` for cleansing and normalization
   - `feature_engineering.py` for derived operational metrics
   - `decision_engine.py` for risk scoring and recommendation logic
   - `insights_engine.py` for turning scores into business-facing insights  
   This is a local, in-process analytics pipeline rather than a service-oriented backend.

4. **User interface boundary**
   The UI is a **single-page Streamlit dashboard**. It consumes the pipeline outputs and renders:
   - KPI cards
   - risk distribution views
   - recommendation lists
   - fleet tables and charts  
   Plotting is implied through the README’s use of interactive charts, but the repo structure shows no separate frontend app or API layer.

5. **Data flow**
   The main flow is:
   **demo or uploaded fleet data → loading → preprocessing → feature engineering → risk/decision scoring → insights generation → Streamlit visualization**.  
   The dashboard is business-oriented: it transforms vehicle-level telemetry into operational actions and revenue-impact estimates.

6. **Domain model / business logic**
   The README describes a **weighted risk model** based on battery health, utilization, zone pressure, and maintenance status. That suggests the “AI” layer is primarily **rules + scoring + prioritization**, not an external ML service. The system outputs urgency bands such as critical, warning, and opportunity.

7. **Configuration and logging**
   `app/utils/config.py` and `app/utils/logger.py` provide cross-cutting concerns for runtime settings and observability. These are the main shared utilities, keeping environment/config handling separate from the analytics logic and UI.

8. **Deployment and execution packaging**
   The app is packaged for local or containerized execution:
   - `app/Dockerfile` for container deployment
   - `app/.streamlit/config.toml` for Streamlit runtime configuration
   - `app/run.sh` and `app/run.bat` for platform-specific startup  
   This indicates the deployment boundary is still a single-process Streamlit app, not a multi-service backend.

9. **Testing and validation**
   `tests/test_production_dashboard.py` is the main system-level validation artifact. It appears intended to verify the end-to-end dashboard behavior rather than isolated unit behavior, which fits the repo’s “single app + pipeline” architecture.

10. **Artifacts and outputs**
    `artifacts/visuals` and `artifacts/README.md` suggest generated charts or demo outputs are stored separately from the application code. This is a supporting boundary for sample visuals, not a live runtime dependency.

11. **Legacy vs production duplication**
    There are duplicated modules at the root (`core/`, `utils/`, and `src/`) alongside the consolidated `app/core/` and `app/utils/`. For an architecture diagram, show this as a **migration/consolidation layer**: older code paths still exist, but the `app/` package is the cleaner production namespace.

12. **External dependencies**
    The repo is intentionally self-contained. The only materially important runtime dependencies are **Streamlit, Pandas, NumPy, and Plotly**, all used locally. There is no visible dependency on external APIs, message queues, databases, or cloud services.

13. **What not to diagram as separate systems**
    Do not model this as a microservice architecture. There is no evidence of a backend API, auth service, model server, or database tier. The cleanest diagram is a **single Streamlit application with a local analytics pipeline and supporting config/test/deployment assets**.

14. **Best architectural summary**
    The repository is a **local-first operational intelligence dashboard**: data enters through CSV/demo generation, is processed through a modular scoring pipeline, and is presented in a Streamlit UI with KPI, risk, and recommendation views. The main architectural boundary is between the **presentation layer (`app/main.py`)** and the **domain logic (`app/core/*`)**.

Main entry points: [`app/main.py`](https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/main.py) (Streamlit app), [`app/core/data_loader.py`](https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/core/data_loader.py) (Data loader), [`app/core/preprocessing.py`](https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/core/preprocessing.py) (Preprocess), [`app/core/feature_engineering.py`](https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/core/feature_engineering.py) (Feature engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g1["Production app"]
  node_n1["Streamlit app<br/>entrypoint<br/>[main.py]"]
  node_n2["Dashboard UI<br/>[main.py]"]
  node_n3["Data loader<br/>pipeline stage<br/>[data_loader.py]"]
  node_n4["Preprocess<br/>pipeline stage<br/>[preprocessing.py]"]
  node_n5["Feature engine<br/>pipeline stage"]
  node_n6["Decision engine<br/>scoring<br/>[decision_engine.py]"]
  node_n7["Insights engine<br/>[insights_engine.py]"]
  node_n8["Config<br/>[config.py]"]
  node_n9["Logger<br/>observability<br/>[logger.py]"]
end

subgraph group_g2["Legacy paths"]
  node_n10["Root app<br/>legacy entrypoint<br/>[app.py]"]
  node_n11["Legacy core<br/>legacy pipeline<br/>[data_loader.py]"]
  node_n12["Legacy utils<br/>legacy support<br/>[config.py]"]
  node_n13["Legacy source<br/>compatibility code<br/>[data_loader.py]"]
end

subgraph group_g3["Packaging"]
  node_n14["Dockerfile<br/>deployment"]
  node_n15["Streamlit config<br/>runtime config<br/>[config.toml]"]
  node_n16["Run scripts<br/>startup scripts<br/>[run.sh]"]
end

subgraph group_g4["Validation & outputs"]
  node_n17["System test<br/>validation"]
  node_n18["Artifacts<br/>outputs"]
end

node_n1 -->|"renders"| node_n2
node_n2 -->|"loads"| node_n3
node_n3 -->|"cleans"| node_n4
node_n4 -->|"transforms"| node_n5
node_n5 -->|"scores"| node_n6
node_n6 -->|"summarizes"| node_n7
node_n7 -->|"visualizes"| node_n2
node_n8 -.->|"supports"| node_n3
node_n9 -.->|"logs"| node_n1
node_n10 -.->|"alternate entry"| node_n1
node_n11 -.->|"duplicates"| node_n3
node_n12 -.->|"duplicates"| node_n8
node_n13 -.->|"legacy path"| node_n11
node_n14 -->|"packages"| node_n1
node_n15 -.->|"configures"| node_n1
node_n16 -->|"starts"| node_n1
node_n17 -.->|"validates"| node_n1
node_n18 -.->|"supplements"| node_n2

click node_n1 "https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/main.py"
click node_n2 "https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/main.py"
click node_n3 "https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/core/data_loader.py"
click node_n4 "https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/core/preprocessing.py"
click node_n5 "https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/core/feature_engineering.py"
click node_n6 "https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/core/decision_engine.py"
click node_n7 "https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/core/insights_engine.py"
click node_n8 "https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/utils/config.py"
click node_n9 "https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/utils/logger.py"
click node_n10 "https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app.py"
click node_n11 "https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/core/data_loader.py"
click node_n12 "https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/utils/config.py"
click node_n13 "https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/src/data_loader.py"
click node_n14 "https://github.com/manidhar8008/lime-iot-ml-platform-/tree/main/app/Dockerfile"
click node_n15 "https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/.streamlit/config.toml"
click node_n16 "https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/run.sh"
click node_n17 "https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/tests/test_production_dashboard.py"
click node_n18 "https://github.com/manidhar8008/lime-iot-ml-platform-/tree/main/artifacts/visuals"

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_n1,node_n2,node_n3,node_n4,node_n5,node_n6,node_n7,node_n8,node_n9 toneBlue
class node_n10,node_n11,node_n12,node_n13 toneAmber
class node_n14,node_n15,node_n16 toneMint
class node_n17,node_n18 toneRose
```

## Components

### Production app

Primary Streamlit runtime under app/.

- [Streamlit app](https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/main.py): entrypoint · Main dashboard entry launched with Streamlit. · `app/main.py`
- [Dashboard UI](https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/main.py): ui · Renders KPIs, charts, tables, and recommendations. · `app/main.py`
- [Data loader](https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/core/data_loader.py): pipeline stage · Reads CSV/demo fleet data into the runtime pipeline. · `app/core/data_loader.py`
- [Preprocess](https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/core/preprocessing.py): pipeline stage · Cleans and normalizes incoming fleet data. · `app/core/preprocessing.py`
- [Feature engine](https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/core/feature_engineering.py): pipeline stage · Derives operational metrics and model inputs. · `app/core/feature_engineering.py`
- [Decision engine](https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/core/decision_engine.py): scoring · Applies weighted risk scoring and recommendation logic. · `app/core/decision_engine.py`
- [Insights engine](https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/core/insights_engine.py): insights · Converts scores into business-facing insights and urgency bands. · `app/core/insights_engine.py`
- [Config](https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/utils/config.py): runtime config · Shared runtime settings and environment handling. · `app/utils/config.py`
- [Logger](https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/utils/logger.py): observability · Shared logging and runtime observability helpers. · `app/utils/logger.py`

### Legacy paths

Older root-level modules kept alongside the consolidated app package.

- [Root app](https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app.py): legacy entrypoint · Older top-level Streamlit entrypoint kept for compatibility. · `app.py`
- [Legacy core](https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/core/data_loader.py): legacy pipeline · Root-level duplicated pipeline modules from the earlier layout. · `core/data_loader.py`
- [Legacy utils](https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/utils/config.py): legacy support · Root-level duplicated config and logging helpers. · `utils/config.py`
- [Legacy source](https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/src/data_loader.py): compatibility code · Additional older source path retained during migration. · `src/data_loader.py`

### Packaging

Deployment, runtime config, and startup scripts.

- [Dockerfile](https://github.com/manidhar8008/lime-iot-ml-platform-/tree/main/app/Dockerfile): deployment · Container build for local or deployed Streamlit execution. · `app/Dockerfile`
- [Streamlit config](https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/.streamlit/config.toml): runtime config · Streamlit-specific configuration for the app runtime. · `app/.streamlit/config.toml`
- [Run scripts](https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/app/run.sh): startup scripts · Platform-specific launch scripts for the packaged app. · `app/run.sh`

### Validation & outputs

System-level tests and generated artifacts.

- [System test](https://github.com/manidhar8008/lime-iot-ml-platform-/blob/main/tests/test_production_dashboard.py): validation · End-to-end dashboard validation artifact. · `tests/test_production_dashboard.py`
- [Artifacts](https://github.com/manidhar8008/lime-iot-ml-platform-/tree/main/artifacts/visuals): outputs · Stored visuals and generated demo outputs. · `artifacts/visuals`

## Connections

- Streamlit app → Dashboard UI: renders · The entrypoint drives the dashboard UI.
- Dashboard UI → Data loader: loads · UI triggers the local data pipeline.
- Data loader → Preprocess: cleans · Loaded fleet data is normalized.
- Preprocess → Feature engine: transforms · Clean data is enriched with derived metrics.
- Feature engine → Decision engine: scores · Engineered features feed the risk model.
- Decision engine → Insights engine: summarizes · Scores become recommendations and insights.
- Insights engine → Dashboard UI: visualizes · Insights are rendered in the Streamlit dashboard.
- Config → Data loader: supports · Configuration influences pipeline runtime behavior.
- Logger → Streamlit app: logs · Logging supports the app runtime.
- Root app → Streamlit app: alternate entry · Legacy top-level app remains a supported launch path.
- Legacy core → Data loader: duplicates · Root-level core modules mirror the production pipeline.
- Legacy utils → Config: duplicates · Root-level utilities mirror production support code.
- Legacy source → Legacy core: legacy path · Older source tree remains part of the migration layer.
- Dockerfile → Streamlit app: packages · Container image packages the Streamlit app.
- Streamlit config → Streamlit app: configures · Streamlit runtime settings shape the app behavior.
- Run scripts → Streamlit app: starts · Shell and batch scripts launch the app locally.
- System test → Streamlit app: validates · System test checks end-to-end dashboard behavior.
- Artifacts → Dashboard UI: supplements · Generated visuals support the dashboard and documentation.
