Skip to content
All work

Telehealth Psychiatry Platform

Zentromind Health

Production telehealth platform for a psychiatry practice, with patient, doctor and admin portals for secure booking, video consultations and clinical documentation.

Overview

What the product does

A production telehealth platform serving a psychiatry practice. Patients book and attend appointments, doctors run consultations and record clinical documentation, and admins oversee the practice — each in its own portal, backed by a single versioned API.

Problem

The problem it solves

Remote psychiatry care needs booking, video consultations, payments and clinical documentation to behave as one system rather than four disconnected tools — while keeping clinical data protected and strictly scoped to the role viewing it.

My role

What I contributed

Full-stack development across the versioned REST API, payment flows, authentication, background jobs and the video consultation experience.

Solution

How the system was designed

A Next.js frontend sits on a versioned REST API built with Express on Bun, organised into 29 feature modules that follow a routes, handlers, services and validators pattern over PostgreSQL and Prisma. Stripe Connect handles checkout and provider payouts, Agora powers consultations, and Redis-backed BullMQ queues run the scheduled work.

Architecture

System architecture

ClientApplicationServicesDataExternalHTTPSRESTVerifyEnqueueQueriesQueueWebhooksTokensClientPatient · Doctor · AdminNext.jsPortal UIREST APIExpress on BunBetter AuthSessions · 2FA · RBACBullMQReminders · No-showsPostgreSQLPrisma ORMRedisQueues · CacheStripe ConnectCheckout · PayoutsAgora RTCVideo consultations

Key features

What it does in practice

Versioned REST API

29 feature modules following a consistent routes, handlers, services and validators pattern, backed by PostgreSQL through Prisma.

Challenges

The interesting engineering problems

  • Protecting clinical data
    Problem
    Clinical information needed protection at the record level, not just at the database boundary.
    Approach
    Added AES-256-GCM field-level encryption for clinical data, so sensitive fields stay encrypted independently of database access.
  • Keeping payment state consistent
    Problem
    Checkout, the platform fee and refunds all move through Stripe, so the application's view of a payment can drift from Stripe's.
    Approach
    Drove payment and refund state from Stripe webhooks rather than client responses, keeping the platform's records aligned with the payment provider.

Technology

The stack behind it

  • Next.jsReact Framework
  • Express.jsHTTP Framework
  • BunRuntime & Package Manager
  • PostgreSQLRelational Database
  • Prisma ORMType-Safe ORM
  • RedisCache & Queues
  • Socket.ioRealtime Transport
  • Agora RTCRealtime Audio & Video
  • StripePayments
  • Better AuthAuthentication
  • BullMQBackground Jobs
  • CloudinaryMedia Storage