Skip to content

Latest commit

Β 

History

History
119 lines (89 loc) Β· 4.57 KB

File metadata and controls

119 lines (89 loc) Β· 4.57 KB

πŸ’¬ Chat App UI on Compose MultiPlatform - Practice - Clean Architecture

A world-class Kotlin Multiplatform chat application demonstrating Clean Architecture principles with Component-Based UI design.

Kotlin Compose Multiplatform Clean Architecture Material 3

✨ Features

  • 🎯 Clean Architecture with proper layer separation
  • 🧩 Component-Based UI with 6 reusable components
  • πŸ’¬ Real-time messaging with mock smart auto-responses
  • ⏳ Animated typing indicators with smooth transitions
  • πŸ‘₯ User switching to simulate conversations
  • 🎨 Material 3 Design with custom theming
  • πŸ“± Cross-platform (Android & iOS ready)

πŸ—οΈ Architecture

src/commonMain/kotlin/org/cmppractice/app/
β”œβ”€β”€ 🎯 domain/              # Pure Business Logic
β”‚   β”œβ”€β”€ model/              # Domain entities
β”‚   β”œβ”€β”€ repository/         # Repository interfaces
β”‚   └── usecase/            # Business use cases
β”œβ”€β”€ πŸ’Ύ data/                # Data Access Layer
β”‚   β”œβ”€β”€ di/                 # Data dependencies
β”‚   β”œβ”€β”€ model/              # Data entities (DTOs)
β”‚   β”œβ”€β”€ mapper/             # Data ↔ Domain mapping
β”‚   └── repository/         # Repository implementations
β”œβ”€β”€ 🎨 presentation/        # UI Layer
β”‚   β”œβ”€β”€ component/          # 6 Reusable UI components
β”‚   β”œβ”€β”€ screen/             # Screen composables
β”‚   β”œβ”€β”€ viewmodel/          # State management
β”‚   β”œβ”€β”€ theme/              # Material 3 theming
β”‚   └── di/                 # UI dependencies
└── πŸš€ App.kt              # Composition root

πŸš€ Quick Start

Prerequisites

  • Android Studio Hedgehog+ (2023.1.1+)
  • JDK 17+
  • Android SDK 35+

Run the App

# Clone the repository
git clone https://github.com/yourusername/CMPPractice.git
cd CMPPractice

# Run on Android
./gradlew :composeApp:installDebug

# Or open in Android Studio and run

πŸ“± Demo

  1. Send Messages: Type and send messages as User1
  2. Smart Responses: Watch auto-responses from User2
  3. Switch Users: Tap the person icon to switch perspectives
  4. Typing Indicator: See animated typing feedback
  5. Clear Chat: Use the clear button to reset

🎯 Key Benefits

  • βœ… Maintainable: Clear separation of concerns
  • βœ… Testable: Each layer independently testable
  • βœ… Scalable: Easy to add features
  • βœ… Reusable: Components work across screens
  • βœ… Professional: Industry best practices

πŸ“š Documentation

Detailed documentation is available in the docs/ folder:

πŸ› οΈ Tech Stack

  • Language: Kotlin 2.2.0
  • UI Framework: Compose Multiplatform 1.8.2
  • Architecture: Clean Architecture + MVI (State & Event)
  • Design System: Material 3
  • State Management: Flow + StateFlow
  • Dependency Injection: Manual DI with modules
  • Testing: Kotlin Test + Coroutines Test

🎨 Screenshots

πŸ“± UI - iOS & Android

Chat App - iOS and Android

The chat application running on both iOS and Android platforms, showcasing the unified Material 3 design and responsive UI components.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments


⭐ Star this repo if you found it helpful!