Back to Projects
WEB APP

YouTube Clone

React 19 + Redux Toolkit + Vite + Tailwind CSS v4

React 19 Redux Toolkit Tailwind v4 JSONP API

Role

Frontend Architect

Project Type

Media Streaming Platform

Live Link

Visit Live Site

Project Overview

This project is a highly optimized, feature-rich YouTube clone built with the latest React 19 ecosystem. Key engineering choices center around performance optimization, responsive layouts, modular state management, and memory safety. It showcases how to handle high-frequency user actions, infinite data feeds, and heavy calculations efficiently in a client-side environment.

Architecture & Core Tech

The application is built on top of a centralized Redux store managing app layout states, search caches, and bounded live chat arrays. Interoperability with Youtube's API and auto-complete servers is handled natively via security-compliant channels.

Key Subsystems

  • High-Performance Search Bar: Implements client-side debouncing (200ms delay) to limit query storms, coupled with a fast O(1) Redux-based lookup cache. Includes a dynamic JSONP CORS-bypass script loader to fetch suggestions directly from YouTube's auto-suggest endpoint.
  • Memory-Bounded Live Chat: Features a simulated chat flow optimized for memory safety. A FIFO queue structure maintains a maximum threshold (e.g., 10 messages) to prevent browser DOM bloating and memory leaks during long sessions.
  • Recursive Comment Threads: Implements n-level deeply nested comment threads utilizing self-referential components, collapse/expand states, and visual reply indicators.

Performance & Logic Demos

  • Computations Memoization: Integrates a memoization test dashboard utilizing the useMemo hook to calculate Nth prime numbers, proving that theme changes do not trigger expensive main-thread recalculations.
  • State Persistence Refs: Contrasts local variables, React state (useState), and persistence references (useRef) to track counters without causing rendering cycles.
  • State Synchronization: Side navigation collapses selectively when navigating to watch pages to maximize video player space, restoring automatically when returning.
  • Skeleton Shimmer Loaders: Mimics real YouTube skeleton card previews before async video data is populated on-screen.

Key Lessons & Takeaways

Building this platform highlighted the importance of frontend performance boundaries. Implementing a strict threshold for the Live Chat FIFO queue demonstrated how infinite scrolling lists can easily crash browser tabs if DOM nodes are not recycle-bound or culled. Similarly, building debouncing and client-side caching algorithms manually reinforced how API costs and latency can be significantly reduced in production applications.