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.