An innovative medical document management solution utilizing blockchain and IPFS technologies to ensure security, confidentiality, and traceability of medical records.
A responsive web application enabling patients, doctors, and administrators to securely manage and access medical documents. Features blockchain wallet authentication, an intuitive interface, and granular access control system.
A cross-platform desktop version offering identical functionalities to the web application. Supports username/password authentication, compatible with Windows, macOS, and Linux, with automatic document opening in native applications.
- Decentralized medical document storage
- Patient-controlled access management
- Comprehensive action traceability
- Transparent audit system
- Automatic document opening mechanism
- Blockchain: Ethereum
- Storage: IPFS
- Web Frontend: React.js
- Desktop Frontend: Tkinter, CustomTkinter
- Languages: Python, JavaScript, Solidity
A system that revolutionizes medical document management by placing patient security and control at the core of technological innovation.
This guide provides step-by-step instructions for setting up Hardhat, deploying smart contracts using Remix IDE and running IPFS with Docker.
- Node.js (v16 or later)
- npm or yarn
-
Create a new project directory:
mkdir hardhat-project && cd hardhat-project
-
Initialize a new Node.js project:
npm init -y
-
Install Hardhat:
npm install --save-dev hardhat
-
Initialize a Hardhat project:
npx hardhat
- Choose
Create a basic sample project
. - Follow the prompts to set up your project.
- Choose
-
Install dependencies for testing and development:
npm install @nomicfoundation/hardhat-toolbox
Start a local blockchain:
npx hardhat node
- Create or modify your smart contract in the
contracts
folder. - Write a deployment script in the
scripts
folder. - Deploy the contract:
npx hardhat run scripts/deploy.js --network localhost
- Browser with MetaMask installed.
- Open Remix IDE.
- Create a new file under the
contracts
folder and write your smart contract. - Compile the contract using the
Solidity Compiler
plugin. - Deploy the contract:
- Go to the
Deploy & Run Transactions
plugin. - Choose your environment (
Injected Web3
for MetaMask or another preferred environment). - Deploy your contract by selecting it and clicking the
Deploy
button.
- Go to the
You will need the contracts addresses and ABI for each contract to connect them with the Applications
- Docker installed on your machine.
-
Pull the IPFS Docker image:
docker pull ipfs/kubo
-
Run the IPFS container:
docker run -d --name ipfs_node -v ipfs_data:/data/ipfs -p 4001:4001 -p 5001:5001 -p 8080:8080 ipfs/kubo
-v ipfs_data:/data/ipfs
: Persistent storage for IPFS data.-p 4001:4001
: Peer-to-peer communication.-p 5001:5001
: API access.-p 8080:8080
: Gateway access.
-
modify the API Configuration :
go to your container, enter to the files, data/IPFS/config :
"API": {
"HTTPHeaders": {
"Access-Control-Allow-Origin": ["*"]
}
},
You will need those setups to run the Desktop App and The Web App, you will find the instruction of running each app in their folder.
Note : the Desktop APP and The Web APP are using the same Contracts (contracts addresses and ABI), and the same IPFS.
- Ensure Node.js and npm versions are compatible.
- Use
npx hardhat clean
to clear the cache if issues arise.
- Make sure MetaMask is configured with the correct network.
- Ensure Docker is running.
- Check container logs for errors:
docker logs ipfs_node
.