An interactive web application and AI-powered decision support system designed to simulate and optimize supply chains and working capital runways for functional beverage & superfood brands in India.
This tool models the real-world complexities of D2C logistics—such as perishability, batch expiration, supplier lead times, quick-commerce stockout penalties, and marketing-driven demand—allowing founders to run stress-test scenarios and obtain actionable strategic recommendations.
- Zero Data Retention: This application does not use databases, local storage, or persistent logs.
- In-Memory Execution: All custom CSV datasets uploaded by users are parsed and held strictly in temporary Streamlit session memory.
- Absolute Data Isolation: Data never overlaps between concurrent users, and all parameters vanish completely upon page refresh.
- No Login Required: Instant operations without authentication credentials.
Runs a step-by-step 90-day simulation of startup operations:
- Perishable Ingredient Tracking: Uses First-In-First-Out (FIFO) consumption logic. Tracks individual raw material batches (e.g., Organic Whey, Fruit Pulp, Stevia) with distinct expiration dates, writing off expired items as inventory spoilage loss.
- Lead-Time & Reorder Point (ROP): Automatically triggers procurement orders when inventory positions (stock on hand + in transit) fall below safety levels.
- Financial Ledger: Tracks daily cash balances, marketing spend, COGS, logistics shipping costs, fixed monthly overheads, and distributor margins.
Simulates common supply chain and marketing events that standard linear models miss:
- Edge Case A (The Viral Spike): A sudden 4x surge in customer demand (Days 15–21) triggered by an influencer campaign or quick-commerce (e.g., Blinkit, Zepto) algorithm push, risking immediate raw material depletion.
- Edge Case B (Monsoon / Logistics Delay): A 15-day transit delay in packaging shipments (Days 30–45) due to monsoon flooding. Halts production, causing perishable ingredients to spoil on-shelf.
- Edge Case C (Inflationary Cost Shock): A sudden 25% price surge in key protein/whey ingredients starting on Day 45, squeezing gross margins and accelerating cash burn.
Uses Monte Carlo simulations (100 trials) to model daily demand volatility and delayed replenishment runs, generating:
- Runway Percentiles: Plots Worst Case (10th percentile), Expected Case (50th percentile), and Best Case (90th percentile) working capital paths.
- Risk Analytics: Calculates the probability of insolvency (cash dropping below zero) within 90 days, average stockout rates, and average financial spoilage losses.
- Heuristic Analysis: Evaluates simulation outputs (ending cash, margin trends, stockout bottlenecks, spoilage losses) and renders tailored tactical action cards.
- Dynamic LLM Audit: Allows users to input an optional Google Gemini API Key. Sends structured simulation metrics to Gemini using the
google-genaiSDK to generate a detailed, customized supply chain audit and executive playbook.
- Python 3.10 or higher installed.
- Clone or navigate to the project directory:
cd /Users/nayan/NHAI - Create and activate a Python virtual environment:
python3 -m venv venv source venv/bin/activate # On macOS/Linux
- Install the dependencies:
pip install -r requirements.txt
- Start the Streamlit application:
streamlit run app.py
- Open your browser and navigate to
http://localhost:8501.
Users can download the sample template directly from the sidebar. The CSV supports the following columns:
| Column | Category | Description / Values |
|---|---|---|
| Category | Raw Material | Packaging | Financial | Operational |
Categorization tag for parsing. |
| Item | Text Name | Item identifier (e.g., Organic Whey Protein, Starting Cash, ROAS). |
| CurrentStock | Number | Initial quantity in stock (Only required for materials). |
| CostPerUnit | Number | Unit price in INR (Only required for materials). |
| LeadTimeDays | Number | Delivery duration in days (Only required for materials). |
| ShelfLifeDays | Number | Perishability threshold. Use 9999 for non-perishable packaging items. |
| UnitsPerProduct | Number | Bill of Materials (BOM) multiplier required per beverage unit. |
| Value | Number | Constant parameters (Only required for Financial and Operational rows). |