Skip to content

Simple news application to demonstrate clean architecture using for with Jetpack compose, view model as UI layer mvvm, coroutines, flows, states, repository layer, data source layer.

License

Notifications You must be signed in to change notification settings

rahuljidgedev/NewsApp

Repository files navigation

Simple News Application

This application demonstrates clean architecture principles implemented with Jetpack Compose, MVVM, Coroutines, Flows, States, Hilt, and an abstracted repository layer.

Architecture

  • Clean Architecture: The application is divided into layers:
    • Presentation: View and ViewModel (MVVM) using Jetpack Compose
    • Data: Repository and data sources (remote)
    • Domain: Model and business logic
  • Jetpack Compose: Used for building the UI
  • MVVM: ViewModel handles data and business logic, exposing it to the View
  • Coroutines: Used to run asynchronous tasks
  • Flows: Used to handle data streams from the repository
  • States: Used to represent the current state of the application
  • Hilt: Used for dependency injection
  • Abstracted Repository Layer: Provides a single point of access to data, regardless of the source
  • Data Source Layers: Separate implementations for local and remote data sources

Features

  • Displays a list of news articles
  • Allows refreshing the news list
  • Shows a loading indicator while fetching data
  • Displays an error message if there is an error fetching data
  • Allows saving articles to favorites
  • Displays a list of favorite articles

Technology Stack

  • Android Studio
  • Kotlin
  • Jetpack Compose
  • MVVM
  • Coroutines
  • Flow
  • StateFlow
  • Hilt
  • Retrofit (remote data)
  • Dagger (dependency injection)
  • Jetpack Compose - Modern Android UI toolkit.
  • ViewModel - Architecture component for managing UI-related data.
  • MVVM - Model-View-ViewModel architectural pattern.
  • Coroutines - Kotlin's concise and expressive way of handling asynchronous programming.
  • Flows - Kotlin's reactive streams for asynchronous programming.
  • Hilt - Dependency injection library for Android.
  • Abstracted Repository Layer - Handling data operations and providing a clean API to the rest of the application.
  • Data Source Layers - Managing the source of data, whether it be a network or local database.

Getting Started

  1. Clone or download the project.
  2. Add your news api key (you can get it from News Api).
  3. Open the project in Android Studio.
  4. Build and run the application.

Contributing

Feel free to contribute to this project by creating pull requests.

License

This project is licensed under the MIT License 2.0.

Disclaimer

This project is intended for demonstration and educational purposes only and is not a complete or production-ready application.


About

Simple news application to demonstrate clean architecture using for with Jetpack compose, view model as UI layer mvvm, coroutines, flows, states, repository layer, data source layer.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages