Project 03
Atlas
A supply chain planning system that forecasts demand per product, projects stockout dates and suggests what to buy.
- Status
- In production
- Role
- Sole developer: data pipeline, forecasting and inventory logic, API and interface.
- Source
- Private codebase
- ERP (Firebird)
- Batch import
- Forecast and stock models
- PostgreSQL
- Planning UI
Problem
Purchasing decisions depended on reports that ran directly against the ERP database. They were slow, hard to compare over time and said nothing about how reliable each number was. Each product needed three answers: how much will sell, when stock will run out and how much to order.
Solution
A separate system that copies ERP data in scheduled batches into its own PostgreSQL database, computes forecasts and stock projections, and serves precomputed results to a Vue interface, so no screen queries the ERP. The forecasting engine was ported from an earlier ERP module and extended with backtest-based model selection, stockout correction and accuracy tracking.
Engineering highlights
- Daily demand series with stockout correction: days without stock are re-estimated from in-stock days of the same weekday and left out when models are scored.
- Seven candidate models per product: weighted moving averages over 7, 28 and 90 days, Holt with a damped trend, day-of-week seasonal variants, and Croston (SBA) for intermittent demand.
- Model selection by rolling-origin backtest, ranked by WMAPE. MASE against a same-weekday naive forecast flags products where no model beats the simple baseline.
- Safety stock that accounts for both demand and lead-time variability, a reorder point, and order-up-to purchase suggestions ranked by how close each product is to a stockout.
- Versioned forecast snapshots, so the forecast vs. actual chart shows what was really predicted at the time instead of a recomputed past.
- Screens answer in 10 to 40 ms from precomputed tables. The equivalent ERP screen took about 1.5 seconds.