Giter VIP home page Giter VIP logo

newsapp's Introduction

NewsApp

Welcome to NewsApp, a news application built with MVVM architecture and Jetpack Compose.

Major Highlights

  • Jetpack Compose for modern UI
  • Offline caching with a single source of truth
  • MVVM architecture for a clean and scalable codebase
  • Kotlin and Kotlin DSL
  • Dagger Hilt for efficient dependency injection.
  • Retrofit for seamless networking
  • Room DB for local storage of news articles
  • Coroutines and Flow for asynchronous programming
  • StatFlow for streamlined state management
  • Pagination to efficiently load and display news articles
  • Unit tests and UI tests for robust code coverage
  • Instant search for quick access to relevant news
  • Navigation for smooth transitions between screens
  • WebView for a seamless reading experience
  • WorkManager for periodic news fetching
  • Notification for alerting about latest news
  • Coil for efficient image loading
  • Pull to refresh for refreshing news content
  • Swipe to delete for managing saved news articles

mvvm-architecture

Features Implemented

  • Show top news articles
  • Filter news by country, language, and source
  • Save news articles for future reference
  • Search for specific news articles
  • View news articles in a WebView for a detailed reading experience

Dependency Use

  • Jetpack Compose for UI: Modern UI toolkit for building native Android UIs
  • Coil for Image Loading: Efficiently loads and caches images
  • Retrofit for Networking: A type-safe HTTP client for smooth network requests
  • Dagger Hilt for Dependency Injection: Simplifies dependency injection
  • Room for Database: A SQLite object mapping library for local data storage
  • Paging Compose for Pagination: Simplifies the implementation of paginated lists
  • Mockito, JUnit, Turbine for Testing: Ensures the reliability of the application

How to Run the Project

  • Clone the Repository:
git clone https://github.com/khushpanchal/NewsApp.git
cd NewsApp
  • Visit newsapi.org and sign up for an API key, Copy the API key provided
  • Open the build.gradle.kts file in the app module. Find the following line
buildConfigField("String", "API_KEY", "\"<Add your API Key>\"")
  • Replace "Add your API Key" with the API key you obtained
  • Build and run the NewsApp.

The Complete Project Folder Structure

|── NewsApplication.kt
├── common
│   ├── Const.kt
│   ├── NoInternetException.kt
│   ├── dispatcher
│   │   ├── DefaultDispatcherProvider.kt
│   │   └── DispatcherProvider.kt
│   ├── logger
│   │   ├── AppLogger.kt
│   │   └── Logger.kt
│   ├── networkhelper
│   │   ├── NetworkHelper.kt
│   │   └── NetworkHelperImpl.kt
│   └── util
│       ├── EntityUtil.kt
│       ├── NavigationUtil.kt
│       ├── TimeUtil.kt
│       ├── Util.kt
│       └── ValidationUtil.kt
├── data
│   ├── database
│   │   ├── AppDatabaseService.kt
│   │   ├── ArticleDatabase.kt
│   │   ├── DatabaseService.kt
│   │   ├── dao
│   │   │   ├── ArticleDao.kt
│   │   │   └── SavedArticleDao.kt
│   │   └── entity
│   │       ├── Article.kt
│   │       ├── SavedArticleEntity.kt
│   │       ├── SavedSourceEntity.kt
│   │       └── Source.kt
│   ├── model
│   │   ├── ApiArticle.kt
│   │   ├── ApiSource.kt
│   │   ├── Country.kt
│   │   ├── Language.kt
│   │   ├── News.kt
│   │   └── Sources.kt
│   ├── network
│   │   ├── ApiInterface.kt
│   │   └── ApiKeyInterceptor.kt
│   └── repository
│       └── NewsRepository.kt
├── di
│   ├── module
│   │   └── ApplicationModule.kt
│   └── qualifiers.kt
├── ui
│   ├── NewsActivity.kt
│   ├── base
│   │   ├── CommonUI.kt
│   │   ├── NewsDestination.kt
│   │   ├── NewsNavigation.kt
│   │   └── UIState.kt
│   ├── components
│   │   ├── Article.kt
│   │   ├── FilterItem.kt
│   │   ├── FilterItemListLayout.kt
│   │   └── NewsListLayout.kt
│   ├── paging
│   │   └── NewsPagingSource.kt
│   ├── screens
│   │   ├── ArticleScreen.kt
│   │   ├── FilterScreen.kt
│   │   ├── NewsScreen.kt
│   │   ├── SavedScreen.kt
│   │   └── SearchScreen.kt
│   ├── theme
│   │   ├── Color.kt
│   │   ├── Theme.kt
│   │   └── Type.kt
│   └── viewmodels
│       ├── NewsViewModel.kt
│       ├── SearchViewModel.kt
│       ├── SharedViewModel.kt
│       └── filters
│           ├── CountryFilterViewModel.kt
│           ├── LanguageFilterViewModel.kt
│           └── SourceFilterViewModel.kt
└── worker
    └── NewsWorker.kt

screenshots

newsapp's People

Contributors

khushpanchal avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.