When building TV applications, a Monorepo structure is the most common approach because different platforms require bundled applications.
Key Architectural Principles:
- Prioritize Logic Reuse: Reuse business logic, state management, custom hooks, and API layers across all platforms.
- Isolate UI and Focus: Expect TV-specific screen UI, focus behaviors, and platform-specific packaging to require dedicated implementations.
- Project Structure Example:
A typical multi-platform shape includes separate native folders for each target (e.g., ios/, tvos/, android/, vega/, web/) while keeping shared application code in a src/ directory.
my-tv-app/
├── ios/ # iOS native files
├── tvos/ # tvOS native files
├── android/ # Android, Android TV, Fire TV native
├── vega/ # Vega OS native files
├── web/ # web, webOS, Tizen native files
├── src/ # Application code (shared)
│ ├── index.web.tsx # Web entry point
│ └── index.js # Native entry point
├── rsbuild.config.ts # Web bundler config
├── metro.config.ts # Native bundler config
└── package.json
my-tv-app/
├── ios/ # iOS native files
├── tvos/ # tvOS native files
├── android/ # Android, Android TV, Fire TV native
├── vega/ # Vega OS native files
├── web/ # web, webOS, Tizen native files
├── src/ # Application code (shared)
│ ├── index.web.tsx # Web entry point
│ └── index.js # Native entry point
├── rsbuild.config.ts # Web bundler config
├── metro.config.ts # Native bundler config
└── package.json