Giter Site home page Giter Site logo

vaibhav2002 / newsgo Goto Github PK

View Code? Open in Web Editor NEW
48.0 3.0 5.0 62.2 MB

NewsGo - Your daily shot of news on the Go. NewsGo is a Kotlin Multiplatform Mobile Application for Android and iOS.

License: MIT License

Kotlin 82.42% Ruby 0.20% Swift 17.38%
android ios-app jetpack-compose kotlin kotlin-multiplatform opensource-projects swift

newsgo's Introduction

News Go - Your daily shot of news on the go πŸš€

About NewsGo

NewsGo is a news feed application built using Kotlin Multiplatform Mobile. NewsGo currently offers Android and iOS Applications with Desktop and Website support to be added soon.

  • Material You based theming with dynamic color support in Android App
  • Support for both dark and light themes. πŸŒ—
  • Clean Code Quality with best practices, great for learning
  • World Wide News Support

Android App

Android Banner

iOS App

iOS Banner

Application Install

You can Install and test latest NewsGo app from below πŸ‘‡

NewsGo

For iOS App, please clone the project and build it, or if possible contribute the installable file πŸ˜…

Setup

  • Clone the repository on your machine.
  • Create account on News Api and get your api key
  • If you want crash and analytics reporting, create a project on Firebase, enable crashlytics and analytics and paste the google.services.json file in androidApp directory for android else remove the firebase dependencies from android and project gradle files.

Open Secrets.kt and add your api key

object Secrets {
    const val API_KEY = "" // your api key here
}

App Features

  • Get all the latest news, with options to view from categories like Sports, Tech and many more
  • Save articles to view them offline
  • Search from millions of articles and read whatever you want
  • Read News from all around the world with Country Specific News

ScreenShots πŸ“·

Android

HomeScreen SavedScreen Seacrch Screen ArticleScreen

iOS

HomeScreen SavedScreen Seacrch Screen ArticleScreen

Technical Details πŸ’»

Shared

  • NewsGo's codebase follows Android's recommended architecture
  • Shared ViewModels as well, so the only thing which is not shared is the UI.
  • Reactive data management using Kotlin Flows which makes state auto-update when any changes happen in data.
  • Asychronous handling of data using Kotlin Coroutines.
  • NewsGo supports offline caching so you dont have to look at an empty screen while loading πŸ˜„
  • NewsGo's code follows all the best practices and software development principles like SOLID which makes it a very good learning resource for beginners.
  • Code is properly linted using Kt-lint.

Android

  • NewsGo android app is built using Kotlin.
  • App User Interface is built using Jetpack Compose. No more XML 😜
  • Code follows Dependency Injection practices using Hilt.
  • NewsGo's codebase follows Android's recommended architecture
  • Material 3 based theming with dynamic colors based on your phone's wallpaper

iOS

  • NewsGo iOS app is built using Swift.
  • User Inteface is built using Swift UI
  • iOS 16 bases theming.

Built With πŸ› 

  • Kotlin - First class and official programming language for Android development.
  • Kotlin Multiplatform Mobile - Kotlin Multiplatform Mobile is an SDK for iOS and Android app development. It offers all the combined benefits of creating cross-platform and native apps.
  • Swift - Swift is a powerful and intuitive programming language for iOS, iPadOS, macOS, tvOS, and watchOS.
  • Swift UI - SwiftUI helps you build great-looking apps across all Apple platforms with the power of Swift β€” and surprisingly little code.
  • Coroutines - For asynchronous and more..
  • Flow - A cold asynchronous data stream that sequentially emits values and completes normally or with an exception.
  • StateFlow - StateFlow is a state-holder observable flow that emits the current and new state updates to its collectors.
  • SharedFlow - A SharedFlow is a highly-configurable generalization of StateFlow.
  • Android Architecture Components - Collection of libraries that help you design robust, testable, and maintainable apps.
    • ViewModel - Stores UI-related data that isn't destroyed on UI changes.
  • Dependency Injection -
    • Hilt-Dagger - Standard library to incorporate Dagger dependency injection into an Android application.
    • Hilt-ViewModel - DI for injecting ViewModel.
  • Timber - A simple logging library for android.
  • Coil - An image loading library for Android backed by Kotlin Coroutines.
  • Material 3 Android - Material 3 components for Android in Jetpack compose
  • Kotlin Serialization - Kotlin's own Serialization Api.
  • Kotlin DateTime - A multiplatform Kotlin library for working with date and time.
  • SQL Delight - SQLDelight generates typesafe kotlin APIs from your SQL statements.
  • Ktor Client - Create asynchronous client and server applications. Anything from microservices to multiplatform HTTP client apps in a simple way.
  • News Api - Public API to get news data

