A health record patients actually own, built node by node.
For a UK healthtech company, Code Encoders designed and built a blockchain-secured platform connecting patients, pharmaceutical researchers, clinics, and pharmacies on one system, from first architecture diagram to a production-ready, penetration-tested platform.
Every module is its own product in miniature. Patient, pharma, clinic, and pharmacy all read and write through the same blockchain-secured core, so nothing gets out of sync.
The Brief
One ecosystem, four very different users
The platform had to work as a single, blockchain-secured system while serving entirely different needs: patients who wanted control over their own data, researchers who needed compliant access to it, and clinical staff who needed practical day-to-day tools. Every layer had to hold up to healthcare-grade security and GDPR-aligned data handling.
Patients
Own the data
Control, share, and, if they choose, monetize their own medical records, appointment by appointment.
Pharma
Access it responsibly
Compliant, filtered, subscription-based access to anonymized research data.
Clinics
Run day-to-day care
Appointments, patient records, and clinical operations in one place.
Pharmacies
Manage the last mile
Prescriptions and medication-delivery tracking, tied back to the same patient record.
Our Approach
MVP first. Then build for real growth.
Rather than waiting on a monolithic, all-at-once launch, we shipped a working MVP fast, then let the client's own market feedback, investor conversations, and evolving compliance needs shape what came next. The platform roughly doubled in scope over the engagement; the delivery rhythm never broke.
Phase 1
MVP: Patient & Pharma foundation
Patient onboarding and a working pharmaceutical data-access module, delivered on schedule and demo-ready for investors within months of kickoff.
Phase 2
Identity & trust
Automated Subject Access Request document parsing, full identity (KYC) verification, and a migration from custodial to non-custodial Web3 wallets.
Phase 3
Security hardening
A ground-up end-to-end encryption rebuild and a dedicated, segregated Data Vault microservice for secure medical data storage.
Phase 4
Scale & polish
Real-time admin dashboard, a new public website, full technical documentation, and final UAT sign-off across every module.
The Ecosystem
Five modules. One connected system.
Every module is its own product in miniature, and every module talks to the others through the same blockchain-secured core.
Node 00: Super Admin
The control layer
Real-time monitoring, fine-grained role-based permissions across staff and partners, and full audit logging, sitting above and across every module below.
Node 01: Patient
Owns the record
Registration, medical history, consent controls, and a monetization pathway that lets a patient decide whether their data can be sold.
Node 02: Pharmaceutical
Researches responsibly
Subscription-based, smart-contract-governed access to anonymized data, with filtering, search, and purchase analytics.
Node 03: Clinic
Delivers care
Appointment scheduling, patient records, and day-to-day clinical operations.
Node 04: Pharmacy
Closes the loop
Prescription management and medication-delivery tracking, tied back to the same patient record.
Node 05: Consent & Ledger
Makes it provable
Every consent event and data transaction is logged and anchored to the blockchain, an auditable trail nobody can quietly edit.
React
Next.js
NestJS (TypeScript)
MongoDB
Redis
Polygon blockchain
Kubernetes / Google Cloud
CloudFlare CDN
Microservices & Infrastructure
Six services, independently deployable, one shared foundation
The backend isn't a single monolith. It's a microservices architecture built in NestJS and TypeScript, with a dedicated API Gateway and independent services for Patient, Clinic, Pharmacy, Payments, and Notifications, all sharing one common library of core models and logic. Each service ships, scales, and gets tested on its own, so a change to one never risks the rest.
API Gateway
Patient
Clinic
Pharmacy
Pharmaceutical
Payments
Notification
Resilient
Private Kubernetes clusters spread across multiple availability zones, so a single zone failure never takes the platform down.
Secured at the edge
CDN, web application firewall, DDoS protection, and identity-aware access control sit in front of every request before it reaches a service.
Observable
Full metrics, dashboards, and centralized logging across every microservice, so issues get caught before they're noticed by a user.
Cached & queued
A dedicated caching layer and background job queue keep high-traffic flows like payments and notifications fast and reliable.
Segregated data
Patient, clinic, pharma, and admin data live in separate domain-specific databases, with traffic that never touches the public internet.
Infrastructure as code
Clusters, networking, secrets, and access policies are all defined in code and deployed through GitOps, not clicked together by hand.
Prometheus
Grafana
Loki
Terraform
GitOps (ArgoCD)
Under the Hood
Where the engineering actually lives
The five modules are the surface. This is what makes them trustworthy underneath.
01
Patient-owned encryption
Data is encrypted and pushed to the blockchain sealed with the patient's own wallet key, so the platform itself never holds a standing readable copy.
02
Consent, provably
Consent forms are encrypted and stored on a decentralized storage network (IPFS); only their cryptographic hash is written on-chain: immutable proof without exposing medical data. Revoking access requires password plus one-time-code re-verification.
03
Two-sided payments
Full checkout, whether saved card, new card, or one-step, sits alongside automated payouts to data-sellers, with webhook-driven reconciliation and invoicing handled end to end.
04
Verified identity
Government-ID and biometric verification, matched against patient records with weighted fuzzy-scoring, gates access to sensitive features.
05
Permissions that update instantly
Role-based access across staff, clinics, and pharma partners, enforced at network, UI, and API layers, with changes applying immediately, not on next login.
06
Automated documents from data
Subject Access Request documents are parsed automatically, turning a messy medical record export into clean, structured data in seconds.
Security & Compliance
Built for healthcare data from day one
Not bolted on after launch. Architected in from the first sprint, with UK healthcare data-protection expectations (GDPR, data residency, NHS-aligned security posture) shaping every decision.
Encryption at rest and in transit across every data store
Minimal-PII retention by design, so sensitive content never sits in places it doesn't need to
Full audit logging on every action across every module
Two-factor authentication on every account
Fine-grained, least-privilege access control, enforced server-side
0
Critical 路 high 路 medium findings at final penetration test
Engineering Discipline
Ship fast without breaking what's live
A healthcare platform doesn't get to have a bad deploy day. So every change moves through the same disciplined path before it reaches real patients.
Dev
Feature branches, automated tests and linting on every commit.
QA
Merged, built, and deployed automatically for structured testing.
UAT
A production-mirror environment for final client sign-off.
Production
Tagged release, zero-downtime rollout, fully traceable.
Traceable
Every deployment is tied to an immutable commit, so any build in any environment can be traced back to the exact code that produced it.
Efficient
An intelligent build pipeline rebuilds only the microservices that actually changed, not the whole platform.
Codified
Infrastructure is defined entirely as code, so environments are reproducible rather than hand-configured.
Scanned
Automated container vulnerability scanning runs on every single build, before it's ever eligible for deployment.
FAQ's
Frequently Asked Questions
The platform was built with React, Next.js, and NestJS (TypeScript) across frontend and backend, MongoDB and Redis for data, the Polygon blockchain for on-chain consent and payments, and deployed on Kubernetes and Google Cloud behind CloudFlare CDN.
Medical data is encrypted at rest and in transit and sealed with each patient's own wallet key, so the platform never holds a standing readable copy. Access is protected by two-factor authentication and fine-grained, least-privilege access control enforced server-side.
The final penetration test found zero critical, high, or medium severity issues. Only 7 low-severity findings were identified, and all were resolved before handover.
Five connected modules (Patient, Pharmaceutical, Clinic, Pharmacy, and a Consent & Ledger layer) plus a Super Admin control layer, all unified on one blockchain-secured architecture.
Code Encoders shipped a working MVP first, covering patient onboarding and pharmaceutical data access, then expanded the platform across three further phases covering identity verification, security hardening, and scale, roughly doubling in scope without breaking the delivery rhythm.
A NestJS and TypeScript microservices architecture with a dedicated API Gateway and independent services for Patient, Clinic, Pharmacy, Pharmaceutical, Payments, and Notification, deployed on private Kubernetes clusters with Prometheus, Grafana, and Loki for observability, and Terraform with GitOps (ArgoCD) for infrastructure as code.
The Outcome
What five modules, one blockchain, and no shortcuts got them
On time
MVP delivered on schedule, demo-ready for investors within months
~2脳
Scope growth absorbed without breaking the delivery rhythm
0
Critical, high, or medium findings at final penetration test
100%
UAT completion, fully production-ready at handover
5
Modules unified on one blockchain-secured architecture
Ready to Transform Your Business?
Let's discuss your project and explore how we can help you achieve your goals. Get started with a free consultation today.