How patrickdip/kmm_socialmediaapp works
Project Type and Purpose
• This project is a mobile client for a Social Media App built using Kotlin Multiplatform. It contains cross-platform business logic (in the “shared” module) with platform-specific UIs for Android (fully implemented) and iOS (planned for future development).
• The project leverages native UI frameworks (Android UI components and Swift UI for iOS) while sharing domain, repository, networking, and other business-related layers.
Analyzing the File Structure
• The project is organized into three major directories:
• androidApp: Contains all Android-specific code including activities, view models, screens, and Android resources.
• iosApp: Contains the iOS project structure (Xcode project, assets, SwiftUI views), though it’s still minimal compared to Android.
• shared: Houses the core, platform-agnostic modules. This module is further divided into subdirectories (commonMain, androidMain, iosMain) along with packages for account, auth, post, follows, common (data, domain, util), and dependency injection. It encapsulates the business logic, use cases, repository implementations, API services, and shared utilities.
• Look for clear separations such as:
• Domain and use case layers (e.g., account/domain, auth/domain, post/domain).
• Data and networking layers (e.g., common/data/remote with KtorApi and related API services).
• Dependency Injection modules (e.g., PlatformModule in both android and shared directories).