Next.js 16 · Cloudflare Workers · D1 SQLitePhD, Bekhterev Institute, 2015

RDD — Depressive Disorders Registry

Specialized clinical web registry for longitudinal research on late-life depression. A showcase of Senior/Architect-level developer skills in building medical applications.

Built at the intersection of medicine and IT, and grounded in the author’s real 6-year clinical study.

Who the system serves and what task it solves

For clinicians and researchers

  • Automates depression research
  • Analyses every phase of the illness
  • Connects history, mental status, treatment and outcomes
  • Computes cohort statistics instantly
  • Supports data export in several formats

For hiring managers and tech leads

  • Demonstrates medical application engineering skills
  • Shows a deliberate, uncompromised architecture
  • Single source of truth for the whole application
  • Automatic synchronization of DB, validation and UI layers
  • Zero cold start on serverless infrastructure

Registry capabilities

Patient passport and history

Interface for filling in the socio-demographic profile. Includes anonymized personal data and study-consent management. Some values are computed automatically — for example, the age at disease onset.

Disease-phase matrix

A convenient interface for capturing the disease history. It is a matrix of depressive phases where the clinician, while interviewing the patient, can record symptoms across several episodes at once. It also tracks the state dynamics in the current phase.

Analytics and export

Automatic computation of the key cohort metrics, presented in a clear visual form. Data export in several formats (Excel, CSV, JSON) for statistical analysis.

Glossary of terms

A live glossary formed directly from the single field registry: clinicians see the clinical meaning of each sign, while engineers see types, validators and DB columns.

Key engineering decisions

Registry-Driven Core (SSOT)

A single declarative TS field registry generates the Cloudflare D1 (SQLite) schema, Zod validation schemas, UI input fields and the Data Dictionary. The “field = column” invariant rules out layer desynchronization.

This approach speeds up development and reduces the number of errors: adding a new sign to the registry automatically updates every layer, including the DB migration, validation and UI.

Registry-Driven Core (SSOT)

Virtualized grid with CAS

TanStack Virtual + CSS Grid with sticky columns. Optimistic field locking (Compare-And-Swap).

The interface stays fast even with large amounts of data, validates entered values automatically, supports several clinicians working together, and protects against data loss during concurrent editing of the same patient.

Virtualized grid with CAS

Serverless Edge stack and security

Next.js 16 on Cloudflare Workers + D1. Web Crypto cryptography, sessions in HttpOnly cookies, Row-Level Access and a hash-chain log for auditing mutations.

The application starts instantly, with no heavy dependencies and low running cost even on large datasets. It runs on serverless infrastructure, which simplifies scaling, and all data is protected.

Serverless Edge stack and security

Demo boundaries and scope

Populated with synthetic clinical records (zero real PII). Regulatory compliance (HIPAA / GDPR), edge WAF protection against L7 floods, and automated D1 point-in-time recovery are documented as production escalation milestones.