How wapborhan/live-tv works
1. Project shape
- This is a Next.js App Router application, but architecturally it behaves like a single-page, client-heavy media player rather than a traditional server-rendered site.
- The repo is organized around one main experience: browsing a channel list and playing live TV streams from an M3U playlist.
2. Application shell
- app/layout.tsx defines the top-level document structure and global styling hooks.
- app/page.tsx is the route entry point for the main experience.
- app/LiveTVClient.tsx is the key client-side orchestration layer where most interactive behavior likely lives.
3. Static content source
- public/MinnatTv.m3u is the central input artifact in the repo.
- Because it lives under public/, it is served as a static file and can be fetched directly by the browser or app code.
- This indicates the app’s primary data source is not a remote API, but a bundled playlist file.
4. Playlist parsing layer
- lib/parseM3U.ts is the transformation boundary between raw playlist text and app-friendly data.
- It likely converts M3U entries into structured channel objects used by the UI.
- This is a clear separation between transport format and domain model.
5. Shared domain model
- types/channel.ts defines the channel shape used across parsing, selection, favorites, and rendering.
- This type boundary is important for keeping the playlist parser, list UI, and player synchronized.
6. State management boundary
- hooks/useFavourites.ts suggests local client state for saving preferred channels.
- Since there is no backend in the tree, favorites are likely managed in browser storage or in-memory state.
- This makes personalization a purely client-side concern.
7. UI composition
- components/Header.tsx provides the top-level navigation/branding area.
- components/ChannelList.tsx renders the selectable channel catalog.
- components/VideoPlayer.tsx is the playback surface for the currently selected stream.
- components/LoadModal.tsx and components/Toast.tsx handle transient UI feedback and status messaging.
8. End-to-end data flow
- The browser loads the Next.js page shell.
- Client code fetches or reads public/MinnatTv.m3u.
- parseM3U turns the raw playlist into channel objects.
- The channel list is rendered, a user selects a channel, and the selected stream is passed to the video player.
- Favorites and UI feedback are managed alongside selection state in the client.
9. Client/server boundary
- The presence of a dedicated LiveTVClient.tsx strongly suggests the interactive experience runs on the client side.
- The server-side role of Next.js is mainly to deliver the app shell and static assets, not to mediate channel data or playback.
10. Styling and presentation
- app/globals.css provides global styling.
- postcss.config.mjs and next.config.ts support the build/runtime setup for the Next.js app.
- The UI is likely styled entirely within the app bundle rather than via a separate design system.
11. Build and quality pipeline
- .github/workflows/nextjs.yml shows the repository has CI automation for the Next.js project.
- This likely verifies install/build/lint behavior on pull requests or pushes, reinforcing that the app is meant to be deployed as a standard Next.js build artifact.
12. Architecture summary
- The repo is a frontend-only live TV browser/player with a simple layered structure:
- static playlist source,
- parsing/domain conversion,
- client state and favorites,
- composed UI for browsing and playback.
- There are no visible backend services, databases, or external APIs in the tree, so the main architectural boundaries are all within the Next.js client application.
Main entry points: LiveTVClient.tsx LiveTV client · channel.ts Channel type · page.tsx Page entry · layout.tsx App layout
Components 17
App shell
Next.js entry points and global presentation layer.
- Page entry · Route entry point for the main experience.
app/page.tsx - App layout · Top-level document structure and app shell wiring.
app/layout.tsx - Global styles · Global styling for the application.
app/globals.css
Client experience
Interactive live TV browsing and playback.
- LiveTV client · Main interactive controller for playlist loading, selection, and UI state.
app/LiveTVClient.tsx - Header · Top-level branding and navigation area.
components/Header.tsx - Channel list · Renders the selectable channel catalog.
components/ChannelList.tsx - Video player · Playback surface for the selected stream.
components/VideoPlayer.tsx - Load modal · Transient loading and status overlay.
components/LoadModal.tsx - Toast · Short-lived user notifications.
components/Toast.tsx - Favorites · Local favorites management for preferred channels.
hooks/useFavourites.ts
Data boundary
Playlist input, parsing, and shared channel model.
- Playlist file · Bundled live TV playlist served as a static asset.
public/MinnatTv.m3u - M3U parser · Converts raw playlist text into structured channel data.
lib/parseM3U.ts - Channel type · Shared channel shape used by parsing, selection, favorites, and rendering.
types/channel.ts
Build & ops
Project configuration and CI automation.
- Next config · Next.js runtime and build configuration.
next.config.ts - PostCSS config · PostCSS pipeline configuration for styling.
postcss.config.mjs - ESLint config · Repository linting rules and setup.
eslint.config.mjs - CI workflow · Automation for install, build, and validation.
.github/workflows/nextjs.yml
Connections 21
- App layout → Page entry: wraps · Layout provides the page shell.
- App layout → Global styles: applies · Global styles are loaded through the app shell.
- Page entry → LiveTV client: renders · The route entry mounts the client experience.
- LiveTV client → Playlist file: reads · Client loads the bundled playlist source.
- LiveTV client → M3U parser: parses · Raw playlist text is transformed into channel objects.
- M3U parser → Channel type: produces · Parser outputs the shared channel domain model.
- LiveTV client → Channel type: consumes · Client orchestration works with channel objects.
- LiveTV client → Favorites: tracks · Favorites are managed as client-side state.
- LiveTV client → Header: composes · Header is part of the main experience shell.
- LiveTV client → Channel list: composes · Channel list is rendered by the client controller.
- LiveTV client → Video player: drives · Selected channel is passed to the player.
- LiveTV client → Load modal: shows · Loading state is surfaced through modal feedback.
- LiveTV client → Toast: shows · User notifications are surfaced through toast feedback.
- Channel list → Channel type: lists · Channel list is built from the shared channel model.
- Video player → Channel type: plays · Player consumes selected channel metadata/stream info.
- Favorites → Channel type: references · Favorites are keyed by channel data.
- Next config → Page entry: configures · Next build/runtime settings affect the app entry.
- PostCSS config → Global styles: supports · PostCSS supports the styling pipeline.
- ESLint config → LiveTV client: checks · Linting applies to the client orchestration layer.
- CI workflow → Next config: uses · CI runs the Next.js project configuration.
- CI workflow → ESLint config: verifies · CI validates lint rules as part of automation.