How yajanarao/serenity works
Project type and purpose
• This is a client-heavy, monorepo multimedia application (called “Serenity”) that delivers audio content (music, meditation, podcasts) on two platforms:
• A React Native mobile app (Android & iOS) under apps/mobile
• A React web app under apps/web
• It leverages a modular architecture with shared UI components (packages/components), core state management logic (packages/core), and extension plugins (packages/extensions)
• It uses Supabase as its backend (authentication, database, storage), plus external APIs (e.g., YouTube for streaming)
File structure
• Top-level directories
• apps/mobile → full React Native codebase (Java/Kotlin for Android, Objective-C/Swift for iOS, plus JS/TS business logic)
• apps/web → React single-page application
• packages/components → shared UI React( Native ) components
• packages/core → Redux slices, hooks, store setup—shared domain logic
• packages/extensions → plugin implementations for streaming sources (YouTube, JioSaavn, etc.)
• scripts, docs, CI/CD configs (GitHub Actions, Travis, Fastlane)
• The monorepo is orchestrated by Turbo/Turborepo (turbo.json) and Yarn Workspaces (package.json at root)
• No proprietary backend code lives here—Supabase config is in apps/mobile/src/services/supabase.ts; apps talk directly to Supabase
README for additional insights
• Confirms cross-platform focus, streaming from local & online, plugin-based audio sources, voice search
• Points to docs/Setup.md for environment and deployment, and to Supabase as the sole backend
Main components
a. User Devices and Applications
• Mobile App (Android & iOS)
• Web App (Browser)
b. Shared Monorepo Packages
• UI Component Library (packages/components)
• Core State & Business Logic (packages/core)
• Extensions/Plugins (packages/extensions)
c. Backend & External Services
• Supabase (Auth, PostgreSQL DB, Storage)
• External Streaming APIs (YouTube Data API, JioSaavn, etc.)
• Voice Search Service (e.g., device microphone → speech recognition API)
Relationships and interactions
• Mobile/Web App UIs import & render components from packages/components
• UIs dispatch actions to the Redux store in packages/core
• Core logic invokes Supabase client SDK (direct HTTP/WebSocket) for user auth, data fetch/store
• Core logic also loads extensions from packages/extensions to fetch online audio streams
• UIs handle voice search by calling a speech-to-text service, then querying core/search plugins
• CI/CD pipelines (GitHub Actions + Fastlane) build & deploy mobile apps; Netlify/Vercel or similar builds the web app
Architectural patterns & design principles
• Monorepo with clear separation between front-ends, shared UI, domain logic, and plugins
• Modular plugin architecture: new audio sources are added under packages/extensions without touching core
• Redux pattern (slices, store) isolated in packages/core, ensuring consistent state management across platforms
• Component-driven design: packages/components provides cross-platform building blocks
• Direct-to-Backend approach: no custom server; clients talk to Supabase & third-party APIs