Skip to content

codinggita/mediSync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

261 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

MediSync Banner

๐Ÿฅ MediSync

Bridging the Gap in Modern Healthcare

MediSync is a full-stack MERN healthcare web application that empowers patients to compare medicine prices across pharmacies and securely manage their medical records โ€” all in one unified, intelligent platform.

React Node.js Express.js MongoDB JWT Firebase Figma


๐Ÿ“‹ Table of Contents


โ— Problem Statement

Healthcare systems across the world are plagued by two deeply impactful and often overlooked challenges:

๐Ÿ’ธ 1. Lack of Medicine Price Transparency

Patients frequently pay significantly different prices for the same medicine depending on the pharmacy they visit. Without access to a centralized comparison tool, patients โ€” especially those with chronic conditions โ€” are left in the dark, often overpaying for essential medications.

๐Ÿ“Œ A 2023 survey found that the price of common drugs can vary by up to 10x across different pharmacies in the same city.

๐Ÿ—‚๏ธ 2. Fragmented Medical Records

Medical history is scattered across multiple hospitals, clinics, and diagnostic centers. Patients carry physical files, forget test results, or lose critical reports โ€” making it nearly impossible for doctors to get a complete picture of a patient's health at a glance. This fragmentation leads to delayed diagnoses, redundant tests, and poor patient outcomes.


โœ… Our Solution

MediSync addresses both problems with two core systems:

Feature Description
๐Ÿ’Š Medicine Price Comparison A real-time search & compare engine that aggregates medicine prices from multiple pharmacies and highlights the cheapest option
๐Ÿ“‚ Medical Record Hub A centralized, secure vault for uploading, organizing, and sharing medical records with doctors through controlled access

โœจ Features

๐Ÿ’Š Medicine Price Comparison

  • ๐Ÿ” Smart Search โ€” Search any medicine by name, salt, or brand
  • ๐Ÿ“Š Price Comparison โ€” View prices from multiple pharmacies side by side
  • ๐ŸŸข Cheapest Highlight โ€” The lowest-priced option is automatically highlighted for quick decision-making
  • ๐Ÿ”” Price Alerts โ€” Get notified when a medicine's price drops at any registered pharmacy

๐Ÿ“„ Medical Records Management

  • ๐Ÿ“ค Upload Reports โ€” Upload PDFs, images, prescriptions, lab reports, and discharge summaries
  • ๐Ÿ—“๏ธ Timeline View โ€” Visualize your complete medical history in a clean, chronological timeline
  • ๐Ÿ” Secure Sharing โ€” Share records with specific doctors using access-controlled, time-limited links
  • ๐Ÿ”’ Privacy First โ€” Only you control who sees your data

๐Ÿ”” Additional Features

Feature Description
๐Ÿšจ Emergency Mode Instantly share critical records (allergies, blood type, conditions) in emergencies
๐Ÿ“ฃ Notifications & Alerts Real-time alerts for price changes, appointment reminders, and shared record access
๐Ÿ‘ฅ Role-Based Access Separate, tailored dashboards for Patients, Doctors, and Admins
๐Ÿ“ฑ Responsive Design Fully optimized for desktop, tablet, and mobile

๐Ÿ› ๏ธ Tech Stack

Layer Technology Purpose
Frontend React.js Component-based, dynamic UI
Backend Node.js + Express.js RESTful API server
Database MongoDB + Mongoose Flexible NoSQL data storage
Authentication JWT + Google OAuth 2.0 Secure, stateless session management
File Storage Cloudinary / Firebase Storage Medical report upload & retrieval
Notifications Firebase Cloud Messaging (FCM) Real-time alerts & price drop notifications
Design Figma UI/UX prototyping
Version Control Git + GitHub Collaborative development

๐Ÿ—๏ธ Project Architecture

MediSync follows a Modular Monolith structure for the backend and a Feature-Based Design for the frontend to ensure maximum scalability and maintainability.

๐Ÿ“‚ Directory Overview

