Wellness Platform

A comprehensive wellness web application for a UK startup featuring blogs powered by Strapi CMS, podcasts, webinars with Mux video streaming, and Stripe integrations for subscriptions and store purchases.

Brief icon

Brief

Motivation

Built a comprehensive wellness platform for a UK startup that needed a scalable solution for content delivery, subscriptions, and e-commerce. The platform combines multiple content types (blogs, podcasts, webinars) with subscription management and a store, requiring seamless integration of various third-party services.

Challenges

  • Integrating Prisma ORM with Turso DB (LibSQL) faced significant compatibility issues
  • Building a scalable blogging system that could handle content management efficiently
  • Implementing video streaming for webinars with proper playback and management
  • Creating a unified payment system for both subscriptions and one-time store purchases
  • Managing complex user access control across different content types and subscription tiers

Solutions

  • Migrated from Prisma to Drizzle ORM which had native support for Turso DB, resolving integration issues
  • Integrated Strapi as a headless CMS for blogs, providing a customizable content management experience
  • Implemented Mux for video streaming, handling video uploads, processing, and playback for webinars
  • Built a unified Stripe integration supporting both subscription billing and store checkout flows
  • Designed a flexible access control system that manages user permissions based on subscription status and product purchases

Impact

FiftyFirst Wellness provides a complete wellness platform that seamlessly combines content delivery, subscription management, and e-commerce. The migration to Drizzle ORM enabled reliable database operations with Turso, while Strapi integration offers scalable content management. The platform is currently in testing phase with core features operational.

Architecture icon

Architecture

System Overview

The platform follows a modern full-stack architecture with NestJS backend, React frontend, and multiple integrated services. Turso DB (LibSQL) provides distributed database capabilities, Strapi serves as the headless CMS for blogs, Mux handles video streaming, and Stripe manages all payment operations.

System Flow

Users browse content (blogs from Strapi, podcasts, webinars from Mux) → subscribe or purchase via Stripe → access granted based on subscription/product ownership → content delivered with proper access control. Admin manages content through Strapi CMS and product catalog through the platform.

Technology Choices

Backend

NestJSNestJS

Modular architecture with dependency injection, perfect for managing multiple integrated services and complex business logic

REST APIREST API

RESTful API design for predictable integration with Strapi CMS, Mux, and Stripe services

Frontend

ReactReact

Modern React 19 with hooks and context for managing complex state across content types and user sessions

TypeScriptTypeScript

Type safety essential for payment processing, subscription management, and content type handling

Tailwind CSSTailwind CSS

Rapid development and consistent styling for a content-rich wellness platform

Database

Turso

Distributed SQLite database providing edge-computing capabilities and low latency for global users

DrizzleDrizzle

Native support for Turso DB with type-safe queries and migrations, solving Prisma compatibility issues

CMS

Strapi

Headless CMS providing flexible content management for blogs with customizable content types and media handling

Video

Mux

Professional video streaming platform handling upload, processing, and adaptive playback for webinars

Payments

Stripe

Comprehensive payment processing for both subscription billing and one-time store purchases with webhook support

Deployment

Vercel

Seamless frontend deployment with automatic scaling and CI/CD integration

Railway

Backend hosting with easy database integration and environment management

Tools

Cloudinary

Media storage and optimization for product images and content assets

Brevo

Email service for transactional emails including order confirmations and subscription notifications

Key Features

  • Blog system powered by Strapi headless CMS
  • Podcast library with episode management
  • Webinar platform with Mux video streaming
  • Stripe subscription management for recurring billing
  • E-commerce store with one-time purchases
  • Role-based access control for content and features
  • User dashboard for subscriptions and orders
  • Admin management interface for content and products
UML Diagram icon

UML Diagram

System Architecture

System architecture showing the integration between NestJS backend, React frontend, Strapi CMS, Mux video streaming, Stripe payments, and Turso database. The diagram illustrates the flow of content delivery, subscription management, and e-commerce operations.

FiftyFirst Wellness UML Diagram

Complete system architecture and data flow diagram

Flow Explanation

User requests flow through React frontend → NestJS API processes business logic → Content fetched from Strapi CMS (blogs) or Mux (webinars) → Payment processing via Stripe → Access control verified against Turso database → Content delivered based on subscription/product ownership.

System Components

  • React Frontend (Vite)
  • NestJS Backend API
  • Strapi CMS (Blog Content)
  • Mux (Video Streaming)
  • Stripe (Payment Processing)
  • Turso DB (Drizzle ORM)
  • Cloudinary (Media Storage)
  • Brevo (Email Service)
Database Design icon

Database Design

Database Overview

The database uses Turso (LibSQL) for distributed edge computing with Drizzle ORM. Schema supports users, subscriptions, products, orders, payments, and content access tracking.

FiftyFirst Wellness Database Schema

Schema includes tables for users, subscriptions, subscription plans, products (store/programme/podcast), orders, payments, reviews, bookmarks, and delivery addresses. Relationships support complex access control and subscription management.

Design Decisions

  • Migrated from Prisma to Drizzle ORM for native Turso DB support
  • Normalized schema for users, products, and orders with clear relationships
  • Separate tables for subscription plans and active subscriptions
  • Flexible product types (STORE, PROGRAMME, PODCAST) with unified catalog
  • Payment tracking with support for multiple providers (Stripe, PayPal)
  • Review system with moderation status for content quality control

Database Tables

users

User accounts with authentication, profiles, and role management

subscription_plans

Subscription plan definitions with pricing, duration, and access levels

subscriptions

Active user subscriptions linked to plans with start/end dates and status

products

Unified product catalog supporting store items, programmes, and podcasts

orders

Order records for store purchases with delivery address and status tracking

payments

Payment records for both subscriptions and store purchases with provider integration

reviews

Product reviews with moderation status and rating system

bookmarks

User bookmarks for saved content and products

Challenges & Solutions icon

Challenges & Solutions

Challenge Overview

Building a comprehensive wellness platform required solving complex integration challenges, database compatibility issues, and creating scalable content management solutions.

1

Prisma to Drizzle ORM Migration

Faced significant issues integrating Prisma ORM with Turso DB (LibSQL), as Prisma lacked native support for LibSQL driver, causing connection and query failures.

2

Scalable Blogging System

Needed a blogging system that could scale with content growth, support rich media, and provide a flexible content management experience without building a custom CMS.

3

Video Streaming for Webinars

Implementing reliable video streaming for webinars with proper upload, processing, playback, and access control.

4

Unified Payment System

Creating a payment system that handles both recurring subscriptions and one-time store purchases with proper webhook handling and order management.

Key Learnings

These challenges required deep understanding of database systems, content management architectures, video streaming, and payment processing. The solutions implemented provide a robust, scalable foundation for a comprehensive wellness platform.