A real-time, enterprise-grade supply chain risk monitoring platform β built entirely with open-source Python tools, deployed on the cloud, and protected with secure authentication.
π Live Demo Β β’Β π Repository
π₯ [https://youtu.be/rYTDYH3ZAt4]
The Global Supply Chain Risk Engine is a full-stack data intelligence platform that helps procurement teams, logistics managers, and risk analysts identify, monitor, and simulate supply chain disruptions β before they happen.
Unlike generic BI dashboards, this engine combines:
- Real-time news intelligence from 8 industry-specific RSS feeds
- Live weather risk scoring along shipping routes via Open-Meteo
- Dynamic risk modeling using financial, geopolitical, and delay factors
- What-if scenario simulation for disruption planning
- One-click PDF audit reports for executive stakeholders
- Secure SHA-256 login system β no plain-text passwords, ever
All of this runs on Streamlit Community Cloud β completely free to host.
A professional neon-themed login screen protects the entire application. Credentials are SHA-256 hashed with a cryptographic salt. No plain-text passwords stored anywhere in the codebase. Built for single-tenant or multi-client deployment.
The command center of the application. Upload any supplier CSV and instantly see:
- Average risk score across your entire supplier network
- Count of high-risk suppliers (score > 75)
- Statistical anomaly detection via Z-score analysis
- Risk score distribution histogram
- Top 10 highest-risk suppliers via live DuckDB SQL query
An interactive Plotly scatter-geo world map that plots every supplier by geographic coordinates, sized and colored by risk score. Instantly visualize where your supply chain is most exposed β from APAC manufacturing hubs to Middle East trade corridors.
Live news pulled from 8 industry-specific RSS sources β zero API keys required:
| Source | Coverage |
|---|---|
| Supply Chain Dive | Industry operations & disruptions |
| Logistics Management | Warehousing, freight, 3PL |
| FreightWaves | Freight markets & trucking |
| DC Velocity | Distribution & materials handling |
| JOC | Port & container shipping |
| Hellenic Shipping News | Global maritime intelligence |
| Reuters Trade | Global trade & commerce |
| Bloomberg Supply Chain | Financial & market risk |
Filter by source, search by keyword (tariff, port strike, logistics), and read full articles directly from the dashboard in expandable cards.
A three-part what-if analysis engine for proactive risk planning:
Region Disruption Simulator β Select any region and apply a disruption intensity multiplier (1xβ5x). See a live bar chart comparing baseline vs simulated risk scores across your entire supplier network.
Inventory Impact Calculator β Input current stock, daily demand, and lead time to compute days-of-cover and shortfall probability with a color-coded risk banner.
Lead Time Projector β Model the combined effect of port congestion index and active labor strikes on expected delivery timelines.
Powered by Open-Meteo β completely free, no API key, no credit card. Select any supplier from your dataset and get:
- Current temperature, wind speed, and precipitation probability
- Shipping risk classification: π’ LOW β π‘ MODERATE β π HIGH β π΄ SEVERE
- 24-hour wind speed forecast (line chart)
- 24-hour precipitation probability (color-coded bar chart)
One-click generation of a professional audit-ready PDF containing:
- Customizable executive summary
- Risk statistics (average, min, max scores across all suppliers)
- Critical supplier table (auto-filtered at risk score > 50)
- Auto-detects column names from any CSV schema β no manual mapping
Each supplier receives a composite risk score (0β100) from three weighted components:
Total Risk = (Geo Risk Γ 0.40) + (Delay Risk Γ 0.30) + (Financial Risk Γ 0.30)
| Component | Methodology | Weight |
|---|---|---|
| Geo Risk | Logistic growth curve over event density Γ regional sensitivity coefficient | 40% |
| Delay Risk | Lead time volatility model: avg delay days + historical variance | 30% |
| Financial Risk | Log-scaled revenue exposure + supplier health penalty (1 β rating) | 30% |
Scores normalize to 0β100 via Min-Max scaling and classify into tiers:
LOW (0β25) β MEDIUM (26β50) β HIGH (51β75) β CRITICAL (76β100)
ROOT/
βββ app.py β Main entry point + SHA-256 login gate
βββ theme.py β Neon/terminal CSS theme + Plotly dark layout
βββ requirements.txt
β
βββ engine/
β βββ ingest.py β CSV loader, schema auto-detection, GDELT
β βββ news_stream.py β RSS intelligence feed + Open-Meteo weather
β βββ risk_model.py β Geo, delay & financial risk scoring engine
β βββ scenario_sim.py β Disruption simulator, inventory & lead time calc
β
βββ database/
β βββ risk_queries.py β DuckDB in-memory SQL analytics layer
β
βββ components/
β βββ alerts.py β Z-score anomaly detection & alert banners
β βββ map_viz.py β Scatter-geo & choropleth map builders
β βββ views.py β Page-level UI components
β
βββ utils/
β βββ pdf_gen.py β FPDF2 professional report generator
β
βββ data/
βββ suppliers.csv β Sample dataset (50 global suppliers)
| Layer | Technology | Reason |
|---|---|---|
| UI & Hosting | Streamlit 1.31 | Rapid deployment, free cloud tier |
| Data Engine | Polars 0.20 | 10β100x faster than Pandas on large CSVs |
| Analytics | DuckDB 0.10 | In-memory SQL on DataFrames, zero setup |
| Visualization | Plotly 5.18 | Interactive geo maps, charts, hover tooltips |
| News Feed | RSS feeds (8 sources) | Free, reliable, no API key required |
| Weather | Open-Meteo API | 100% free, no registration needed |
| PDF Export | FPDF2 2.7 | Lightweight professional PDF generation |
| Security | SHA-256 + Salt | Industry-standard password hashing |
git clone https://github.com/Ali-datasmith/SupplyChain-Risk-Engine.git
cd SupplyChain-Risk-Enginepip install -r requirements.txtstreamlit run app.pyUsername : Ali-datasmith
Password : Contact the developer
The engine accepts any CSV format β column names are auto-detected and normalized at upload time:
| Column | Required | Accepted Aliases |
|---|---|---|
supplier |
β Yes | supplier_name, vendor, name, company |
risk_score |
β Yes | Risk_Score, risk, score, rating |
region |
β Recommended | Supplier_Region, country, area, zone |
lat |
πΊοΈ Map only | latitude, y |
lon |
πΊοΈ Map only | longitude, lng, x |
Extra columns (industry, lead_time_days, financial_score, reliability_score, inventory_value) are automatically used where applicable.
Procurement Teams β Identify which suppliers pose the highest risk before contract renewal. Prioritize audits based on data, not gut feeling.
Logistics Managers β Monitor live weather risk along shipping routes. Get early warnings before a typhoon or port strike disrupts your network.
Risk & Compliance Officers β Generate audit-ready PDF reports with one click. Present executive summaries to leadership without manual data preparation.
Investment Analysts β Model supply chain exposure for portfolio companies. Run what-if scenarios on geopolitical disruptions β Red Sea conflict, China tariffs, labor strikes.
Consulting Firms β White-label this platform for clients. Deploy a branded version within hours with custom supplier datasets.
The modular architecture makes the following extensions straightforward:
- Multi-tenant SaaS β Per-client login with isolated data views
- ERP Integration β Connect to SAP, Oracle, or NetSuite via REST API
- ML Risk Prediction β Train a gradient boosting model on historical disruptions
- Real-time Alerts β Email/Slack notifications when risk scores cross thresholds
- Supplier Benchmarking β Peer comparison within same region or industry
- Mobile Responsive UI β Progressive Web App for field use
Optimized for Streamlit Community Cloud (Free Tier):
- β In-memory only β no persistent database or file system needed
- β All modules have graceful fallbacks if imports fail on cold start
- β RAM usage stays under 1 GB for datasets up to 100,000 rows
- β No API keys required for any core feature
1. Push repository to GitHub
2. Go to share.streamlit.io
3. Connect repository β set app.py as entry point
4. Click Deploy β live in 60 seconds
streamlit==1.31.1
polars==0.20.10
duckdb==0.10.0
plotly==5.18.0
fpdf2==2.7.8
requests==2.31.0
numpy==1.26.4
pillow==10.2.0
Built by Ali-datasmith β a data engineer specializing in supply chain analytics, real-time intelligence dashboards, and Python-based risk platforms.
Open to:
- Freelance projects β Upwork / Direct contract
- Consulting engagements for logistics & procurement firms
- Full-time Data Engineering / Analytics Engineering roles
π§ rjptmhmmd@gmail.com π GitHub Profile
MIT License β free to use, modify, and distribute with attribution.
β‘ Built by Ali-datasmith
Polars Β· DuckDB Β· Streamlit Β· Plotly Β· Open-Meteo Β· FPDF2
"From raw supplier data to executive risk intelligence β in seconds."