mediSync/
โ”œโ”€โ”€ ๐Ÿ’ป frontend/                      # Client-side Application (React + Vite)
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ public/                    # Static assets & manifest files
โ”‚   โ””โ”€โ”€ ๐Ÿ“ src/
โ”‚       โ”œโ”€โ”€ ๐Ÿ“ assets/                # Media, Global Styles & Fonts
โ”‚       โ”œโ”€โ”€ ๐Ÿ“ components/            # Reusable UI Components
โ”‚       โ”‚   โ”œโ”€โ”€ ๐Ÿ“ common/            # Atomic elements (Buttons, Inputs, Cards)
โ”‚       โ”‚   โ””โ”€โ”€ ๐Ÿ“ layout/            # Structural parts (Navbar, Sidebar, Footer)
โ”‚       โ”œโ”€โ”€ ๐Ÿ“ features/              # Feature-specific logic (Auth, Records, etc.)
โ”‚       โ”œโ”€โ”€ ๐Ÿ“ pages/                 # Full-screen route components
โ”‚       โ”œโ”€โ”€ ๐Ÿ“ services/              # API Client (Axios) & Interceptors
โ”‚       โ”œโ”€โ”€ ๐Ÿ“ store/                 # Global State Management (Context/Redux)
โ”‚       โ”œโ”€โ”€ ๐Ÿ“ hooks/                 # Custom React hooks
โ”‚       โ”œโ”€โ”€ ๐Ÿ“ routes/                # Route configuration & Role-based guards
โ”‚       โ”œโ”€โ”€ ๐Ÿ“ utils/                 # Helper functions & Date formatters
โ”‚       โ”œโ”€โ”€ ๐Ÿ“„ firebase.js            # Firebase Configuration & Auth Setup
โ”‚       โ”œโ”€โ”€ ๐Ÿ“„ App.jsx                # Application Root
โ”‚       โ””โ”€โ”€ ๐Ÿ“„ main.jsx               # Entry Point
โ”‚
โ”œโ”€โ”€ โš™๏ธ backend/                       # Backend API (Node.js + Express)
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ src/
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ config/                # Database & Environment settings
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ controllers/           # Route logic (Business logic)
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ middleware/            # Auth, Validation & Error Handling
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ models/                # Database schemas (Mongoose)
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ routes/                # API endpoint definitions
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ services/              # External integrations (SMS, Mail)
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ utils/                 # Global utility functions
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ uploads/               # Temporary file storage
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ app.js                 # App configuration
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“„ server.js              # Server entry point
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ .env                       # Local environment variables
โ”‚   โ””โ”€โ”€ ๐Ÿ“„ package.json               # Backend dependencies
โ”‚
โ”œโ”€โ”€ ๐Ÿ“„ .env.example                   # Environment variables template
โ””โ”€โ”€ ๐Ÿ“„ README.md                      # Project Documentation

๐Ÿ›ก๏ธ Architecture Highlights

Section Patterns & Principles
Frontend Atomic Design Principles for components, Feature-Sliced modules for business logic, and RBAC (Role-Based Access Control) for routing.
Backend MVC (Model-View-Controller) pattern, RESTful API design, and JWT-based stateless authentication.
Security CORS enabled, Environment variable protection, and encrypted medical data flow.

๐Ÿ—‚๏ธ Core Folder Breakdown

โš›๏ธ Frontend Logic

  • features/: Each module (e.g., auth/, medicine/) contains its own logic, keeping the code modular.
  • services/: Centralized Axios instance with interceptors for automatic token handling.
  • routes/: Implements PrivateRoute and PublicRoute to handle session-based navigation.

๐Ÿš€ Backend Logic

  • controllers/: Separates business logic from routing for cleaner code.
  • middleware/: Handles security checks (Auth, Input Validation) before reaching controllers.
  • models/: Defines the structure of healthcare data using Mongoose for MongoDB.

๐Ÿ—๏ธ System Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   CLIENT LAYER                  โ”‚
โ”‚              React.js (Frontend)                โ”‚
โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚   โ”‚ Medicine โ”‚ โ”‚ Records  โ”‚ โ”‚  Dashboard   โ”‚   โ”‚
โ”‚   โ”‚  Search  โ”‚ โ”‚ Manager  โ”‚ โ”‚  (Role-Based)โ”‚   โ”‚
โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
          โ”‚            โ”‚             โ”‚
          โ–ผ            โ–ผ             โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   API LAYER                     โ”‚
โ”‚          Node.js + Express.js (Backend)         โ”‚
โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚   โ”‚ Medicine โ”‚ โ”‚  Record  โ”‚ โ”‚    Auth &    โ”‚   โ”‚
โ”‚   โ”‚   API    โ”‚ โ”‚   API    โ”‚ โ”‚  User API    โ”‚   โ”‚
โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
          โ”‚            โ”‚             โ”‚
          โ–ผ            โ–ผ             โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  DATA LAYER                     โ”‚
โ”‚              MongoDB (Database)                 โ”‚
โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚   โ”‚ Medicine โ”‚ โ”‚ Medical  โ”‚ โ”‚   Users &    โ”‚   โ”‚
โ”‚   โ”‚ Pharmacy โ”‚ โ”‚ Records  โ”‚ โ”‚    Roles     โ”‚   โ”‚
โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Data Flow:

  1. The React frontend communicates with the backend via HTTP REST APIs
  2. The Express.js server handles business logic, authentication middleware, and routes requests
  3. MongoDB stores all persistent data โ€” users, medicine listings, pharmacy details, and encrypted medical records
  4. JWT tokens are issued on login and validated on every protected API request

