The big idea
Most wellness apps pick one lane: a meditation player, a mood tracker, or a therapy marketplace. The compromise is the user — they end up stitching three apps together and losing context exactly when they need it most. ClearedMind is built around the opposite bet: one surface for the whole loop, where today's mood entry, last week's assessment score, and tomorrow's therapy session all share the same data model and the same UI grammar.
Architecture: a native-web hybrid that doesn't lie to either platform
The app is engineered as a native-web hybrid with a strict separation between platform-aware and platform-agnostic code.
NativeProviderat the root wraps the entire React tree and bootstraps Capacitor plugins (status bar, splash, haptics, keyboard, push notifications, local notifications, voice recorder). On web, it short-circuits to no-ops so the same components render without conditional spaghetti downstream.- Capability hooks, not capability checks —
useHaptics,useStatusBar,useKeyboard, etc. encapsulateCapacitor.isNativePlatform()so feature code never branches on platform. - Feature-folder structure —
src/components/{home,journey,mindful,profile,onboarding,layout,native,ui}instead of a genericcomponents/dump. - App state machine lives in
src/pages/Index.tsx: Splash → Auth Check → Onboarding → Home, driven bysupabase.auth.onAuthStateChange()plus auseOnboardinghook.
Innovative features
- Glass-morphism bottom navigation with safe-area awareness using
pb-[env(safe-area-inset-bottom)]. - Haptic-first interaction model — every primary action emits a tuned haptic.
- AI CHAT – This isn’t just another chatbot. It’s the proof-of-concept for my Universal AI Agent: a modular, provider‑agnostic backend that drops into any app and instantly feels personal. Instead of brittle, one‑off integrations, I built a dynamic core that adapts to each host application through lightweight adapters. The result? A single agent that can reason, understand, and converse with you directly — while every app demonstrates its own unique flavor of AI interaction.
- Assessments as data, not screens — definitions live in MongoDB with multiple question types and three scoring modes.
- Premium content gating at the edge via a single
canAccess(resource, user, subscription)helper. - Mood-to-recommendation loop feeding personalised content via React Query caches.
- Therapy booking inside the app via Calendly behind the same UI shell as a meditation card.
- Custom sage/forest design system tuned for low-arousal palettes.
Outcome
- Shipped to TestFlight with a working end-to-end flow.
- Migrated the data layer from Rails + Supabase to a self-hosted Node.js + MongoDB stack without breaking a single shipped feature.
- The native-abstraction pattern has been lifted into other Capacitor projects as a reusable starter.



