Monorepo Overview
BBPlayer is organized as a pnpm workspace monorepo with multiple apps and shared packages. This structure promotes code reuse and maintains consistency across the project.Apps Directory
Theapps/ directory contains the main applications in the BBPlayer ecosystem.
Mobile App (apps/mobile)
The core React Native application built with Expo.
Mobile App Structure
Mobile App Structure
- Framework: Expo 55 (preview), React Native 0.83.1, React 19.2.0
- Routing: Expo Router (file-based routing)
- State Management: Zustand for global state
- Data Fetching: TanStack React Query (v5.90.19)
- UI Library: React Native Paper (Material Design 3)
- Database: SQLite with Drizzle ORM
- Storage: MMKV for fast key-value storage
- Audio Playback:
@bbplayer/orpheus(custom Media3 wrapper) - Lyrics:
@bbplayer/splash(SPL format support)
The mobile app uses Expo Router for navigation with file-based routing in the
src/app/ directory.Backend (apps/backend)
A lightweight backend API built with Hono and deployed on Cloudflare Workers.
- Proxy for Bilibili API requests
- User data synchronization
- Analytics aggregation
Docs (apps/docs)
The documentation site you’re reading right now, built with Mintlify.
Packages Directory
Shared libraries used across the monorepo.@bbplayer/orpheus
Custom Expo module for audio playback based on Android Media3.- Media3 ExoPlayer integration for Android
- Background playback support
- Audio focus management
- Playback queue management
- Loudness equalization (ReplayGain support)
@bbplayer/splash
Lyrics parsing and conversion library supporting the SPL format.- Parse LRC and SPL (Synchronized Lyrics) formats
- Word-by-word synchronization
- Romaji annotation support
- Translation lyrics support
SPL is BBPlayer’s custom lyrics format supporting advanced features like word-level timing and furigana. Learn more at bbplayer.roitium.com/SPL.
@bbplayer/logs
Performance-aware logging library for React Native.- Namespace-based logging
- Custom log levels
- Custom transports (console, file)
- Colored console output
- Performance-optimized for production
@bbplayer/image-theme-colors
Expo module for theme color extraction from images.- Extract dominant colors from album covers
- Generate Material You (Monet) color palettes
- Support dynamic theming based on artwork
@bbplayer/eslint-plugin
Custom ESLint rules specific to BBPlayer’s coding standards.Configuration Files
Root Level
package.json- Root workspace configuration with shared dev scriptspnpm-workspace.yaml- Workspace definitiontsconfig.json- TypeScript project referenceseslint.config.mjs- ESLint configuration.oxlintrc.json- oxlint configuration.oxfmtrc.json- oxfmt formatter configurationlefthook.yml- Git hooks configurationcommitlint.config.js- Commit message linting.syncpackrc- Dependency version synchronization
Mobile App Config
app.config.ts- Dynamic Expo configurationeas.json- Expo Application Services build profilesmetro.config.js- Metro bundler with Rozenite pluginsbabel.config.js- Babel with React Compiler plugindrizzle.config.ts- Database ORM configuration
Development Workflow
Workspace Commands
Run commands from the root directory:Package-Specific Commands
Run commands in specific packages:TypeScript Configuration
The project uses TypeScript project references for better build performance and type checking. Roottsconfig.json references:
apps/mobile/tsconfig.jsonapps/docs/tsconfig.jsonpackages/*/tsconfig.json
- Incremental builds
- Cross-package type checking
- Better IDE performance
Next Steps
Development Setup
Set up your development environment
Building for Production
Learn how to build production APKs