Package Structure

Shared

dev.vaibhav.newsapp     # Root Package
.
β”œβ”€β”€ data                # For data handling.
|   β”œβ”€β”€ local           # Database and Local Datasources
|   β”œβ”€β”€ remote          # Remote DataSources
β”‚   β”œβ”€β”€ model           # Model data classes and mappers, both remote and local entities of Data Layer
β”‚   └── repo            # Repository Implementations
|
β”œβ”€β”€ domain              # Domain Layer to abstract data layer details from UI   
|   β”œβ”€β”€ models          # Model Data Classes for Domain Layer
β”‚   β”œβ”€β”€ mappper         # Mappers from Data layer models to Domain Layer models
|   β”œβ”€β”€ usecases        # Use-Case Classes for business logic
|   └── repo            # Repository Definitions
|
β”œβ”€β”€ presentation        # Presentation Layer for UI State and Shared View Model
|   β”œβ”€β”€ article         # State and ViewModel for Article Detail Screen. 
|   β”œβ”€β”€ saved           # State and ViewModel for Saved Articles Screen. 
|   β”œβ”€β”€ home            # State and ViewModel for Home Screen. 
|   └── search          # State and ViewModel for Search Screen.
|
└── utils               # Utility Classes / Kotlin extensions

sqldelight.database     # Database Package containing all SQL Queries

Android App

dev.vaibhav.newsapp.android
.
β”œβ”€β”€ di                  # Dependency Injection             
β”‚   └── module          # DI Modules
|
β”œβ”€β”€ presentation        # UI/View layer
|   β”œβ”€β”€ components      # All UI Components
|   β”œβ”€β”€ screens         # All App Screens 
|   └── theme           # Theming classes
|
└── utils               # Utility Classes / Kotlin extensions

iOS App

dev.vaibhav.newsapp.iosApp
.
β”œβ”€β”€ ui 
    β”œβ”€β”€ components      # Ui Components            
    └── screens         # App Screens

Architecture

This app uses MVVM (Model View View-Model) architecture.


If you like my projects and want to support me to build more cool open source projects

"Buy Me A Coffee"

Contact

If you need any help, you can connect with me.

Visit:- Vaibhav Jaiswal

newsgo's People

Contributors

vaibhav2002 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

newsgo's Issues

Support for Other Countries

Problem

  • Currently news shown is only of India as "in" is hardcoded as country

Solution

  • Create solution to fetch user's current country's and pass its 2-letter ISO 3166-1 code in the API call being made.

Revamp Headline News

Currently headlines including all categories like sports, tech etc show old stale news, and not exactly the latest headlines,
Improve current headlines fetching

Find better approach of passing Article to ArticleDetailScreen, in order to avoid serialization or route issues

Currently as articles have image_url, url which can have slashes / hence causing issues in the route string, which is temporarily avoided by encoding url but in some cases there are crashes as content, title, description etc has html string
Parsing them as html works in some cases but does not in some.

Solution

  • Find a better way to pass article as argument rather than serializing/deserializing it.
  • Or Find some way to parse the content so it doesn't mess with the route string

Crash when navigating to Article Detail Screen

Article data

{
  "author": "The Tribune India",
  "content": "Dischem Keto Gummies These days, people have tremendously hectic lives. Since most of them maintain sedentary lifestyles, they almost never have time to care for their health. As a result, a signific… [+17072 chars]",
  "description": "Dischem Keto Gummies These days, people have tremendously hectic lives. Since most of them maintain sedentary lifestyles, they almost never have time to care for their health. As a result, a signific… [+17072 chars]",
  "timeStamp": "2023-01-02T23:37",
  "source": {
	  "id": null,
	  "name": "The Tribune India"
  },
  "title": "Dischem Keto Gummies Reviews South Africa [2023 Scam Alert Keto Gummies] ZA Dischem Keto Gummies Where To Buy? - The Tribune India",
  "url": "https%3A%2F%2Fwww.tribuneindia.com%2Fnews%2Fbrand-connect%2Fdischem-keto-gummies-reviews-south-africa-2023-scam-alert-keto-gummies-za-dischem-keto-gummies-where-to-buy-466754",
  "urlToImage": "https%3A%2F%2Fenglishtribuneimages.blob.core.windows.net%2Fgallary-content%2F2023%2F1%2F2023_1%24largeimg_804043418.jpg",
  "topic": {
	  "type": "dev.vaibhav.newsapp.domain.models.Topic.Headlines"
  }
}

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.