How developer-yash04/aarogyan works
Aarogyan is a role-based clinical-trial matching product: patients can import FHIR health records and use a privacy-preserving proof workflow, while hospitals, researchers, and inspectors have separate workspaces. The current router and authentication flow are visible, as are the EHR parser, server authentication/trial/credential routes, and proof worker. The excerpts do not establish how the worker or contract deployment is invoked, nor all dashboard-to-backend calls, so those links are omitted.
Main entry points: WalletConnect.tsx Wallet sign-in · App.tsx Role router · PatientDashboard.tsx Patient workspace · HospitalDashboard.tsx Hospital workspace
Components 20
Web application
- Role router
web/src/App.tsx - Auth context
web/src/hooks/useAuth.tsx - Wallet sign-in
web/src/components/auth/WalletConnect.tsx - Patient workspace
web/src/pages/PatientDashboard.tsx - Hospital workspace
web/src/pages/HospitalDashboard.tsx - Research workspace
web/src/pages/ResearcherDashboard.tsx - Inspector workspace
web/src/pages/InspectorDashboard.tsx
Clinical workflow
- Hospital portal
web/src/components/HospitalPortal.tsx - EHR importer
web/src/components/EHRImporter.tsx - FHIR parser
web/src/utils/fhirParser.ts - Clinical data types
web/src/types/aarogyan.ts
Identity and services
- API routes
server/index.ts - Data models
server/db.js - SQLite database
server/db.js
Proof and blockchain
- ZK proof worker
web/src/workers/zkProofWorker.ts - Contract interface
web/src/contracts/aarogyanAbi.ts - On-chain inspector
web/src/components/OnChainInspector.tsx - Aarogyan contract module
contracts/ignition/modules/AarogyanModule.ts
Other components
- Portal user
- Ethereum wallet and chain
Connections 26
- Portal user → Role router: opens portal
web/src/App.tsx - Role router → Patient workspace: routes to
web/src/App.tsx - Role router → Hospital workspace: routes to
web/src/App.tsx - Role router → Research workspace: routes to
web/src/App.tsx - Role router → Inspector workspace: routes to
web/src/App.tsx - Role router → Auth context: provides context
web/src/App.tsx - Patient workspace → Wallet sign-in: prompts sign-in
web/src/pages/PatientDashboard.tsx - Hospital workspace → Wallet sign-in: prompts sign-in
web/src/pages/HospitalDashboard.tsx - Research workspace → Wallet sign-in: prompts sign-in
web/src/pages/ResearcherDashboard.tsx - Inspector workspace → Wallet sign-in: prompts sign-in
web/src/pages/InspectorDashboard.tsx - Wallet sign-in → Ethereum wallet and chain: requests signature
web/src/components/auth/WalletConnect.tsx - Wallet sign-in → API routes: requests nonce
web/src/components/auth/WalletConnect.tsx - Wallet sign-in → Auth context: submits login
web/src/components/auth/WalletConnect.tsx - Auth context → API routes: verifies session
web/src/hooks/useAuth.tsx - API routes → Data models: queries models
server/index.ts - Data models → SQLite database: stores records
server/db.js - Patient workspace → EHR importer: opens importer
- EHR importer → FHIR parser: parses bundle
web/src/components/EHRImporter.tsx - EHR importer → Patient workspace: returns parsed data
- Hospital workspace → Hospital portal: hosts portal
- Hospital portal → Clinical data types: uses clinical types
web/src/components/HospitalPortal.tsx - FHIR parser → Clinical data types: produces patient data
- ZK proof worker → Ethereum wallet and chain: prepares proof for submission
- On-chain inspector → Contract interface: uses interface
web/src/components/OnChainInspector.tsx - On-chain inspector → Ethereum wallet and chain: queries chain
- Aarogyan contract module → Ethereum wallet and chain: deploys to