A comprehensive, full-stack Hospital Management System built with the MERN stack (MySQL, Express.js, React, Node.js). Features a modern, futuristic UI with role-based dashboards, real-time updates, and complete healthcare workflow management.
- Patient Management - Complete patient registration, records, and history
- Appointment Scheduling - Book, manage, and track appointments
- Doctor Consultations - Digital consultation workflow with vitals, diagnoses, and prescriptions
- Laboratory Management - Lab test requests, sample tracking, and result management
- Pharmacy Management - Prescription dispensing and inventory control
- Billing & Payments - Invoice generation, payment processing, and financial tracking
- User Authentication - Secure JWT-based authentication with role-based access control
Each user role has a customized dashboard with relevant information and actions:
- Admin Dashboard - System-wide statistics and comprehensive oversight
- Doctor Dashboard - Patient queue, consultations, and clinical workflow
- Receptionist Dashboard - Patient registration and appointment management
- Lab Technician Dashboard - Test processing and result management
- Pharmacist Dashboard - Prescription fulfillment and inventory
- Cashier Dashboard - Payment collection and invoice management
- Glassmorphism Design - Modern frosted glass effects with backdrop blur
- Neon Accents - Vibrant indigo, purple, and cyan color schemes
- Smooth Animations - Framer Motion powered transitions and interactions
- Responsive Layout - Fully responsive design for desktop, tablet, and mobile
- Real-time Updates - Live clock and dynamic data updates
- Status Indicators - Color-coded badges for quick status recognition
- React 18.2 - Modern React with hooks
- React Router v6 - Client-side routing
- Tailwind CSS - Utility-first CSS framework
- Framer Motion - Animation library
- Axios - HTTP client
- Context API - State management
- Node.js - JavaScript runtime
- Express.js - Web application framework
- MySQL - Relational database
- JWT - JSON Web Tokens for authentication
- Bcrypt.js - Password hashing
- Joi - Data validation
Before you begin, ensure you have the following installed:
- Node.js (v14.0.0 or higher)
- MySQL (v8.0 or higher)
- npm or yarn
git clone https://github.com/yourusername/hospital-management-system.git
cd hospital-management-system# Navigate to backend directory
cd backend
# Install dependencies
npm install
# Create .env file
cp .env.example .env
# Edit .env with your database credentials
# DB_HOST=localhost
# DB_USER=root
# DB_PASS=your_password
# DB_NAME=clinic_management_system
# DB_PORT=3306
# JWT_SECRET=your_jwt_secret
# PORT=4000
# Setup database
node setup_database.js
# Create demo users
node scripts/create_demo_users_fixed.js
# Start backend server
npm startThe backend will run on http://localhost:4000
# Navigate to frontend directory (from root)
cd frontend
# Install dependencies
npm install
# Start development server
npm startThe frontend will run on http://localhost:3000
After running the demo user creation script, you can login with:
| Role | Password | |
|---|---|---|
| Admin | admin@hospital.com | password123 |
| Doctor | doctor@hospital.com | password123 |
| Receptionist | receptionist@hospital.com | password123 |
| Lab Technician | lab@hospital.com | password123 |
| Pharmacist | pharmacy@hospital.com | password123 |
| Cashier | cashier@hospital.com | password123 |
hospital-management-system/
βββ backend/
β βββ config/ # Database and configuration files
β βββ controllers/ # Route controllers
β βββ middleware/ # Custom middleware
β βββ models/ # Database models
β βββ routes/ # API routes
β βββ scripts/ # Utility scripts
β βββ .env # Environment variables
β βββ server.js # Entry point
β βββ package.json
β
βββ frontend/
β βββ public/ # Static files
β βββ src/
β β βββ components/ # React components
β β β βββ common/ # Shared components
β β β βββ appointments/
β β β βββ billing/
β β β βββ consultation/
β β β βββ lab/
β β β βββ patient/
β β β βββ patients/
β β β βββ pharmacy/
β β βββ context/ # React Context providers
β β βββ pages/ # Page components
β β βββ services/ # API services
β β βββ utils/ # Utility functions
β β βββ App.jsx # Main App component
β β βββ index.js # Entry point
β βββ package.json
β
βββ README.md
POST /api/auth/register- Register new userPOST /api/auth/login- User loginGET /api/auth/me- Get current user
GET /api/patients- Get all patientsGET /api/patients/:id- Get patient by IDPOST /api/patients- Create new patientPUT /api/patients/:id- Update patientDELETE /api/patients/:id- Delete patientGET /api/patients/search- Search patients
GET /api/appointments- Get all appointmentsPOST /api/appointments- Create appointmentPUT /api/appointments/:id- Update appointmentDELETE /api/appointments/:id- Cancel appointment
GET /api/consultations- Get consultationsPOST /api/consultations- Create consultationPUT /api/consultations/:id- Update consultationPOST /api/consultations/:id/finish- Finish consultation
GET /api/lab-tests- Get lab testsPOST /api/lab-tests- Request lab testPUT /api/lab-tests/:id- Update test results
GET /api/prescriptions- Get prescriptionsPOST /api/prescriptions- Create prescriptionPUT /api/prescriptions/:id/dispense- Dispense medication
GET /api/billing/invoices- Get invoicesPOST /api/billing/invoices- Create invoicePOST /api/billing/payments- Process payment
Modern glassmorphism login with quick demo access buttons
System-wide statistics, recent activity, and quick actions
Patient queue with consultation management
Pending tests with priority indicators
Prescription queue with medication lists
Payment processing with invoice management
- JWT Authentication - Secure token-based authentication
- Password Hashing - Bcrypt with salt rounds
- Role-Based Access Control - Granular permissions per role
- Input Validation - Joi schema validation
- SQL Injection Prevention - Parameterized queries
- CORS Protection - Configured CORS policies
# Run backend tests
cd backend
npm test
# Run frontend tests
cd frontend
npm test# Login to Heroku
heroku login
# Create app
heroku create your-app-name
# Add MySQL addon
heroku addons:create jawsdb:kitefin
# Set environment variables
heroku config:set JWT_SECRET=your_secret
# Deploy
git push heroku main# Install Vercel CLI
npm i -g vercel
# Deploy
cd frontend
vercelContributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Your Name
- GitHub: @yourusername
- LinkedIn: Your LinkedIn
- Email: your.email@example.com
- React team for the amazing framework
- Tailwind CSS for the utility-first CSS framework
- Framer Motion for smooth animations
- The open-source community
For support, email mushas1248@gmail.com or open an issue in the GitHub repository.
- Add real-time notifications with WebSockets
- Implement appointment reminders via SMS/Email
- Add medical report generation (PDF)
- Integrate with external lab systems
- Add telemedicine video consultation
- Implement advanced analytics dashboard
- Add mobile app (React Native)
- Multi-language support
- Dark mode theme
- Export data to Excel/CSV
β If you find this project useful, please consider giving it a star!