RxPredict is a web app that helps independent pharmacies decide what to order and when. You upload your dispensing history, and it forecasts demand for each drug, flags the ones that need attention, and recommends how much to order.
Working in a pharmacy shaped how I understood the problem.
The problem
Independent pharmacies stock hundreds of drugs, and stock decisions often come down to gut feel. When that happens, three things go wrong:
- Stockouts on drugs people depend on, which costs the pharmacy patient trust.
- Overstock on slow movers, which sit on the shelf until they expire.
- No visibility into demand trends or seasonal patterns, so the same mistakes repeat.
Independent pharmacies usually don't have a data team, so RxPredict is built to work without one.
How it works
You upload your dispensing history as a CSV or Excel file. It handles common variations in column names, so you don't have to reformat the file. It then forecasts demand for every drug, over a horizon of 7 to 90 days, with confidence intervals.
It's built to work on a phone, since it's meant to be used during the pharmacy workflow.
Why it doesn't use one model
Drugs don't all behave the same way. A steady maintenance medication, a seasonal one, and one dispensed once every few weeks need different treatment. So for each drug, RxPredict runs several standard forecasting methods and keeps the one that does best:
- Simple moving average averages recent demand. It's a good baseline.
- Exponential smoothing weights recent weeks more than older ones.
- Holt-Winters adds trend and seasonality on top of that.
- Croston is built for intermittent demand, where most days are zero and a few aren't.
To pick the winner, RxPredict holds back the most recent part of each drug's history, forecasts it, and compares the forecast with what actually happened. The score is WAPE: the total forecast error divided by the total actual demand. The method with the lowest score on that drug is the one used.
The goal isn't the fanciest model. It's whichever one predicted best on that drug's own history.
From forecast to order
A forecast alone doesn't tell anyone what to do, so RxPredict turns it into an action. It looks at current stock, the supplier's lead time, and a safety buffer for uncertainty in demand. From that it works out when a drug should be reordered and how much to order, in units and in bottles. Each drug is labelled urgent, order soon, or stable.
It also raises alerts for:
- drugs that have dropped below their reorder point,
- drugs projected to run out within days,
- drugs expiring within 30 days,
- slow-moving excess stock.
Built for real pharmacies
Each pharmacy's data is isolated from every other pharmacy's. Admins invite their own staff, and there's no open sign-up.
The stack
Next.js and React, PostgreSQL with Drizzle ORM, Clerk for sign-in and multi-tenant organizations, Recharts for the forecast charts, and Vercel for hosting.
RxPredict is live at rxpredict.app. There's a showcase repo with screenshots on GitHub. The source code itself is private.