How puskal-khadka/tiktok-compose works
High-Level Architecture Components
Create three main layers with clear boundaries:
┌─ Presentation Layer ─────────────────────┐
• (Features & UI Components) │
• Authentication │
• Home (For You/Following) │
• Camera/Media │
• Profile │
• Comments │
• ┬────────────────────┬──┘
┌──────────────────┴────────────────────┴──┐
• Domain Layer │
• (Business Logic & Use Cases) │
• ┬────────────────────────┘
┌──────────────────┴────────────────────────┐
• Data Layer │
• (Repositories & Data Sources) │
• ┘
Module Dependencies
┌─ App Module ──┐
• (Main Entry) ─┼──► Feature Modules
• ┘ │
• ► Domain Module
• ► Data Module
• ► Common Module
• ► Core Module
Feature Components
• UI Components
• ViewModels
• Navigation
• Contracts
Example for Home feature:
┌─ Home Feature ──────────────────┐
• ┌─ UI ─────────┐ ┌─ ViewModel ─┐│
• HomeScreen │ │ ForYou ││
• ForYouTab │ │ Following ││
• FollowingTab │ └────────────┘││
• ┘ ││
• ┌─ Navigation ─┐ ┌─ Contract ─┐││
• HomeNav │ │ States ││
• ┘ │ Events ││
• ┘││
• ┘
Core Components
Shared functionality:
┌─ Core ────────────────────┐
• Base ViewModel │
• Navigation Routes │
• Extensions │
• Utils │
• ┘
Data Flow
User Action → ViewModel → UseCase → Repository → DataSource
• ↑ │
• ┘
• Blue: UI/Feature modules
• Green: Domain/Business logic
• Yellow: Data handling
• Gray: Core/Common utilities
Important Elements to Include:
Use case implementations
• Clean Architecture layers
• Module boundaries
• Data flow directions
• Component responsibilities
• Integration points
Remember to:
• Keep components aligned with the actual codebase structure
• Clear boundaries between modules
• Maintain proper spacing for readability
This system design should reflect the modular nature of the application while showing how all components work together to create the complete TikTok clone functionality.