Skip to content

Latest commit

Β 

History

42 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯ MediCare Pro

A Comprehensive MERN/PERN Stack Hospital Management & Telemedicine Platform Streamlining clinical workflows, virtual consultations, secure medical records, and digital payment processing.


🌟 Key Features

πŸ‘€ User Roles & Auth

  • 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.

πŸ“… Appointment & Scheduling

  • 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.

πŸ’¬ Real-time Telemedicine

  • Live Chat: Real-time communication between doctors and patients powered by Socket.io.
  • File Attachments: Send documents and prescriptions directly inside the chat window.

πŸ“‹ Clinical Records & Prescriptions

  • 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 jspdf and html2canvas.

πŸ›‘οΈ Admin Dashboard

  • 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.

πŸ“Έ Application Preview

Below is the home screen of MediCare Pro:

MediCare Pro Home Screen


πŸ› οΈ Technology Stack

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)

πŸ“ Architecture Diagram

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]
Loading

πŸš€ Setup & Installation

Prerequisites

Make sure you have the following installed on your machine:


Step 1: Install Dependencies

Run the installation helper script from the root directory to install dependencies for the root, backend, and frontend directories:

npm run install-all

Step 2: Configure Environment Variables

Backend Configuration

Create 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_password

Frontend Configuration

Create 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_id

Step 3: Run Database Seeds & Migrations

Initialize database tables, schemas, and default mock data (doctors, users, etc.):

# In the backend directory
cd backend
npm run migrate:doctor-address
npm run seed

Step 4: Run the Application Locally

You can run the entire application (both backend and frontend concurrently) from the root directory:

npm run dev

The frontend will run on http://localhost:3000 and proxy backend requests to http://localhost:5000.


πŸ“‚ Project Structure

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

πŸ“ License

Distributed under the MIT License. See LICENSE for more information.

About

πŸ₯ MediCare Pro: A full-stack MERN/PERN Hospital Management & Telemedicine platform featuring real-time chat, video consultations, doctor scheduling, integrated Razorpay payments, and secure digital prescription management.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages