EMRChain is a blockchain-based web application for managing Electronic Medical Records (EMRs) securely and efficiently.
Ensure the following tools are installed on your system before starting:
- Node.js: Version >= 10.16 and npm >= 5.6
- Git: Installed and configured
- Truffle: Install globally using
npm install -g truffle
- MetaMask: Extension added to your browser
- Ganache: Development blockchain for testing
- IPFS: Install globally with
npm i --location=global ipfs
- Ethereum: Blockchain platform
- Solidity: For smart contracts
- Truffle: Development framework for Ethereum
- React.js: Frontend framework
- Bootstrap: UI framework
git clone https://github.com/EMRChain/EMRChain.git
Navigate to the project directory and install the required dependencies:
npm install
-
Configure the Ethereum network or provider in the
truffle-config.js
file. -
Compile the smart contracts:
truffle compile
-
Deploy the smart contracts:
truffle migrate
npm start
Install IPFS globally:
npm i --location=global ipfs
Start the IPFS daemon:
jsipfs daemon
Open the IPFS web UI in your browser: http://127.0.0.1:5002/webui
Configure IPFS to avoid forbidden errors during image uploads:
jsipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://127.0.0.1:5002", "http://localhost:3000", "http://127.0.0.1:5001", "https://webui.ipfs.io"]'
jsipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "POST"]'
Open Anaconda Prompt.
Navigate to the project directory using cd.
Activate the virtual environment:
conda activate myenv
Run the server:
python manage.py runserver
Start React development server:
npm start
Start IPFS:
jsipfs daemon
- Always ensure that the IPFS server (jsipfs daemon) is running before attempting to upload files.
- Check for proper MetaMask configuration to interact with the Ethereum network.
- Follow the configurations mentioned above to avoid common issues during setup.