A React-based clone of YouTube, demonstrating debouncing, Redux state management, and modern front-end architecture using Vite and Tailwind CSS.
- Debounced Search: Efficient API calls while typing (see below for details).
- Modern React Structure: Organized components, hooks, and state slices.
- Global State Management: Redux Toolkit for scalable and maintainable state.
- Chat & Search Slices: Modular chat and search management.
- Reusable Utilities: Constants and helpers for DRY code.
- Responsive Design: Styled with Tailwind CSS for a mobile-first experience.
- FontAwesome Integration: Rich iconography.
/
├── index.html
├── package.json
├── vite.config.js
├── eslint.config.js
├── /src
│ ├── App.jsx
│ ├── main.jsx
│ ├── index.css
│ ├── /assets
│ └── /components
├── /utils
│ ├── appSlice.jsx
│ ├── chatSlice.jsx
│ ├── searchSlice.jsx
│ ├── constants.jsx
│ ├── helper.jsx
│ └── store.jsx
- src/App.jsx: Main application component.
- src/main.jsx: App entry point.
- src/components/: UI React components.
- utils/appSlice.jsx, chatSlice.jsx, searchSlice.jsx: Redux slices.
- utils/store.jsx: Redux store setup.
- utils/constants.jsx: Shared constants.
- utils/helper.jsx: Utility functions.
- index.html: HTML entry.
- vite.config.js: Vite configuration.
- eslint.config.js: Linting.
This project showcases debouncing for search input, reducing unnecessary API calls:
- Without debouncing: 1000 queries × 14 characters = 14,000 API calls on iPhone Pro Max.
- With debouncing (200ms): Only ~3 API calls per 1000 queries.
- If the interval between keystrokes is less than 200ms, API call is skipped.
- React 18
- Redux Toolkit
- Vite
- Tailwind CSS
- React Router DOM
- FontAwesome
- ESLint
- Node.js (v18+ recommended)
- npm
git clone https://github.com/realgenes/youTube_Clone.git
cd youTube_Clone
npm install
npm run dev
Visit http://localhost:5173 to view the app.
npm run dev
— Start development servernpm run build
— Production buildnpm run preview
— Preview production buildnpm run lint
— Lint the codebase
Contributions welcome! Please open issues or pull requests.
MIT
Developed by realgenes