Skip to content

ayushap18/MyhealthID

Repository files navigation

🏥 MyHealthID - Your Health, Your Identity, Your Control 🏥

Typing SVG

Ethereum IPFS React Native MongoDB License


🎯 What is MyHealthID?

MyHealthID is a revolutionary decentralized health identity platform that puts YOU in control of your medical data. Built on Ethereum Sepolia blockchain and secured with IPFS, MyHealthID ensures your health information is:

🔐 Core Principles

  • 🛡️ Secure - Military-grade encryption + blockchain immutability
  • 👤 Private - You own and control your data, not corporations
  • 🌐 Decentralized - No central authority or single point of failure
  • 🔓 Interoperable - Share with any healthcare provider seamlessly
  • 📱 Accessible - Your health records, anytime, anywhere


✨ Key Features

🆔 Decentralized Identity

Your health identity is stored on the Ethereum blockchain, ensuring:

  • Permanent, tamper-proof records
  • No central database vulnerabilities
  • True data ownership
  • Cross-platform compatibility


📊 Complete Medical Records

Store and manage all your health data:

  • Medical history & diagnoses
  • Prescriptions & medications
  • Lab results & imaging
  • Vaccination records
  • Allergies & conditions


🔒 Privacy-First Design

Your data is encrypted and secure:

  • End-to-end encryption
  • Zero-knowledge proofs
  • Granular access controls
  • Audit trails for all access
  • HIPAA-compliant architecture


🌍 Universal Access

Access your health data anywhere:

  • Mobile app (iOS & Android)
  • Web portal
  • Emergency access protocols
  • Provider integrations
  • International compatibility


📚 Documentation

📖 Available Documentation

Document Description Link
📋 Project Overview Concept, features, and architecture View
💻 Code Documentation Tech stack, folder structure, configuration View
🔧 API Reference Backend endpoints and usage Coming Soon
🎨 UI/UX Guide Design system and components Coming Soon

🚀 Quick Start Guide

Get MyHealthID running in 10 minutes!


⚙️ Prerequisites

Required Software

Before you begin, ensure you have these installed:

  • Node.js (v16 or higher) & npm
  • MongoDB (Local installation or MongoDB Atlas account)
  • Expo Go app on your mobile device (iOS | Android)
  • MetaMask or any Ethereum wallet (for deployment)
  • Git for cloning the repository

📥 Installation

Step 1: Clone the Repository

git clone https://github.com/YOUR_USERNAME/MyHealthID.git
cd MyHealthID

Step 2: Install Dependencies

# Install root dependencies
npm install

# Install backend dependencies
cd backend
npm install
cd ..

Step 3: Configure Environment

Create a .env file in the backend directory:

# MongoDB Configuration
MONGODB_URI=mongodb://localhost:27017/myhealthid
# or for MongoDB Atlas:
# MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/myhealthid

# Ethereum Sepolia Configuration
SEPOLIA_RPC_URL=https://sepolia.infura.io/v3/YOUR_INFURA_KEY
PRIVATE_KEY=your_wallet_private_key
CONTRACT_ADDRESS=0x6389b44A56E1bb6BCff56FDE4A563CCF41b15825

# IPFS Configuration
IPFS_API_URL=https://ipfs.infura.io:5001
IPFS_GATEWAY=https://ipfs.io/ipfs/

# JWT Secret
JWT_SECRET=your_secure_random_secret

# Server Configuration
PORT=3000
NODE_ENV=development

🎮 Running the Application

🖥️ Start Backend Server

Open a terminal and run:

cd backend
npm start

You should see:

✅ Server running on port 3000
✅ Connected to MongoDB
✅ Contract deployed at: 0x6389b44A56E1bb6BCff56FDE4A563CCF41b15825

📱 Start Frontend Application

Open a new terminal window and run:

# From the root directory
npm start

This will start the Expo development server. You'll see a QR code in the terminal.

📲 Launch on Mobile

  1. Open Expo Go app on your phone
  2. Scan the QR code displayed in the terminal
  3. Wait for the app to build and launch
  4. 🎉 Start using MyHealthID!

🌐 Blockchain Deployment

Deploy to Ethereum Sepolia Testnet

MyHealthID is configured for Ethereum Sepolia Testnet (Chain ID: 11155111)


💰 Step 1: Get Testnet ETH

You need Sepolia ETH to deploy smart contracts and make transactions.

Official Faucets:

Steps:

  1. Visit any faucet above
  2. Enter your wallet address: 0x6389b44A56E1bb6BCff56FDE4A563CCF41b15825
  3. Complete captcha/verification
  4. Receive 0.5-1.0 Sepolia ETH

🚀 Step 2: Deploy Smart Contract

# Navigate to contracts directory
cd backend/contracts

# Compile contracts
npx hardhat compile

# Deploy to Sepolia
npx hardhat run scripts/deploy.js --network sepolia

Expected Output:

🔨 Compiling contracts...
✅ Compilation successful
🚀 Deploying HealthIDContract...
✅ Contract deployed to: 0xYOUR_NEW_CONTRACT_ADDRESS
📝 Transaction hash: 0x...
⛽ Gas used: ~2,500,000

⚙️ Step 3: Update Configuration

After successful deployment, update your backend/.env file:

CONTRACT_ADDRESS=0xYOUR_NEW_CONTRACT_ADDRESS

Then restart your backend server:

cd backend
npm start

🌱 Step 4: Seed Test Data (Optional)

Populate the database with pilot users and sample health records:

cd backend
node scripts/seedPilotData.js

