MediChain-DApp is a decentralized desktop application designed to manage and secure medical records using blockchain technology. It leverages the Ethereum blockchain, IPFS for storage, and a Python/Flask backend integrated with FlaskGUI for a seamless desktop experience. This approach ensures data integrity, privacy, and accessibility for patients and authorized healthcare providers.
- User Registration: Patients and doctors can register with unique credentials.
- Medical Records Management: Securely create, update, and delete medical records stored on IPFS.
- Access Control: Patients can grant or revoke access to their medical records for specific doctors.
- Transaction Tracking: Record and settle transactions between patients and doctors.
- Audit History: Maintain a transparent audit trail of all medical events and modifications.
- Smart Contract: Solidity (
MediChain.sol
) - Blockchain Network: Ethereum (Ganache for local development)
- Backend & Desktop Interface: Python, Flask, and FlaskGUI
- IPFS Integration: Pinata for decentralized storage
- Blockchain Interaction: Web3.py for communicating with the Ethereum network
Click the link below to watch the demonstration video of MediChain-DApp:
DEMENSTRATTION_VIDEO.1.1.mp4
- Python 3.x: Download Python
- Ganache: Download Ganache
- Pinata Account: Sign up at Pinata
- Solidity Compiler (
solc
): Install viasolcx
in Python
-
Clone the Repository:
git clone https://github.com/yourusername/MediChain-DApp.git cd MediChain-DApp
-
Create and Activate a Virtual Environment:
python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate
-
Install Dependencies:
pip install -r requirements.txt
-
Set Up Environment Variables: Create a
.env
file in the root directory and add:WEB3_PROVIDER_URL=http://127.0.0.1:7545 CONTRACT_ADDRESS=your_contract_address PINATA_API_KEY=your_pinata_api_key PINATA_SECRET_API_KEY=your_pinata_secret_api_key
Update these values after you deploy the contract and set up Pinata.
-
Deploy the Smart Contract: Make sure Ganache is running, then:
python deploy_contract.py
Note the deployed contract address and update the
CONTRACT_ADDRESS
in.env
. -
Run the Application:
python app.py
A desktop interface will launch, allowing you to interact with MediChain-DApp.
- Register: Users can register as patients or doctors. Patients must provide an initial medical record file.
- Login: Authenticate using email, Ethereum address, and private key.
- Dashboard:
- Patients: Manage your records, grant/revoke doctor access, and view transaction history.
- Doctors: Access authorized patient records, update them, and review transactions.
- Medical Records Management: Doctors can upload new IPFS-hosted records and patients can review or delete them.
- Access Control & Audit Trails: Patients control who can view their records, and all record actions are logged.
- Private Keys: For demonstration, private keys are stored in the session. In production, consider secure wallet integrations or off-chain methods.
- Data Privacy: Use this DApp responsibly and ensure compliance with any applicable medical data regulations.
- .env & Sensitive Data: Protect your
.env
file and do not commit it to version control.
- Fork the repository.
- Create a feature branch (
git checkout -b feature/YourFeature
). - Commit changes (
git commit -m 'Add new feature'
). - Push the branch (
git push origin feature/YourFeature
). - Open a pull request on GitHub.
This project is licensed under the MIT License. See the LICENSE file for details.