A Comprehensive MERN/PERN Stack Hospital Management & Telemedicine Platform Streamlining clinical workflows, virtual consultations, secure medical records, and digital payment processing.
- Multi-Role Authentication: Patients, Doctors, and Administrators.
- Secure Auth Flow: JWT (JSON Web Tokens) with secure cookie/header storage and Bcrypt password hashing.
- Verify Account & Password Reset: Pre-configured setup for email-based verification.
- Dynamic Slot Booking: Interactive doctor availability scheduling.
- Integrated Payments: Secure payment gateway integration with Razorpay.
- Video Consultations: Secure, unique video room ID generated upon appointment booking.
- Live Chat: Real-time communication between doctors and patients powered by Socket.io.
- File Attachments: Send documents and prescriptions directly inside the chat window.
- Electronic Health Records (EHR): Create, view, and manage secure medical records.
- Digital Prescriptions: Generate complete prescriptions with custom dosages, frequencies, and instructions.
- PDF Export: Print or save prescriptions and invoices as PDF using
jspdfandhtml2canvas.
- System Metrics: Real-time analytics, user registration patterns, and revenue reports via Recharts.
- Role & User Management: Admin panel to approve/reject doctor applications, view logs, and oversee all activities.
Below is the home screen of MediCare Pro:
| Layer | Technologies |
|---|---|
| Frontend | React 18, React Router v6, Framer Motion, Recharts, Lucide React, Tailwind CSS / Custom CSS, Socket.io-client |
| Backend | Node.js, Express, Socket.io, Node-cron, Nodemailer, Sequelize (ORM) |
| Database & Caching | PostgreSQL (PG client), Redis |
| Integrations | Razorpay (Payment Gateway) |
graph TD
Client[React Frontend Client] <-->|HTTPS / REST API| Server[Express Node.js Server]
Client <-->|WebSockets| SocketServer[Socket.io Engine]
Server <-->|Sequelize ORM| DB[(PostgreSQL Database)]
Server <-->|Session / Limits| Redis[(Redis Cache)]
Server -->|Transactional Emails| Nodemailer[Nodemailer / SMTP]
Server <-->|Payments| Razorpay[Razorpay API]
Make sure you have the following installed on your machine:
- Node.js (v16+ recommended)
- PostgreSQL
- Redis Server
Run the installation helper script from the root directory to install dependencies for the root, backend, and frontend directories:
npm run install-allCreate a .env file in the backend/ directory:
PORT=5000
NODE_ENV=development
# Database Configuration
DB_HOST=127.0.0.1
DB_PORT=5432
DB_USER=your_postgres_user
DB_PASSWORD=your_postgres_password
DB_NAME=medicare_pro_db
# Security & Auth
JWT_SECRET=your_jwt_secret_key
REFRESH_TOKEN_SECRET=your_refresh_token_secret_key
# Redis Configuration
REDIS_URL=redis://127.0.0.1:6379
# Razorpay Keys
RAZORPAY_KEY_ID=your_razorpay_key_id
RAZORPAY_KEY_SECRET=your_razorpay_secret
# SMTP Email Config (Nodemailer)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your_email@gmail.com
SMTP_PASS=your_app_passwordCreate a .env.development file in the frontend/ directory:
REACT_APP_API_URL=http://localhost:5000
REACT_APP_SOCKET_URL=http://localhost:5000
REACT_APP_RAZORPAY_KEY_ID=your_razorpay_key_idInitialize database tables, schemas, and default mock data (doctors, users, etc.):
# In the backend directory
cd backend
npm run migrate:doctor-address
npm run seedYou can run the entire application (both backend and frontend concurrently) from the root directory:
npm run devThe frontend will run on http://localhost:3000 and proxy backend requests to http://localhost:5000.
medicare-pro/
βββ backend/
β βββ config/ # Database & configuration files
β βββ database/ # DB Connection setup
β βββ middleware/ # Auth, rate limiting & error handlers
β βββ migrations/ # DB Schema updates
β βββ models/ # Sequelize Models (User, Appointment, MedicalRecord...)
β βββ routes/ # Express route endpoints (auth, payments, chat...)
β βββ scripts/ # Auxiliary migration/maintenance scripts
β βββ utils/ # Helper functions (email, payments, socket...)
β βββ seed.js # Database seed runner
β βββ server.js # Main entry point for the backend API & WebSockets
βββ frontend/
β βββ public/ # Static assets (favicons, home screenshots...)
β βββ src/
β βββ components/ # Shared/Reusable UI components
β βββ context/ # React state contexts
β βββ pages/ # Dashboard, chat rooms, landing pages, booking logs
β βββ App.js # Main application routing and core logic
βββ package.json # Root scripts (concurrent runner)
βββ README.md # Project documentation
Distributed under the MIT License. See LICENSE for more information.
