This project demonstrates a blockchain-based health insurance system using Hardhat, Solidity, React, and MetaMask. It aims to provide a decentralized solution for managing health insurance, including member registration, provider registration, claim submission, and claim approval.
The Blockchain Social Health Authority system includes the following components:
- Smart Contracts: Written in Solidity and deployed using Hardhat.
- Frontend: Built with React, styled using Tailwind CSS, and integrated with MetaMask for blockchain interactions.
- MetaMask Integration: Enables users to connect their MetaMask wallet for authentication and transactions on the blockchain.
- Member Registration: Allows users to register as SHA members.
- Provider Registration: Allows healthcare providers to register with the system.
- Member Login: Enables SHA members to log in.
- Provider Login: Enables healthcare providers to log in.
- Claim Submission: Allows members to submit health insurance claims.
- Claim Approval: Enables providers to approve submitted claims.
Follow these steps to set up and run the project on your local machine.
- Node.js: Make sure you have Node.js installed. You can download it from here.
- MetaMask: Install the MetaMask extension in your browser. You can download it from here.
-
Clone the Repository:
git clone https://github.com/E-Sainx/SHAdev.git cd blockchain-health-insurance -
Install Dependencies:
npm install
-
Install Hardhat:
npm install --save-dev hardhat
The smart contracts are written in Solidity and managed using Hardhat.
-
Compile the Contracts:
npx hardhat compile
-
Run Tests:
npx hardhat test -
Deploy Contracts:
npx hardhat node npx hardhat run scripts/deploy.js --network sepolia
The frontend is built with React and integrated with MetaMask.
-
Start the React App:
npm start
-
Connect MetaMask:
- Open MetaMask and connect to the localhost network (usually
http://localhost:8545). - Import an account using the private key provided by Hardhat when running
npx hardhat node.
- Open MetaMask and connect to the localhost network (usually
-
Open the Application:
- The React application should be running at
http://localhost:3000.
- The React application should be running at
-
Register and Login:
- Use the interface to register as a member or provider.
- Log in using the registered member or provider credentials.
-
Submit and Approve Claims:
- Members can submit health insurance claims.
- Providers can approve submitted claims.
You can run the following Hardhat tasks:
-
Help:
npx hardhat help -
Run Tests:
npx hardhat test -
Run Tests with Gas Report:
REPORT_GAS=true npx hardhat test -
Run Local Node:
npx hardhat node
-
Deploy Contracts Using Ignition:
npx hardhat ignition deploy ./ignition/modules/Deploy.js
Contributions are welcome! Please fork the repository and create a pull request with your changes.
This project is licensed under the MIT License.
Blockchain -Wallet : Metamask -Ethereum node provider -Alchemy -MEdical documents storage- IPFS -Blockchain IDE -Hardhat -Testnet- Sepolia -solidity
Frontend -React -Tailwindcss
Backend
MongoDb Express JS Node v18 Deployed -Render.