How bidrohi/rewalled works
Main Architecture Components
The system should be represented as a Clean Architecture with the following key components:
a. Presentation Layer (UI)
• Compose UI components (shared/library/src/commonMain/.../ui)
• Platform-specific implementations (Android, iOS, Desktop)
• ViewModels (e.g., SubRedditViewModel)
b. Domain Layer
• Models (shared/model)
• Use Cases (implicit from the structure)
c. Data Layer
• Repository (SubredditFeedRepository)
• Cache (SQLDelight database)
• Network (Reddit Service)
┌─ Presentation Layer ─────────────────────┐
• ┌─ Platform UI ──┐ ┌─ Shared UI ─────┐ │
• Android │ │ Common Compose │ │
• iOS │←─│ Components │ │
• Desktop │ │ ViewModels │ │
• ┘ └─────────────────┘ │
• ┬─────────────┘
• ↓
┌─ Domain Layer ────────────────────────────┐
• ┌─ Models ────────┐ ┌─ Use Cases ─────┐ │
• Feed │ │ Wallpaper │ │
• SubReddit │←─│ Management │ │
• Wallpaper │ │ │ │
• ┘ └─────────────────┘ │
• ┬─────────────┘
• ↓
┌─ Data Layer ─────────────────────────────┐
• ┌─ Repository ─┐ ┌─ Local ─┐ ┌─ Remote ┐│
• Subreddit │ │ SQLite │ │ Reddit ││
• Feed │→│ Cache │ │ API ││
• Repository │ │ │ │ Service ││
• ┘ └─────────┘ └─────────┘│
• ┘
Important Architectural Details to Highlight
a. Multiplatform Support:
• Shared code modules
• Platform-specific implementations
• Common business logic
b. Data Flow:
• Reddit API integration
• Local caching mechanism
• Repository pattern implementation
c. Dependency Injection:
• AppGraph implementations for different platforms
• Platform-specific factories
Notes for Implementation Details
Annotations for:
• Kotlin Multiplatform specific features
• SQLDelight database implementation
• Compose Multiplatform UI
• Platform-specific considerations
Remember to emphasize the shared code modules and how they interact with platform-specific implementations, as this is a key aspect of the Kotlin Multiplatform project structure.