2025-06-10•10 min read
Building Pharmaciano-ERP: A Multi-Vendor Pharmacy ERP with AI-Based Forecasting
Architecture decisions, real problems solved, and lessons from an active full-stack project.
Next.jsTypeScriptPostgreSQLERP

Overview
Pharmaciano-ERP started from a real, observed problem: pharmacy branches I'd seen were still managing stock on spreadsheets, leading to frequent stockouts of essential medicine and overstocking of slow-moving items. The goal wasn't to build another CRUD dashboard — it was to close the gap between "the data exists" and "someone actually acts on it."
Architecture
The app follows a modular, feature-sliced structure on top of Next.js's App Router, separating inventory, forecasting, and vendor modules into independently testable domains. Server Components handle data-heavy dashboard reads directly, keeping the client bundle lean for the lower-end, in-store hardware pharmacy staff often use. Zustand covers the small amount of genuinely global client state (active branch context, cart), rather than reaching for a heavier state library the app doesn't need.
Key Challenges
Current Status
Pharmaciano-ERP is in active testing, not yet a finished product. The core forecasting → restocking loop already works end to end, but multi-currency support and offline-first sync for low-connectivity branches are still on the roadmap.
Lessons So Far
The hardest part wasn't the UI — it was designing the forecasting pipeline's data flow so it stayed accurate as branches with different sales patterns were added, without requiring a full model retrain each time. Validating the data model against how real pharmacy staff actually work, early, mattered more than any individual technical decision.