A comprehensive blockchain-powered healthcare management system built with React, Node.js, and Hyperledger Fabric.
HealthScore provides a secure, decentralized platform connecting Patients, Doctors, Pharmacists, Blood Test Labs, and Insurance providers. It leverages a 5-organization local Hyperledger Fabric network to ensure medical records and prescriptions are tamper-proof and securely shared.
The system also features live system monitoring through an integrated Prometheus and Grafana stack, viewable via a dedicated master Admin Dashboard.
Before running this project, ensure you have the following installed:
- Node.js (v18+ recommended)
- Docker & Docker Compose (Ensure the Docker daemon is running)
- Git
Create a .env file in the backend/ directory with the following variables:
# Port for the Node.js Backend
PORT=5001
# Master Admin Key to bypass Lock Screen on the /admin route
ADMIN_KEY="admin"
# Pinata API JWT for IPFS file uploads (Used for Medical Records/Vault)
PINATA_JWT="your_pinata_jwt_here"
# Groq API Key for the Patient AI Assistant Chatbot
GROQ_API_KEY="your_groq_api_key_here"Follow these steps to spin up the entire ecosystem (Blockchain + Backend + Frontend + Monitoring).
First, you need to spin up the 5-organization Hyperledger Fabric network and install the Chaincode.
# From the project root
./install-fabric.sh(Note: This is a heavy initialization script. On the very first run, it will download necessary Docker images, build the crypto material, create the channel, and deploy the chaincode. This can take anywhere from 5 to 10 minutes depending on your internet connection. Subsequent runs of ./resume.sh will be instant.)
The backend handles API requests, interacts with the Fabric SDK, and exposes Prometheus metrics.
cd backend
npm install
node server.jsThe backend will start on http://localhost:5001. On first boot, it will automatically enroll the admin identities for all 5 organizations into the Fabric wallets.
The frontend is a Vite-powered React application.
# In a new terminal tab
cd frontend
npm install
npm run devThe frontend will start on http://localhost:5173.
To view live metrics (HTTP requests, Fabric transaction rates, memory usage, etc.), start the Grafana and Prometheus containers:
# In a new terminal tab, from the project root
docker compose -f monitoring/docker-compose.monitor.yml up -d- Grafana Live Dashboard:
http://localhost:3001(Dashboard auto-provisioned) - Admin App View: Navigate to
http://localhost:5173/adminand enter yourADMIN_KEYto view the embedded monitoring widgets.
Since the Hyperledger Fabric network runs in Docker containers, you don't need to rebuild the network from scratch every time you stop working.
To pause the network without losing data (stops Fabric peers + Monitoring):
./stop.shTo resume the network with all previous ledger data intact:
./resume.sh- Frontend: React, Vite, Framer Motion, Lucide Icons
- Backend: Node.js, Express, Fabric SDK (
fabric-network), Prom-Client - Blockchain: Hyperledger Fabric v2.x (5 Orgs: Hospital, Patient, Pharmacy, Lab, Insurance)
- Monitoring: Prometheus (scraping Backend + Fabric Peers + Orderer), Grafana
- External APIs: Pinata (IPFS), Groq (AI Chat)
You can test the platform immediately by logging in with the default seeded accounts.
(The password for all default accounts is password123)
| Role | Username | Dashboard Route |
|---|---|---|
| Patient | patient1 |
/patient |
| Doctor | doctor1 |
/doctor |
| Pharmacist | pharma1 |
/pharmacist |
| Blood Test Lab | lab1 |
/bloodtest |
| Insurance | ins1 |
/insurance |
To view the Master Admin Dashboard for monitoring:
Navigate to /admin and enter the ADMIN_KEY password (default: admin).