Skip to content

MindMate — Digital Therapy Platform for Internet Gaming Disorder

Four years on a digital therapeutic platform for children diagnosed with Internet Gaming Disorder at BIH @ Charité — 34 CBT-based tasks, gamified engagement, encrypted patient data and bilingual therapy content.

2020 – 2024
Django 5.1 Django REST Framework Wagtail 6 React 18 TypeScript Vite Celery PostgreSQL Redis LinguiJS TanStack React Query Docker

Challenge

BIH @ Charité needed a digital therapeutic platform for children diagnosed with Internet Gaming Disorder. I was the developer on it from the start in 2020 and stayed with the project for four years, through several reworks as the clinical picture sharpened and the product changed course more than once.

By the final iteration the requirements had outgrown what the earlier architecture could carry: 34 structured therapeutic tasks drawn from cognitive behavioural therapy, engagement mechanics strong enough to keep children returning daily, bilingual therapy content maintained by non-developers, and data protection appropriate to storing minors' personal information. So the last stage was a complete rebuild — replacing a Django 3 and Next.js 11 stack I had built earlier with something designed for what the product had become.

Approach

The backend is Django 5.1 with Django REST Framework, using Wagtail 6 as a headless CMS so clinicians and researchers could own the therapeutic content without touching code. Celery with Redis handles scheduled work, and PostgreSQL stores everything. The frontend is a React 18 SPA built with Vite, using TanStack React Query for data fetching and Lingui for interface translation.

The decisive design decision — informed by having already watched the product change direction twice — was treating therapy content as CMS data rather than code. Every therapeutic screen is composed from custom StreamField blocks, so new interventions could be authored and translated without a deployment. The next change of course would not require another rebuild.

Implementation

The task system. All 34 interventions derive from an abstract Task base model with a RewardableAction mixin, covering cognitive restructuring (ABC schemas, thought reframing), exposure work (desire tracking), behavioural activation, mindfulness, sleep hygiene and parent engagement. Fourteen supporting models handle feelings, situations, thoughts and activities. Each task exposes its own REST endpoint and serializer generated from consistent patterns — 34 clinical models without 34 hand-written implementations.

Gamification. Points are awarded through Django signals rather than being computed at read time, with streak tracking, a Celery Beat job running a midnight UTC reset so streaks resolve consistently regardless of the child's timezone, and a seven-day achievement bonus.

Video therapy content. Videos are managed editorially through Wagtail, served to the decoupled React client as JSON via custom chooser blocks. I wrote Range-request middleware with chunked responses so video seeks and streams properly. On the client, an accessible player deliberately disables scrubbing — progression through a therapy level is gated on the video actually ending, not on the child skipping to the end.

Protecting children's data. Personal fields — name, email, parent email — are encrypted at the database level with AES field encryption, replacing an external PII storage service while keeping the data usable through the Django ORM. Administrative access is protected with TOTP two-factor authentication.

Bilingual throughout. Wagtail Localize manages translation of CMS-authored therapy content; Lingui with its SWC plugin handles interface strings, including the video player controls.

Result

The platform covered the full therapeutic workflow — diaries, week plans, therapy modules and gamified progress — as a modern, maintainable system a single developer could evolve. It ran with a complete pytest and Vitest suite, GitHub Actions CI, and a Docker Compose stack spanning Django, the React frontend, PostgreSQL, Redis and both Celery worker and beat processes.

Staying with one project across four years and several changes of direction taught me more about architecting for change than any single build would have. Working directly with a business lead, I participated in user interviews and iterated the UX against feedback from clinicians and test users, so the technical decisions stayed tied to what the children and their therapists actually needed. Funding for the programme was later discontinued and the platform was not carried forward.

Highlights

  • Four years on one project, through several changes of direction
  • 34 CBT task models from a shared abstract hierarchy
  • Signal-based gamification with timezone-safe streaks
  • CMS-managed video with completion-gated progression
  • AES field-level encryption for children's personal data
  • Bilingual therapy content via Wagtail Localize and Lingui