NewsCMP is a modern, cross-platform news application built with Compose Multiplatform. It provides a seamless news-reading experience across Android and iOS, leveraging a shared codebase for UI and business logic.

- Top Headlines: Stay updated with the latest news from various categories.
- Category Filtering: Filter news based on interests (Business, Tech, etc.).
- Search: Find specific articles by keywords.
- Details Screen: View detailed information about a specific news article.
- Favorites: Save articles to a local database using Room for offline access.
- Responsive UI: Custom components like
FeaturedCard,HeroHeadlineCard, andArticleListItem. - Cross-Platform: Unified logic and UI components across Android and iOS.
- UI Framework: Compose Multiplatform
- Networking: Ktor with custom
AuthPluginfor API key management. - Local Database: Room (Multiplatform) for persistent storage.
- Dependency Injection: Metro for compile-time safe DI.
- Navigation: Jetpack Navigation 3 for multiplatform routing.
- Image Loading: Coil 3 for asynchronous image loading.
- Serialization: Kotlinx Serialization for JSON handling.
- Logging: Kermit for multiplatform logging.
The project follows Clean Architecture principles and the MVVM (Model-View-ViewModel) pattern:
- Data Layer: Handles API requests (Ktor) and local persistence (Room).
- Domain Layer: Contains pure business logic and Use Cases (e.g.,
GetHeadlinesUseCase,AddToFavoriteUseCase). - Presentation Layer: Built with Compose Multiplatform, organized by screens (Headlines, Search, Favorites, Details) and reusable UI components.
shared: The core of the application.commonMain: Shared UI, Use Cases, Repositories, and DI logic.androidMain: Android-specific implementations (e.g., Database initialization).iosMain: iOS-specific implementations and native integration.
androidApp: Android application entry point.iosApp: iOS application entry point (Xcode project).
- Android Studio (Ladybug or later)
- Xcode (for iOS development)
- A NewsAPI key from NewsAPI.org
-
Clone the repository:
git clone https://github.com/yourusername/NewsCMP.git cd NewsCMP -
Add your API Key: The API key is managed via
AuthPlugin.kt. Open AuthPlugin.kt and update theapiKeyvalue:val AuthPlugin = createClientPlugin("authPlugin"){ onRequest { request, content -> request.url.parameters.append("apiKey", "YOUR_API_KEY_HERE") } }
-
Build and Run:
- For Android: Run the
androidAppconfiguration. - For iOS: Open
iosApp/iosApp.xcworkspacein Xcode or run from Android Studio using the Kotlin Multiplatform Mobile plugin.
- For Android: Run the
The project includes GitHub Actions workflows for automated builds:
android.yml: Android build and tests.ios.yml: iOS build and framework generation.build.yml: General multiplatform build check.
Check out the app in action:
This project is licensed under the MIT License.








