A decentralized application (dApp) for managing patient records and doctor bookings using Ethereum. Developed as part of the CSE446: Blockchain and Cryptocurrencies course project.
- Appointment Management: Patients can book appointments with doctors.
- Role-Based Access: Roles for patients, doctors, and admins can be registered.
- Data on Blockchain: All data is securely stored on the Ethereum blockchain using smart contracts.
- Tech Stack: Built with React.js and Solidity.
- Blockchain Interaction: Uses MetaMask for blockchain interactions.
- Deployment Tools: Smart contracts deployed with Truffle; Ganache used for local Ethereum blockchain.
Following commands are tested on Linux.
If you want more through instructions, please visit the following Tutorial made by Yeasin sir.
-
Install Node Version Manager (nvm):
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
-
Install Node.js (v18.15.0):
nvm install 18.15.0 nvm alias default 18.15.0
-
Install Truffle:
npm install -g truffle
-
Install Ganache:
- Download from Ganache
- Install additional tools:
sudo add-apt-repository universe && sudo apt install libfuse2
- Make the downloaded file executable and run it.
-
Install MetaMask:
- Go to MetaMask and install the extension for your preferred browser.
- Follow the on-screen instructions to set up MetaMask.
-
Add Network Manually in MetaMask:
- Network Name: localhost:7545
- New RPC URL: http://127.0.0.1:7545
- Chain ID: 1337
- Currency Symbol: ETH
-
Import Ganache Account to MetaMask:
- Copy the private key from Ganache.
- Import the account in MetaMask using the private key.
- Clone the repository.
- Start Ganache and create a new workspace.
- Compile and deploy the smart contracts using Truffle:
truffle compile truffle migrate
- Install the required packages:
npm install
- Start the React app:
npm run dev
- Open the app in your browser at
http://localhost:3000/
.
The landing page of the app where the user can register as an Admin, Doctor, or Patient. Switching the account from MetaMask will change the role of the user. The first account of Ganache is an Admin account. If logged in as the first account, the landing page will directly take you to the Admin dashboard. Change the account to another account from Ganache to see the registration page.
Here patients can register by providing their details. Every time you register a new patient, a new transaction is created in the blockchain.
Here you will be able to update patient information.
Here you will be able to book an appointment with a doctor. You can also view if the doctor is booked at a particular time. Every time a patient books an appointment, the selected admin gets one ether as a fee.
Here the doctor can view their schedule and appointments with information like how many patients registered and their age.
- Fork the repository.
- Push your changes to a new branch.
- Create a pull request.
- Wait for the pull request to be reviewed.