back to projects

Fed-Research

Full-StackFastAPINext.jsMongoDBFederated HealthGovernanceKeycloakin progress2025

Fed-Research is a full-stack governance platform for the EU GREG community, providing a control plane for federated observational health studies built on the OHDSI/OMOP Common Data Model. It coordinates the full study lifecycle, from invitations and approvals through package distribution, execution tracking, result review, and auditability, while structurally guaranteeing that raw patient data never leaves a participating institution.

The system comprises an asynchronous FastAPI and MongoDB backend coordinating study lifecycle and governance, a Next.js, TypeScript, and React frontend with role-specific views for researchers, site administrators, and platform administrators, and a standalone Python agent deployed on-premises at each participating institution. The per-site study lifecycle is implemented as an explicit state machine with eleven states spanning invitation, package distribution, execution, review, and completion, enforcing valid governance transitions at the API level and aggregating per-site statuses into an overall study status. An append-only audit log captures every lifecycle transition with actor, timestamp, and per-site response-time metrics, retrievable in a single document read.

The most significant component is the autonomous site execution agent. Each site runs a long-lived polling process that handles the entire package-execution lifecycle without human intervention: it polls the platform for studies awaiting execution, downloads the analysis package via a signed, time-limited URL, runs it as a subprocess (the package can be any Python, R, or shell script that produces a result archive), and reports completion back to the platform. The agent maintains local filesystem state so that a restart resumes exactly where it left off without re-executing completed work, and sends periodic heartbeats so the platform can track site availability. A separate execution mode allows sites without a deployed agent to upload results manually through the UI instead. Included example packages demonstrate analyses against both synthetic and live OHDSI OMOP CDM data, querying conditions such as diabetes and hypertension while keeping all raw data local to the site.

Secure file distribution uses S3-compatible object storage (MinIO) with HMAC-signed, short-lived download tokens, decoupling structured metadata from binary payloads so that study packages and result archives are never directly exposed. The platform integrates with Keycloak for authentication and role-based access control, including an OIDC hook for injecting custom role claims during token issuance, and with Dante, an external institutional registry, to automatically discover and onboard research sites by syncing site metadata and ownership information. The full stack is containerized with Docker Compose and Nginx, with environment-specific overlays supporting standalone, development, and Portal-integrated deployments.

  • ·Designed the system architecture: an asynchronous FastAPI/MongoDB backend, a Next.js/TypeScript/React frontend with role-specific views, and a standalone Python agent for on-premises execution at data institutions
  • ·Built an autonomous site execution agent with crash recovery that polls for studies, executes analysis packages, and reports results without human intervention
  • ·Implemented an 11-state per-site study lifecycle as an explicit state machine with append-only audit logging and per-site response-time metrics
  • ·Implemented secure file distribution with S3-compatible object storage (MinIO) and HMAC-signed download tokens, and integrated Keycloak SSO/RBAC with automated site discovery via Dante

Backend

PythonFastAPIMongoDBMotor

Frontend

Next.jsTypeScriptReact

Infrastructure

DockerNginxMinIOKeycloak

Domain

OHDSI/OMOPREST APIDistributed Systems