Skip to main content

Application Architecture

Zynomi is a comprehensive clinical trial platform with a modern architecture spanning user applications, REST APIs, and an analytics lakehouse with AI integration.


Platform Overview

Platform Architecture - Zynomi Clinical Trials

The platform consists of three main pillars:

PillarComponents
ApplicationsCTMS Web Portal, Sublink Mobile App
REST API100+ endpoints for integrations
Analytics LakehouseData pipeline, transformation, semantic layer, AI agents

End-to-End Architecture

End-to-End Data Flow - From Transactional to Analytics


Applications

CTMS (Web)

The Clinical Trial Management System web portal for study designers, coordinators, and investigators.

CapabilityDescription
Study DesignProtocol configuration but management
Site ManagementMulti-site setup with personnel
Subject EnrollmentRegistration and tracking
eCRF Data CaptureReal-time form completion
Adverse EventsSafety monitoring and reporting

Patient-facing mobile application for trial participants built with Ionic and native iOS/Android shells.

CapabilityDescription
Medication RemindersPush notifications for doses
Health TrackingVitals and symptom logging
ePRO CollectionPatient-reported outcomes
Visit NotificationsAppointment reminders

Backend and REST API

Frappe Health / ERPNext

Core backend platform providing 100+ REST API endpoints.

CapabilityDescription
Patient ManagementDemographics, history, records
Study ConfigurationProtocols, sites, personnel
eCRF BuilderForm design and data capture
PrescriptionsMedications, vitals, lab results

Supporting Services

ServicePurpose
Supabase (PostgreSQL)Real-time database, authentication
Object Store (S3)Document and file storage
Redis (Upstash)Caching and session management
KrakenDAPI gateway, unified endpoint

Infrastructure

ComponentProvider
DNS/IngressAWS Route 53, Cloudflare
HostingVercel, Frappe Cloud, Fly.io
TelemetryLogs, Traces, Metrics

Analytics Lakehouse

Out-of-the-box analytics infrastructure powered by modern data stack.

Data Ingestion (dlthub)

Python-based data loading toolkit extracting from Frappe REST APIs.

FeatureDescription
Sync ModesFull and incremental
SchemaAuto-detection and evolution
ReliabilityRetry logic with backoff
DestinationsPostgreSQL, MotherDuck, DuckDB

Transformation (dbt)

SQL-based transformation following the Medallion Architecture. Uses OSS Core edition; dbt Cloud available for enterprise scaling.

LayerPurpose
Raw1:1 copy from source with audit trail
StagingCleaned and validated data
IntermediateBusiness logic and enrichment
MartStar schema (Dimensions + Facts)

Includes data quality tests, documentation, and lineage tracking.

Semantic Layer (Cube.dev)

Unified metrics layer for consistent analytics. Uses OSS edition deployed on Fly.io; Cube Cloud available for enterprise scaling.

FeatureDescription
Measures and DimensionsPre-defined metric definitions
Pre-aggregationsPerformance optimization
APIsREST API and SQL API access
BI IntegrationLooker, Metabase, Tableau, PowerBI

AI Agents (MCP)

Model Context Protocol server enabling AI assistants to query clinical data with zero hallucination.

ComponentDescription
MCP ServerCustom-built server exposing Semantic Layer as MCP tools
MCP-REST BridgeConfigurable LLM gateway (default: GPT-4.0 Mini)
AI Agent / ChatbotCustom-built conversational interface
Custom Implementation

The MCP Server and AI Agent are custom-built solutions adhering to Cube.dev API/SDK standards. This approach provides flexibility with any LLM provider while avoiding enterprise-only dependencies.

ConsumerCapability
ClaudeNatural language queries via MCP
GitHub CopilotCode-aware data exploration
CursorEmbedded analytics assistance
Embedded ChatbotIn-app conversational analytics

Technology Stack

Zynomi is built on a modern, widely-adopted technology stack. The architecture is loosely coupled and plugin-based, enabling horizontal scaling and rapid feature development.

Languages and Frameworks

CategoryTechnologiesCoverage
PrimaryTypeScript, JavaScript70% of codebase
BackendPython, SQLData pipelines, analytics
ScriptingShell/BashAutomation
FrontendReact, Next.js 14Web application
MobileReact NativeMobile app
StylingTailwind CSS, shadcn/uiComponents

Platform Components

LayerTechnologies
Web ApplicationNext.js 14, TypeScript, React
Mobile ApplicationReact Native
BackendFrappe Health, ERPNext, Python
DatabasePostgreSQL (Supabase), MariaDB
Data LakePostgreSQL (swappable to Snowflake, Iceberg, Databricks)
CachingRedis (Upstash)
StorageS3-compatible Object Store
API GatewayKrakenD
Data Ingestiondlthub (Python)
Transformationdbt (OSS Core)
Semantic LayerCube.dev (OSS)
MCP ServerCustom Node.js
AI AgentCustom microfrontend widget
LLMGPT-4.0 Mini (configurable)
InfrastructureVercel, Frappe Cloud, Fly.io
ContainerizationDocker

Architecture Principles

PrincipleDescription
Loosely CoupledComponents are independent and replaceable
Plugin-BasedFeatures added without modifying core
Horizontal ScalingNew capabilities added alongside existing
MicrofrontendAI Chatbot installs as standalone widget

Security and Compliance

CapabilityDescription
Audit TrailComplete activity logging
Data at RestEncrypted storage
Data in TransitTLS 1.3 encryption
HIPAAHealthcare compliance
GDPRData privacy compliance