How phuongnam195/youtube-clone works
Main Components
A. Application Layer
• Main App Entry Point
• Main Screen (Tab-based Navigation)
B. Feature Modules
• Home Feature
• Shorts Feature
• Watching Feature
C. Core Layer
• Components
• Repositories
• Entity Models
• Network Services
• Dependency Injection
┌─────────────────────────────────────────────┐
• UI Layer │
• ┬──────────────┬───────────────┤
• Home │ Shorts │ Watching │
• Feature │ Feature │ Feature │
• ┴──────────────┴───────────────┤
• Core Layer │
• ┤
• Dependency Injection Layer │
• ┤
• Network Layer │
• ┘
Detailed Component Breakdown
• Blue rectangles for UI components
• Green rectangles for business logic/repositories
• Yellow diamonds for services
• Purple rectangles for models/entities
B. Show specific relationships:
• ServiceLocator → Repositories
• Repositories → Network Services
• ViewModels → Repositories
• Views → ViewModels
Key Architectural Patterns to Highlight
A. MVVM Architecture:
• Views (Screens and Components)
• ViewModels (PlayingViewModel, WatchingViewModel)
• Models (Video, Channel, VideoCategory)
B. Repository Pattern:
• VideoRepository
• ChannelRepository
• VideoCategoryRepository
• PexelsRepository
C. Dependency Injection:
• ServiceLocator
• ServiceRegistry
Important Details
A. Data Flow:
• API calls flow (ApiConstants → Repositories → ViewModels → Views)
• Video playback flow (WatchingScreen → PlayingViewModel → VideoPlayingView)
• Content loading flow (Home → Repository → Network → Models)
B. Component Communication:
• How features interact with core components
• Demonstrate dependency injection flow
• Data passing between screens