Real-Time MERN-Based Medical Inventory Tracking
Hospitals struggle to track drug availability, expiry, and movement accurately. Manual systems lead to:
- Stockouts (life-saving medicines unavailable)
- Wastage due to expired drugs
- Delayed supply between warehouse and pharmacies
- Poor visibility of where medicines are and in what condition
A smarter real-time system is needed to ensure the right medicines reach the right place at the right time.
We built a Smart Real-Time Drug Inventory and Supply Chain Management System using the MERN stack.
- Tracks drug stock, expiry, temperature, and movement
- Updates inventory instantly whenever drugs are added, used, or transferred
- Sends email alerts for low stock, expiring medicines, wrong storage temperature, and delayed supply
- Manages warehouse to pharmacy transfer, updating stock at both ends
- Prevents shortages and improves transparency
Managing medical inventory has become increasingly complex in hospitals. Manual systems often fail due to inaccurate tracking, expiry mismanagement, and inefficiencies in drug movement.
To solve this, we developed a real-time MERN-based Drug Inventory & Supply Chain Management Platform. It ensures the "Right Quantity of the Right Product at the Right Place at the Right Time."
The system provides:
- Instant stock and expiry updates
- Warehouse-to-pharmacy movement tracking
- Automated email alerts
- Condition monitoring (e.g., temperature)
- Reduced wastage
- Faster decision making
| Component | Purpose |
|---|---|
| MongoDB | Stores drug data, stock, expiry, movement logs |
| Express.js | Backend API handling all inventory operations |
| React.js | Interactive dashboard for all stakeholders |
| Node.js | Server handling real-time communication |
- Socket.io – Real-time stock and alert updates
- Nodemailer / Email API – Sends critical alerts
- Cloud Storage – For storing logs and future image data
- Single language (JavaScript) across frontend and backend
- Real-time data capability
- Highly scalable (thousands of drug entries, multiple warehouses)
- Ideal for fast-changing medical inventory data
- Auto-updates for every add/remove/update
- Status visible across all devices instantly
- Alerts before expiry
- Track storage temperature and raise alerts
- One-click drug transfer
- Auto-stock update on both sides
- Low stock notifications
- Wrong storage conditions warnings
- Shipment delay alerts
- Warehouse Admin
- Pharmacist
- System Admin
- Daily/weekly stock flow
- Expiry logs
- Transfer logs
Warehouse Admin
|
| Adds/Updates drugs
v
Backend API (Express.js)
|
| Stores & Updates
v
MongoDB Database <----> Node.js Server <----> Socket.io (Real-Time)
|
v
React Dashboard (Pharmacist/Admin)
|
v
Email Alert System (Nodemailer)
Flow Summary: Every update is reflected in DB, instantly pushed to all dashboards, and alerts sent automatically.
- Reduced delays in drug movement
- Eliminated manual errors
- Ensured continuous medicine availability
- Achieved complete transparency in supply chain
- Improved patient care
GitHub Repository: MaheshN1821/hackathon
Project Demo Video: View Demo
git clone https://github.com/MaheshN1821/hackathon
cd hackathonBackend:
cd backend
npm installFrontend:
cd frontend
npm installInclude the following details:
MONGO_URI=
EMAIL_USER=
EMAIL_PASS=
JWT_SECRET=
Backend:
npm startFrontend:
npm run dev- Barcode/QR-based medicine scanning
- IoT-based temperature tracking sensors
- AI-based demand prediction for hospitals
- Mobile App version (React Native)
- Role-based advanced authentication (OAuth/Clerk)
Our smart medical inventory system replaces slow, error-prone manual processes with a modern, automated, real-time solution that improves drug availability, reduces wastage, and supports better hospital functioning.