๐Ÿ‘ฅ User Roles

MediSync implements a structured Role-Based Access Control (RBAC) system:

๐Ÿ™ Patient (User)

  • Search and compare medicine prices
  • Upload and manage personal medical records
  • Share records with specific doctors via secure links
  • Access emergency mode
  • Receive price drop notifications

๐Ÿ‘จโ€โš•๏ธ Doctor

  • View patient-shared medical records (with explicit permission)
  • Add consultation notes to shared records
  • Manage their own profile and availability

๐Ÿ›ก๏ธ Admin

  • Manage pharmacy and medicine listings
  • Oversee user and doctor accounts
  • Monitor platform activity and analytics
  • Handle reported issues and moderation

๐Ÿ”„ Project Workflow

๐Ÿ” Authentication Flow

User Visits โ†’ Sign Up / Google Login โ†’ JWT Issued โ†’ Role-Specific Dashboard

๐Ÿ’Š Medicine Comparison Flow

Search Medicine โ†’ View All Pharmacies โ†’ Compare Prices โ†’ Cheapest Highlighted โ†’ Navigate to Pharmacy

๐Ÿ“‚ Medical Record Flow

Upload Report (PDF/Image) โ†’ Auto-Categorized โ†’ Timeline View โ†’ Generate Secure Link โ†’ Share with Doctor โ†’ Doctor Views Record

๐Ÿšจ Emergency Flow

Emergency Mode Activated โ†’ Critical Info Surfaced โ†’ Share QR / Link โ†’ Medical Staff Accesses Data

๐ŸŽจ Figma Design

The UI/UX for MediSync was designed in Figma, following a modern healthcare aesthetic:

  • ๐ŸŽจ Clean Green-White Theme โ€” Inspired by trust, health, and clarity; using a calming palette of medical green (#00897B) and crisp white
  • ๐Ÿ“ Dashboard-Based Layout โ€” Role-specific dashboards with card-based UI, sidebar navigation, and data-rich panels
  • ๐Ÿ–ฑ๏ธ Intuitive UX โ€” Designed for patients of all tech comfort levels, with large CTAs, clear iconography, and minimal friction flows
  • ๐Ÿ“ฑ Mobile-First Responsiveness โ€” All screens designed for both mobile and desktop breakpoints

๐Ÿš€ Getting Started

Prerequisites

  • Node.js v18+
  • MongoDB (local or Atlas)
  • npm or yarn

Installation

# 1. Clone the repository
git clone https://github.com/priyabratasahoo780/mediSync.git
cd mediSync

# 2. Install backend dependencies
# 2. Install backend dependencies
cd backend
npm install

# 3. Install frontend dependencies
cd ../frontend
npm install

Environment Variables

Create a .env file in the /backend directory:

PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
GOOGLE_CLIENT_ID=your_google_oauth_client_id
GOOGLE_CLIENT_SECRET=your_google_oauth_client_secret
CLOUDINARY_CLOUD_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret

# Firebase Configuration
VITE_FIREBASE_API_KEY=your_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_auth_domain
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_storage_bucket
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
VITE_FIREBASE_APP_ID=your_app_id

Running the App

# Start backend server
cd backend
npm run dev

# Start frontend (in a new terminal)
cd frontend
npm run dev

The app will be running at http://localhost:5173 (frontend) and http://localhost:5000 (backend).


๐Ÿ”ฎ Future Enhancements

Enhancement Description
๐ŸŒ Real-Time Pharmacy APIs Live integration with pharmacy databases for up-to-date pricing
๐Ÿค– AI-Powered Suggestions Smart medicine alternatives and dosage recommendations using AI
๐Ÿ“ฑ Mobile Application Cross-platform React Native app for iOS and Android
๐Ÿ’ฌ Telemedicine Integration In-app video consultations with registered doctors
๐Ÿงฌ Health Analytics Dashboard Personalized health insights from medical history trends
๐ŸŒ Multi-language Support Accessibility for regional language speakers

๐Ÿ Conclusion

MediSync is more than just an application โ€” it's a step toward democratizing healthcare access.

  • ๐Ÿ’ฐ Cost Savings โ€” Transparent pricing ensures patients never overpay for medicines
  • ๐Ÿฉบ Better Diagnosis โ€” Complete, centralized records help doctors make faster, more accurate decisions
  • โšก Efficient Healthcare โ€” Reducing paperwork and record fragmentation saves time for both patients and providers

"Healthcare should be simple, transparent, and accessible to everyone."


Built with โค๏ธ using the MERN Stack

GitHub

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages