FULL 2D MODULE ARCHITECTURE & DATA FLOW

System Architecture

Interactive 2D schematic mapping of data flow between client modules, OpenAPI schemas, server nodes, and the caregiver web platform.

Topology of the Platform

All Platform ModulesOptional Data Flow Animation

Select a module to inspect.Live Route: ☁️ Option A (Managed Cloud)

Local EngineOpenAPI 3.0 Spec
PATIENT CLIENT APPLICATION LAYER100% Offline Core
Patient Application

Android Client

Kotlin & Compose

Jetpack Compose UI & Background Alarm Services

Database: Room SQLite
Scheduler: AlarmManager
Time Selector: 12-Hour Grid

iOS Client

Coming SoonSwift & SwiftUI

SwiftUI App & UserNotifications Native Engine

Database: SwiftData
Scheduler: UserNotifications
Export: JSON Archive
Encrypted Data Sync Payload (OpenAPI Contract)
📜 SHARED OPENAPI 3.0 CONTRACT LAYERCommon Schema
Spec: api/openapi.yaml

Canonical schema definition dictating platform-wide zero lock-in contract standards.

MedicationID, Dose, Color
ScheduleInterval, Times
DoseEventTaken/Missed
ConsentE2EE Tokens
Active Flow Route: ☁️ Option A — Managed Cloud (api.dosezy.app)
SERVER NODE INFRASTRUCTURE LAYERManaged Cloud or Self-Hosted Node
Server Node
☁️

Option A: Managed Cloud Node

api.dosezy.app

Fully managed cloud instance for zero-maintenance family sharing & push alerts.

Multi-Tenant PostgreSQL
Push Notification Engine
SMS / Email Alert Queue
E2EE Key Exchange
— EITHER / OR —
🏡

Option B: Self-Hosted Server Node

Docker Compose

Self-host on private hardware or Homelab. Complete data sovereignty.

PostgreSQL Engine
REST API Service
WebSocket Gateway
Zero External Callbacks
Patient-Authorized Caregiver Adherence Event Stream
CAREGIVER WEB PLATFORMCloud or Self-Hosted Web App
Caregiver Portal
🌐

Option A: Cloud Caregiver Portal

app.dosezy.com
📊
Multi-Patient Dashboard

Adherence heatmaps and compliance timelines.

💻
Emergency Push Dispatch

High-priority push notifications & SMS alerts.

🔑
Patient Revocation Keys

100% patient control over access encryption keys.

— EITHER / OR —
🏡

Option B: Self-Hosted Caregiver Web

Docker / Localhost
🖥️
Private Homelab Dashboard

Hosts on local network with 0% external cloud tracking.

Direct WebSocket Stream

Zero-latency local network socket events.

🛡️
Offline Key Verification

Local public key validation without external servers.

Key Features

1

Local-First Architecture

All core functions (alarms, tracking, PDF reports, emergency dialer) operate strictly within local Room/SwiftData databases on-device with 0% network dependency.

2

Contract-Driven Schemas

The shared api/openapi.yaml defines canonical data contracts, ensuring complete compatibility across Android, iOS, Server, and Caregiver web apps.

3

Server Node Agnostic

Patients can seamlessly connect to either a self-hosted community server node or the official managed cloud platform without locking in data.