Inspiration
Food prices in Nigerian markets move every week. A basket of tomatoes can cost 3,500 naira one month and 2,400 the next. My family, like most families, buys from memory and guesswork. We overpay when prices peak and miss the cheap weeks. I wanted one simple tool that answers three questions before anyone leaves for the market: what is the real price, is today a good day to buy, and how do I spend this budget best?
What it does
MarketSense NG tracks weekly prices for 10 everyday items: garri, rice, beans, yam, tomatoes, pepper, onions, palm oil, eggs and dried fish. For each item it shows the price history as a chart, forecasts the next two weeks, and scores the current price from 0 to 100 with a plain verdict: good time to buy, fair price, or wait if you can. If a price suddenly looks unusual, the app warns you to double-check. You can log the price you saw today in seconds and every forecast updates instantly. The smart shopping planner takes your budget and the quantities you need, then picks the best value mix that fits.
How I built it
React, Vite and Tailwind CSS for the interface. All the smart parts are local JavaScript in one tested engine module: linear regression for forecasts, a blended deal score against history and forecast, a z-score spike check, and a greedy value-density budget optimiser. 23 unit tests cover the engine. There is no backend and no paid API, so it works fully on the device, which matters where data is costly.
Challenges I ran into
Prices are noisy, especially fresh items like tomatoes. A forecast that jumps around is worse than none, so I tuned the trend thresholds and floored forecasts to keep them believable. The deal score also had to stay honest: it compares against both the historical average and the forecast, so a single cheap week does not fool it.
Accomplishments that I am proud of
A complete, tested price engine in the browser, a planner that respects a real budget, and a design that feels like a market board, not a bank dashboard. The whole product works offline once loaded.
What I learned
Small, honest models beat big vague ones. A clear verdict a shopper trusts is worth more than a precise number nobody believes.
What is next for MarketSense NG
Community price reports per market and town, starting with Bida and Minna. Price drop alerts by SMS and WhatsApp. Shared family shopping lists with one combined budget plan. Seasonal guidance to buy staples ahead of known seasonal rises.
Built With
- css
- javascript
- react
- tailwind
- vite
- vitest
