How manidhar8008/lime-iot-ml-platform- works
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: main.py Streamlit app · data_loader.py Data loader · preprocessing.py Preprocess · feature_engineering.py Feature engine
Components 18
Production app
Primary Streamlit runtime under app/.
- Streamlit app · Main dashboard entry launched with Streamlit.
app/main.py - Dashboard UI · Renders KPIs, charts, tables, and recommendations.
app/main.py - Data loader · Reads CSV/demo fleet data into the runtime pipeline.
app/core/data_loader.py - Preprocess · Cleans and normalizes incoming fleet data.
app/core/preprocessing.py - Feature engine · Derives operational metrics and model inputs.
app/core/feature_engineering.py - Decision engine · Applies weighted risk scoring and recommendation logic.
app/core/decision_engine.py - Insights engine · Converts scores into business-facing insights and urgency bands.
app/core/insights_engine.py - Config · Shared runtime settings and environment handling.
app/utils/config.py - Logger · Shared logging and runtime observability helpers.
app/utils/logger.py
Legacy paths
Older root-level modules kept alongside the consolidated app package.
- Root app · Older top-level Streamlit entrypoint kept for compatibility.
app.py - Legacy core · Root-level duplicated pipeline modules from the earlier layout.
core/data_loader.py - Legacy utils · Root-level duplicated config and logging helpers.
utils/config.py - Legacy source · Additional older source path retained during migration.
src/data_loader.py
Packaging
Deployment, runtime config, and startup scripts.
- Dockerfile · Container build for local or deployed Streamlit execution.
app/Dockerfile - Streamlit config · Streamlit-specific configuration for the app runtime.
app/.streamlit/config.toml - Run scripts · Platform-specific launch scripts for the packaged app.
app/run.sh
Validation & outputs
System-level tests and generated artifacts.
- System test · End-to-end dashboard validation artifact.
tests/test_production_dashboard.py - Artifacts · Stored visuals and generated demo outputs.
artifacts/visuals
Connections 18
- 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.