A full-stack web application for managing drug inventories, orders, and users across multiple roles — Admin, Institute, and Pharmacy. Built using React + Vite on the frontend and Node.js + Express on the backend, with PostgreSQL as the database.
- Features
- Project Structure
- Tech Stack
- Database Schema
- Setup & Installation
- Usage
- Development
- Docker Support
- Contributing
- Contact
- Role-based Access: Admin, Institute, and Pharmacy with distinct dashboards and permissions.
- Drug Inventory Management: Add, edit, and track drugs with batch, expiry, and stock details.
- Order Management: Place, approve, and track orders between institutes and pharmacies.
- Analytics Dashboards: Visualize inventory, orders, and user activity.
- User Management: Register, edit, and manage institutes and pharmacies.
- Authentication & Authorization: Secure login with protected routes.
- Responsive UI: Clean and modern interface with mobile responsiveness.
DMS/
├── client/ # Frontend (React + Vite)
│ └── src/
│ ├── components/ # Reusable components
│ │ └── pages/ # Dashboards for Admin, Institute, Pharmacy
│ ├── context/ # User context, route protection
│ ├── constants/ # Static drug data, enums
│ └── utils/ # Helper functions
│
├── server/ # Backend (Node.js + Express)
│ ├── controllers/ # Business logic
│ ├── routes/ # API routes
│ ├── models/ # DB Models
│ └── middlewares/ # Auth, role checks
│
├── db/
│ └── schema.sql # PostgreSQL schema
│
└── docker-compose.yml
- Frontend: React, Vite, TailwindCSS
- Backend: Node.js, Express
- Database: PostgreSQL
- Containerization: Docker, Docker Compose
- users: Stores all user types (admin, institute, pharmacy) with role, status, and contact info.
- drugs: Drug inventory with type, batch, expiry, stock, and price.
- orders: Main order records linking senders and recipients.
- order_items: Drugs in each order with quantity, price, and status.
➡️ For full schema, check db/schema.sql
- Node.js (v16+)
- npm
- PostgreSQL
- Docker (optional)
git clone https://github.com/shuvam773/DMS.git
cd DMS
cd client
npm install
cd ../server
npm install
PORT=8080
JWT_SECRET=your_jwt_secret_here
DB_HOST=localhost
DB_USER=postgres
DB_PORT=5432
DB_PASSWORD=your_db_password_here
DB_NAME=dms
OPENROUTER_API_KEY=your_openrouter_api_key
psql -U "your_username" -d "your_db_name" -f db/schema.sql
cd server
npm run dev
cd client
npm run dev
- Frontend: http://localhost:5173
- Backend: http://localhost:8080
- Frontend: Work in
client/src/components/pages/ - Backend: Modify logic in
server/controllers/and routes inserver/routes/ - Database: Update
db/schema.sqland models inserver/models/
To run the full stack with Docker:
docker-compose up --build
This spins up:
- Frontend
- Backend
- PostgreSQL database
All services are defined in docker-compose.yml.
Contributions are welcome!
Feel free to open an issue or submit a pull request.
For questions or support, please open an issue on the GitHub repository.