Back to Projects

Experimental Sequence 03

YogaTube
System Documentation

This page is constructed from YogaTube-Complete-Documentation.html and the accompanying diagrams/screenshots. It captures architecture, runtime behavior, API contracts, state/effect logic, and responsive UI walkthroughs.

React 19Vite 7Material UIReact RouterAxios + RapidAPIPlaywright
Node StatusSynchronized
RapidAPI stream active

Project Scope and Goals

YogaTube is a route-driven video discovery app that connects category browsing, search, video detail, and channel detail in one consistent interaction model.

Category browsing in the home feed

Keyword search with route-based URLs

Video playback with statistics and related content

Channel profile visualization with recent uploads

Responsive desktop/mobile behavior with a shared design language

Complete Runtime Working

Step 1

Application mounts, Router initializes, and Navbar remains persistent.

Step 2

Home feed starts with selectedCategory = New, then requests search results.

Step 3

User category click updates selectedCategory and re-runs Feed effect.

Step 4

Search form submit navigates to /search/:searchTerm and triggers SearchFeed effect.

Step 5

Video card click navigates to /video/:id, where metadata and related videos are fetched.

Step 6

Channel link click navigates to /channel/:id, where channel profile and uploads are fetched.

Primary Route Mapping

RoutePage ComponentMain Responsibilities
/FeedCategory selection, feed fetching, and card-grid rendering
/search/:searchTermSearchFeedTerm-based search and shared card rendering
/video/:idVideoDetailReactPlayer embedding, metadata/statistics, and related content
/channel/:idChannelDetailChannel profile info plus latest uploads

YouTube API Integration

Base URL: https://youtube-v31.p.rapidapi.com with x-rapidapi-host and x-rapidapi-key headers read from environment variables. Request logic is centralized to keep route components focused on state and rendering.

ComponentEndpoint PatternData Used In UI
Feedsearch?part=snippet&q={category}&maxResults=50thumbnail, title, and channel metadata for feed cards
SearchFeedsearch?part=snippet&q={searchTerm}&maxResults=50search result cards with the same normalized card model
VideoDetailvideos?part=snippet,statistics&id={videoId}title, channel metadata, views, likes, and player context
VideoDetailsearch?part=snippet&relatedToVideoId={videoId}&type=video&maxResults=35related video recommendation list
ChannelDetailchannels?part=snippet,statistics&id={channelId}avatar, title, and subscriber metrics
ChannelDetailsearch?channelId={channelId}&part=snippet&order=date&type=video&maxResults=35latest uploads for selected channel

State and Effect Map

ComponentStateEffect TriggerPrimary Render Output
SearchBarsearchTermsubmit eventURL navigation to /search/:searchTerm
FeedselectedCategory, videosselectedCategory changecategory-aware feed cards
SearchFeedvideossearchTerm route paramsearch result card grid
VideoDetailvideoDetail, videosid route paramplayer panel with related videos
ChannelDetailchannelDetail, videosid route paramchannel profile plus uploads

Diagrams From Documentation

Screenshot Walkthrough (01-12)

Captured with automated Playwright navigation across desktop and mobile flows.

Build and Documentation Pipeline

Application build and preview flow:

npm run build
npm run preview -- --host --port 4173
node documentation/temp/capture-screenshots.mjs
node documentation/temp/export-documentation-pdf.mjs

Maintenance Notes

Add user-facing API error states for quota and connectivity failures.

Add request caching and deduplication using React Query or SWR.

Introduce a backend proxy layer for stronger API-key isolation.