Structured Content Platform & Publishing Pipeline
Swing Therapeutics · Lead Software Engineer / Primary Contributor
Swing Therapeutics | CMS Engineering / Content Infrastructure
Designed and maintained a Sanity-based content platform and TypeScript publishing pipeline that enabled teams to author, validate, localize, migrate, and publish structured digital-health content into Firebase-backed mobile applications.
Overview
The platform provided a structured authoring environment for a digital-health mobile application. Editors managed hierarchical program content across development, QA, staging, and production workspaces using a shared Sanity Studio codebase. The content model supported English and Spanish, reusable content components, audio-enabled experiences, and custom editorial tooling. A separate TypeScript publishing pipeline extracted content from Sanity, transformed it into application-ready documents, migrated selected media assets, validated output, and published it into Firebase.
My Contribution
- Architected and maintained a multi-workspace Sanity Studio v3 platform with a structured content hierarchy spanning 30+ document types
- Implemented bilingual English and Spanish content modeling using document-level internationalization
- Built custom Studio tooling for inline audio preview, translation assistance, content search and replacement, and audio-production workflows
- Developed safe TypeScript migration utilities for cloning, deleting, searching, replacing, backing up, and synchronizing connected content trees
- Designed a Sanity-to-Firebase publishing pipeline with pure transformation layers, Zod validation, deterministic identifiers, batched Firestore upserts, dry-run support, and media migration
- Configured automated Sanity Studio deployment and isolated environment workflows using GitHub Actions and separate datasets
Content Platform Architecture
- One shared TypeScript Sanity Studio codebase across four managed workspaces: development, QA, staging, and production
- Structured hierarchical documents for programs, playlists, sessions, lessons, activities, journals, and reusable input components
- English and Spanish document-level localization with linked translation documents
- Custom desk structure that keeps low-level input types out of top-level navigation
- GROQ for content queries and relationship traversal
- Sanity transactions for safe bulk operations
- Sanity-hosted Studio deployment
Custom Editorial Tooling
- Audio tooling: inline preview, asset URL resolution, audio-production workflow integration, configurable voice metadata, and Portable Text-to-speech preparation
- Translation assistance: admin-restricted helper for English and Spanish document workflows
- Content operations: custom in-Studio find and replace, dry-run migration scripts, atomic deep clone, safe delete with reference checking and confirmation, plus dataset backup and synchronization
Sanity-to-Firebase Publishing Pipeline
- Sanity CMS authoring and export
- Resolve content relationships and references
- Transform CMS documents into mobile application shapes
- Normalize identifiers, timestamps, media paths, and rich text
- Validate output with Zod
- Migrate selected audio assets to Firebase Storage
- Publish documents to Cloud Firestore with merge-based batched upserts
- Operator dry runs and repeatable re-execution
Publishing Pipeline Details
- Primary supported approach: full snapshot synchronization from Sanity to Cloud Firestore and Firebase Storage
- Partial incremental update scaffolding exists for selected content types; major structural changes require a full sync
- Continuous hosted execution is not claimed by this portfolio — operators drive publishing with dry-run and re-run support
Sync Reliability
- Deterministic identifiers and stable ID mapping across cloned content
- Batched Firestore writes kept below platform limits
- Merge-based idempotent upserts and skip-existing media uploads
- Pure transformation functions separated from I/O
- Zod schema validation, dry-run modes, and offline snapshot processing
- Vitest coverage for transformation behavior
- Future improvements: deletion reconciliation, richer retry policies, CI for the syncer, and stronger observability
Engineering Challenges
- Modeling a large interconnected content graph while keeping the editorial interface usable
- Maintaining stable runtime identifiers when CMS content was cloned or reorganized
- Transforming CMS-oriented schemas into application-specific Firestore documents
- Supporting bilingual content and linked translation documents
- Migrating and remapping media assets across storage systems while preventing schema and migration-script drift
Reliability, Privacy, and Security Considerations
Editorial and publishing systems for digital-health content require careful environment isolation, validation before publish, and conservative public documentation. This portfolio omits project IDs, dataset names, media identifiers, clinical content, and private screenshots.
Engineering Outcomes
- Established a structured source of truth for application content
- Reduced reliance on direct manual editing of runtime Firestore documents
- Created repeatable publishing and migration workflows
- Improved editorial safety through validation, dry runs, and atomic operations
- Enabled isolated content work across multiple environments
- Separated editorial authoring models from application runtime schemas
- Supported consistent bilingual content management
Relationship to Other Projects
- This project owns content authoring and publishing infrastructure
- The Healthcare Mobile Application consumes the published Firebase content and focuses on React Native, Expo, authentication, state, notifications, and release delivery
- Distinct from the Healthcare Data & ETL Platform, which handles batch operational data, Python transforms, and a MySQL analytical warehouse across serverless and container runtimes
Technologies
- Sanity Studio v3, Sanity Client, GROQ, Portable Text, document internationalization, Sanity transactions
- React, TypeScript, Node.js, Zod, Vitest, Express, Makefile / CLI tooling
- Firebase Admin, Cloud Firestore, Firebase Storage
- ElevenLabs for audio-production workflow integration
- GitHub Actions for Studio deployment and isolated environment workflows