Case study / Secure Medical Systems & Blockchain

CareChain: Blockchain-Powered Secure Medical System

A full-stack platform for creating, signing, and tracking medical contracts between doctors and patients. Each contract defines a proposed treatment, and CareChain records the agreement and its approval status through an Ethereum smart contract to create a durable, independently verifiable trail.

CareChain medical contract platform logo

The challenge

Treatment consent is often split across forms, systems, and organizations, making it difficult to prove which terms were presented, who approved them, and whether they changed later. The workflow also had to keep administrator, doctor, and patient permissions separate without asking users to understand wallets or blockchain transactions.

The solution

CareChain gives doctors a structured way to create a treatment contract and gives the assigned patient a focused flow to review and approve it. The application submits contract creation and approval changes to a Solidity smart contract, while React, Node.js, MongoDB, JWT, TLS, and role checks handle the product experience and access boundaries.

A clear agreement between doctor and patient

A doctor creates a medical contract that connects a patient to a proposed treatment type and description. The assigned patient can then review the same contract and approve it through a dedicated personal area.

This turns treatment consent into a visible lifecycle: creation, review, approval, and later verification. Each party sees the information relevant to their role instead of sharing one unrestricted administrative screen.

  • Doctors create treatment contracts for assigned patients.
  • Patients review and approve their own contracts.
  • Administrators manage accounts and operational access.

From contract creation to recorded approval

The React interface sends an authenticated request to the Node.js and Express API. After checking the active user and role, the backend submits the medical contract to Ethereum and waits for transaction confirmation.

The contract begins as pending. When the assigned patient approves it, the system records the new approval state on the blockchain and exposes the updated status to both sides.

  1. 01

    Doctor creates a treatment contract

  2. 02

    API verifies identity and role

  3. 03

    Smart contract records the agreement

  4. 04

    Patient reviews the terms

  5. 05

    Approval is submitted

  6. 06

    Status becomes independently verifiable

Medical contracts recorded on the blockchain

CareChain keeps the readable medical agreement in encrypted, access-controlled storage. The smart contract manages the agreement's verification record, including a stable identifier, integrity Hash, opaque reference, timestamps, and approval state.

The backend handles blockchain communication through a managed signer, so doctors and patients use a familiar web product without managing MetaMask or paying gas directly. Creation and approval update the verifiable agreement state on the blockchain.

  • Unique contract identifier
  • Integrity Hash and opaque reference
  • Approval status on-chain
  • Traceable state changes
  • No user-managed wallet
  • Independent verification

Role-based access around the signing flow

JWT authentication establishes the active identity, role checks control which contract actions are available, and object-level authorization verifies that the requested agreement belongs to the current doctor or patient.

Password hashing, TLS, digital certificates, input validation, and server-side permission checks reinforce the workflow. A patient cannot browse another patient's contracts simply by changing an identifier in the request.

  • JWT authentication
  • Role-based contract actions
  • Contract ownership checks
  • bcrypt password hashing
  • TLS and digital certificates
  • Server-side authorization

Privacy, integrity, and operational security

Blockchain provides the agreement with a durable verification trail, while confidential medical content remains encrypted outside the public chain. Comparing the stored document with its on-chain Hash reveals whether the signed agreement has changed.

Managed encryption keys, contract-level authorization, immutable audit logs, security reviews, monitoring, and recovery procedures protect the full lifecycle around that verification record.

  • Encrypted off-chain medical contracts
  • Hash and opaque on-chain reference
  • Managed key lifecycle
  • Immutable audit trail
  • Smart contract security review
  • Monitoring and recovery

Technology stack

Technologies used in this project.

Frontend

  • React.js
  • JavaScript
  • React Router

Backend

  • Node.js
  • Express.js
  • REST APIs

Database

  • MongoDB Atlas
  • Mongoose

Blockchain

  • Solidity
  • Ethereum
  • Hardhat
  • Web3.js
  • Infura

Security & infrastructure

  • JWT
  • bcrypt
  • TLS/SSL
  • Apache
  • Docker
Engineering Knowledge BaseArchitectural Deep Dive

Want to explore the underlying system architecture?

Our engineering deep dives break down the low-level code structure, communication protocols, memory allocation math, and system design patterns behind this project.

Related development services

View all projects

Your next step

Let’s define what you need to build.

Bring the idea or the process you want to improve. We’ll start with the requirements, the risks and the right scope.

Discuss Your Project