Decentralized Healthcare Trust Layer
Project C.A.R.E - X is a blockchain-based healthcare system designed to facilitate secure, privacy-preserving sharing of medical data between hospitals, doctors, and patients. It integrates medical hardware, EMR systems, IPFS for distributed storage, and a public blockchain for trust and access control.
The system consists of several key components:
-
Public Blockchain: Anchors trust, manages access control (ACL), and logs consent/audit trails.
-
EMR Platform:
- Backend: FastAPI-based server handling logic and blockchain interaction.
- Frontend: Vite/React web interface for hospital staff.
-
Doctor/Auditor Dashboard: Streamlit application for clinicians and auditors to view unified data.
-
Patient Dashboard: Next.js application for patients to manage their records and consent.
-
Hardware Gateway: Python service simulating medical hardware data ingestion.
-
IPFS: Used for distributed storage of large medical files (simulated or actual integration).
Ensure you have the following installed:
- Node.js (v18+ recommended) & npm
- Python 3.8+ & pip
- Ganache: For running a local Ethereum blockchain.
The project uses a centralized .env file for configuration.
- Copy the example environment file:
cp .env.example .env
- Open
.envand verify the configurations.-
Ganache: Ensure
NEXT_PUBLIC_BLOCKCHAIN_URLmatches your local Ganache RPC URL (usuallyhttp://127.0.0.1:7545). -
Accounts: The
.env.examplecomes pre-filled with deterministically generated Ganache accounts (from the mnemonic provided in project docs if applicable). If you use a fresh Ganache workspace, you may need to update these addresses and keys.
-
You need to install dependencies for the various sub-components.
Blockchain & Backend:
pip install -r blockchain/requirements.txt
pip install -r emr_platform/backend/requirements.txt
pip install streamlit # For the DashboardEMR Frontend:
cd emr_platform/frontend
npm install
cd ../..Patient Dashboard:
cd patient-dashboard-app
npm install
cd ..-
Start your Ganache workspace.
-
Ensure it is running on the port specified in
.env(default7545). -
Deploy the Smart Contracts:
cd blockchain python3 deploy_contract.py cd ..
Note: The
.envfile might already contain a pre-deployed contract address suitable for the provided Ganache accounts.
Use the provided shell script to spin up the Hospital EMR, Backend, Gateway, and Doctor Dashboard.
./run.shThis script will launch:
- EMR Backend: Types (
http://localhost:8000) - EMR Frontend: (
http://localhost:5173) - Doctor Dashboard: (
http://localhost:8501) - Hardware Gateway: (Background service)
- It will also seed the database with mock data.
1. EMR Backend:
cd emr_platform/backend
uvicorn main:app --reload --port 8000Wait for the backend to start before running frontends.
2. EMR Frontend (Hospital Portal):
cd emr_platform/frontend
npm run dev3. Doctor's Dashboard:
streamlit run dashboard/app.py4. Hardware Gateway:
python3 gateway/service.pyThe Patient Dashboard is a separate Next.js application.
cd patient-dashboard-app
npm run devAccess it at user specific port (usually http://localhost:3000).
- Decentralized Identity: Patients control their identity and record access.
- Consent Management: Grant/Revoke access to specific doctors or hospitals via Blockchain.
- Immutable Logs: All access and data sharing events are recorded on-chain.
- Interoperability: Designed to bridge gaps between different EMR systems (e.g., Epic, Cerner simulation).
blockchain/: Smart contracts (Solidity) and deployment scripts.emr_platform/: The core Hospital Information System (Backend + Frontend).patient-dashboard-app/: API and UI for the Patient Portal.dashboard/: Analytics and unified view for Doctors.gateway/: IoT/Hardware simulation layer.hardware/: Hardware specific configurations/code.


