About
## The problem it solves
# FreshRoute - Smarter Distribution. Less Waste. Better Returns.
## The problem
India is the world's second-largest producer of fruits and vegetables, yet a Ministry of Food Processing Industries (MoFPI) study covering 54 commodities across 15 agro-climatic zones reports post-harvest losses of **7.3%-12.4%** in perishables. The root cause is not a lack of produce but **bad distribution timing**:
- **Blind FIFO dispatch** sends highly perishable lots on long routes where transit time exceeds remaining shelf life, so they arrive rotten.
- **Terminal congestion** breaches daily APMC mandi intake gates.
- **Produce spoils in transit or in cold storage** without timely markdown, turning inventory into write-offs.
## What FreshRoute does
FreshRoute is a deterministic, AI-assisted decision-support and supply-chain optimisation platform. It coordinates available inventory batches, real-time shelf life, destination demand, road transit times, market tariffs, and terminal intake capacity to maximise net economic revenue and eliminate avoidable food waste.
**Who uses it:** agricultural wholesale distributors, cold-chain operators, APMC mandi planners, and food-agri teams working the PS-03 problem statement.
**How it makes the job easier:**
1. **Shelf-Life Aware Prioritisation (FEFO)** - First-Expiring-First-Out dispatch, matching high-spoilage lots with high-margin, near-distance mandis. 2. **Capacity-Constrained Allocation** - hard guards prevent gate-intake overages and truck overloading. 3. **Feasibility Invariant** - every dispatch satisfies `remaining shelf life >= travel time + safety buffer`, so no lot is sent on a route it cannot survive. 4. **Dynamic Discount Recommendations** - rule-based markdowns for near-expiry lots to salvage margin before total write-off. 5. **Baseline Benchmarking** - side-by-side comparison against a naive FIFO strategy on identical inputs (spoilage reduction, fulfilment %, net revenue lift). 6. **Explainability** - plain-language justification for every recommended dispatch and rejection. 7. **Disruption Simulator** - stress-tests 6 operational shocks (monsoon road closures, heatwave, urban demand crash, cold-chain fleet crunch, diesel price spike). 8. **Enterprise PDF Audit Export** - vector regulatory report with KPI audit table, dispatch manifest and formal sign-offs.
**Benchmark result:** on 22,600 kg of stock across 6 APMC mandis, FEFO + guards cuts spoilage from 1,800 kg (8.0%) to 0 kg, lifts net revenue by **+Rs 219,620 (+20.9%)**, and raises fulfilment from 56.4% to 66.4% - in a 1.2 ms solve.
## Challenges we ran into
# Challenges we ran into
## 1. Making the baseline comparison genuinely fair Early on, the naive FIFO baseline looked artificially bad because it was not enforcing physical constraints while FEFO was - so the "+20.9% revenue" was inflated by an unfair comparison. We rewrote `backend/engine/baseline.py` so it enforces the *same* shelf-life, capacity and deadline guards as the optimizer, then re-ran the numbers. The optimisation win is now real and auditable rather than an artefact of a weak baseline.
## 2. Custom cursor leaking the OS pointer over native dropdowns We built a high-performance magnetic custom cursor, but `<select>` elements render at the OS layer, so the native arrow popped back over our animated cursor the instant a dropdown opened. We replaced every native select with an accessible `CustomSelect.tsx` component built from scratch, giving us one cursor, consistent theming and full keyboard support.
## 3. Tooltips clipped by overflow containers Dispatch cards sit inside scroll containers, so absolutely-positioned tooltips were being cut off at the card edge. We moved rendering into a React portal with auto-flipping logic (`Tooltip.tsx`) that repositions based on viewport bounds - no more clipped or off-screen tooltips.
## 4. Modelling spoilage after dispatch
Deciding what counts as "spoiled" was subtle: onion with 120 h of shelf life sitting in a warehouse is not spoilage. We split leftover inventory into genuinely at-risk stock (<= 24 h remaining -> spoilage write-off) versus healthy cold-storage retention, so the KPIs reflect agricultural reality instead of penalising high-shelf-life inventory.
## 5. Deterministic, reproducible judging Reviewers need identical results on demand. We seed PostgreSQL with a pristine MoFPI-grounded dataset on startup and expose a one-click reset endpoint, so every judging run starts from the exact same state.
Screenshots
Team
From the public Devfolio project page. Votes, swipes and the judge score are hackfeed's own.