This will create:

  • 👥 5 test patient accounts
  • 🏥 3 test healthcare provider accounts
  • 📋 Sample medical records
  • 💊 Sample prescriptions
  • 🧪 Sample lab results

Test Accounts:

Patient 1: patient1@test.com / password123
Patient 2: patient2@test.com / password123
Doctor 1: doctor1@test.com / password123

📊 Current Status

✅ Production Ready Features

Feature Status Details
🌐 Network ✅ Live Ethereum Sepolia (Chain ID: 11155111)
💰 Wallet ✅ Funded ~100 PYUSD (Sepolia Testnet)
🏗️ Smart Contract ✅ Deployed 0x6389b44A56E1bb6BCff56FDE4A563CCF41b15825
📱 Mobile App ✅ Working React Native + Expo
🖥️ Backend API ✅ Running Node.js + Express
💾 Database ✅ Active MongoDB
🔐 Authentication ✅ Secure JWT + Blockchain signatures
📦 IPFS Storage ✅ Integrated Decentralized file storage

🔄 Migration Complete

  • Migrated from: Polygon Mumbai → Ethereum Sepolia
  • Codebase Updated: All references updated to Sepolia/Ethereum
  • Testing Complete: Full functionality verified on Sepolia
  • Documentation Updated: All guides reflect current setup

🏗️ Architecture

📱 Tech Stack

Frontend

React Native Expo JavaScript

Backend

Node.js Express MongoDB

Blockchain

Ethereum Solidity Hardhat

Storage

IPFS

🔄 Data Flow

📱 Mobile App (React Native)
        ↕
🔐 Authentication Layer (JWT + Blockchain)
        ↕
🖥️ Backend API (Node.js + Express)
        ↕
    ┌───┴───┬───────┬──────┐
    ↓       ↓       ↓      ↓
💾 MongoDB ⛓️ Ethereum 📦 IPFS 🔒 Encryption

🛡️ Security Features

🔐 Multi-Layer Security

  • 🔒 End-to-End Encryption - AES-256 encryption for all health data
  • ⛓️ Blockchain Immutability - Tamper-proof record keeping
  • 🎫 JWT Authentication - Secure session management
  • 🔑 Private Key Management - Hardware wallet support
  • 📝 Audit Logs - Complete access history
  • 🛡️ Smart Contract Security - Audited and tested code
  • 🚫 Zero-Knowledge Proofs - Verify without revealing data
  • 🔐 Multi-Signature - Critical operations require multiple approvals

🤝 Contributing

We welcome contributions from the community! Here's how you can help:

🚀 Getting Started

# Fork the repository
git clone https://github.com/YOUR_USERNAME/MyHealthID.git

# Create a feature branch
git checkout -b feature/amazing-feature

# Make your changes and commit
git commit -m "Add amazing feature"

# Push to your fork
git push origin feature/amazing-feature

# Open a Pull Request

💡 Ways to Contribute

  • 🐛 Bug Reports - Found a bug? Let us know!
  • Feature Requests - Have an idea? Share it!
  • 📝 Documentation - Help improve our docs
  • 🎨 UI/UX - Design improvements
  • 🔒 Security - Security audits and improvements
  • 🧪 Testing - Write tests, find edge cases
  • 🌍 Translations - Help make it multilingual

🗺️ Roadmap

🎯 Current Phase (Q1 2025)

  • ✅ Core platform development
  • ✅ Ethereum Sepolia integration
  • ✅ Mobile app MVP
  • ✅ Basic health record management

🚀 Next Phase (Q2 2025)

  • 🔄 Healthcare provider integrations
  • 🔄 Advanced encryption features
  • 🔄 Emergency access protocols
  • 🔄 Multi-language support

🌟 Future Vision (Q3-Q4 2025)

  • 📅 AI-powered health insights
  • 📅 Wearable device integration
  • 📅 Telemedicine integration
  • 📅 Insurance claim automation
  • 📅 Mainnet deployment

📞 Support & Contact

🆘 Need Help?

🌐 Community

Discord Twitter Telegram


📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

⚖️ What This Means

  • ✅ Free to use, modify, and distribute
  • ✅ Commercial use allowed
  • ✅ No warranty provided
  • ⚠️ License and copyright notice must be included

🙏 Acknowledgments

Special thanks to:

  • 🌐 Ethereum Foundation - For the blockchain infrastructure
  • 📦 IPFS Protocol Labs - For decentralized storage
  • 🏥 Healthcare Community - For feedback and support
  • 💻 Open Source Community - For amazing tools and libraries

⚠️ Important Disclaimers

🚧 Development Status

MyHealthID is currently in active development and deployed on the Sepolia testnet. This means:

  • ⚠️ Not for production use - Do not store real medical data yet
  • ⚠️ Testnet only - Using test cryptocurrencies, not real money
  • ⚠️ Breaking changes possible - APIs and features may change
  • ⚠️ Security audit pending - Full security audit in progress

🏥 Medical Disclaimer

  • 📋 This platform is for health record management only
  • 🚫 Not a substitute for professional medical advice
  • 🚫 Not intended for diagnosis or treatment
  • 👨‍⚕️ Always consult healthcare professionals for medical decisions

🔒 Privacy Notice

  • 🔐 Your data is encrypted and stored securely
  • 👤 You maintain full ownership of your health data
  • 🔓 You control who accesses your information
  • 📊 See our Privacy Policy for details

🏥 Made with ❤️ for Healthcare Innovation

Empowering Patients. Securing Data. Transforming Healthcare. 🚀

Your Health. Your Identity. Your Control.

Star this repo Watch this repo Fork this repo


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published