{"id":18975476,"url":"https://github.com/arjunjadeja/samachar","last_synced_at":"2025-04-16T14:55:43.893Z","repository":{"id":252010971,"uuid":"826162538","full_name":"ArjunJadeja/samachar","owner":"ArjunJadeja","description":"Samachar is an Android news app built to demonstrate the MVVM architecture in Kotlin. It utilizes Jetpack Compose, Dagger Hilt, Retrofit, RoomDB, Coroutines, and Flow.","archived":false,"fork":false,"pushed_at":"2024-08-09T03:45:12.000Z","size":1380,"stargazers_count":80,"open_issues_count":0,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T19:50:44.936Z","etag":null,"topics":["android","coil","compose-ui","dagger-hilt","flow","jetpack-compose","mvvm-architecture","paging3","retrofit2"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArjunJadeja.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-09T07:37:46.000Z","updated_at":"2025-03-31T11:45:24.000Z","dependencies_parsed_at":"2025-01-15T18:18:52.658Z","dependency_job_id":"cd8d37a3-4e97-4626-8579-194902b104b5","html_url":"https://github.com/ArjunJadeja/samachar","commit_stats":null,"previous_names":["arjunjadeja/samachar"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArjunJadeja%2Fsamachar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArjunJadeja%2Fsamachar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArjunJadeja%2Fsamachar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArjunJadeja%2Fsamachar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArjunJadeja","download_url":"https://codeload.github.com/ArjunJadeja/samachar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249252648,"owners_count":21238233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","coil","compose-ui","dagger-hilt","flow","jetpack-compose","mvvm-architecture","paging3","retrofit2"],"created_at":"2024-11-08T15:19:16.967Z","updated_at":"2025-04-16T14:55:43.861Z","avatar_url":"https://github.com/ArjunJadeja.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eSamachar\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e  \n🎨 Samachar is an Android news app built to demonstrate the MVVM architecture in Kotlin. It utilizes Jetpack Compose, Dagger Hilt, Retrofit, RoomDB, Coroutines, and Flow. ✨\n\u003c/p\u003e\n\n## App UI\n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"assets/SamacharUi.png\" width=\"800\"/\u003e \n\u003c/p\u003e\n\n## Major highlights\n\n- **Instant Search**: Implemented using Kotlin Flow with debounce, distinctUntilChanged, and filter operators.\n- **Headlines Filter**: Filter news headlines by country, language, and source.\n- **Offline Mode**: Access news content even when offline.\n- **Bookmark Headlines**: Save and access your favorite news articles for later.\n- **Dependency Injection**: Manage dependencies cleanly and efficiently using Hilt.\n- **Paginated Data Loading**: Efficiently load news articles with pagination support.\n- **API Key Management**: API key handled securely as a header in the interceptor.\n- **Unit Tests**: Unit tests for critical components.\n\n## Download\nCheck out [Releases](https://github.com/ArjunJadeja/Samachar/releases) to download the latest APK (1.51 MB).\n\n## API Key Setup\n\nThis project uses the NewsAPI to fetch news articles. Some users have encountered the `429 Too Many Requests` error due to API rate limits. To avoid this issue, it's recommended that each developer uses their own API key.\n\n### Steps to Configure Your API Key\n\n1. **Obtain an API Key**:\n    - Visit the [NewsAPI](https://newsapi.org/) website.\n    - Sign up and get your free API key.\n\n2. **Link the API Key in the Code**:\n    - Replace the current API Key with your own key in the `build.gradle` file.\n\n3. **Rebuild the Project**:\n    - Sync your project with Gradle files and rebuild the project to apply the changes.\n\nBy following these steps and using your own API key, you can avoid hitting the API rate limits and ensure smooth functioning of the app.\n\n## Tech stack \u0026 Open-source libraries\n- **Minimum SDK level 26**\n- [**Kotlin**](https://kotlinlang.org/) - Modern, concise, and safe programming language.\n- [**Dagger Hilt**](https://developer.android.com/training/dependency-injection/hilt-android) - Dagger Hilt is a dependency injection library for Android that reduces the boilerplate of doing manual dependency injection in your project.\n- [**Kotlin Serialization**](https://github.com/Kotlin/kotlinx.serialization) - A compiler plugin that automatically produces visitor code for classes, and a runtime library that uses generated code to serialize objects without reflection.\n- [**Coroutines**](https://kotlinlang.org/docs/coroutines-overview.html) - Asynchronous or non-blocking programming is an important part of the development landscape. Coroutines is our recommended solution for asynchronous programming on Android.\n- [**Flow**](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/) - An asynchronous data stream that sequentially emits values and completes normally or with an exception.\n- [**Retrofit**](https://square.github.io/retrofit/) - A type-safe HTTP client for Android and Java.\n- [**RoomDB**](https://developer.android.com/training/data-storage/room) - The Room persistence library provides an abstraction layer over SQLite to allow fluent database access while harnessing the full power of SQLite.\n- [**Jetpack Compose**](https://developer.android.com/develop/ui/compose) - Jetpack Compose is Android’s recommended modern toolkit for building native UI. It simplifies and accelerates UI development on Android.\n- [**Coil**](https://coil-kt.github.io/coil/) - An image loading library for Android backed by Kotlin Coroutines.\n- [**Material 3**](https://github.com/material-components/material-components-android) - Material design components for building View layouts and Animations.\n\n## App Architecture\nMVVM architecture and the Repository pattern.\n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"assets/SamacharArchitecture.png\" width=\"600\"/\u003e \n\u003c/p\u003e\n\n## Package Structure\n\n    com.arjun.samachar    # Root Package\n    .\n    ├── data                        # Data handling layer\n    │   ├── local                   # Local database with Room\n    │   │   ├── dao                 # Data Access Objects\n    │   │   └── entity              # Database entities\n    │   ├── remote                  # Remote data source\n    │   │   ├── api                 # API endpoints\n    │   │   ├── model               # Models for network responses\n    │   │   └── AuthInterceptor.kt  # Network interceptor\n    │   ├── model                   # Model classes\n    │   ├── paging                  # Paging components\n    │   └── repository              # Repository pattern implementation\n    |\n    ├── di                          # Dependency Injection\n    │   ├── module                  # Dagger/Hilt modules\n    │   └── Qualifiers.kt           # Qualifiers for DI\n    |\n    ├── ui                          # User Interface layer\n    │   ├── base                    # Base components\n    │   ├── headlines               # Headlines feature\n    │   │   ├── home                # Home screen components\n    │   │   ├── bookmark            # Bookmark screen components\n    │   │   └── search              # Search screen components\n    │   ├── filters                 # Filter components (country, language, source)\n    │   ├── theme                   # Theming and styles\n    │   ├── MainActivity.kt         # Main Activity\n    │   └── MainViewModel.kt        # Main ViewModel\n    |\n    ├── utils                       # Utility classes and extensions\n    └── App.kt                      # Application class\n\n## Credits\n- API from [NewsAPI](https://newsapi.org)\n- Icons from [Flaticon](https://www.flaticon.com)\n- Illustrations from [Iconsout](https://iconscout.com)\n\n## Contribute\nIf you want to contribute to this library, you're always welcome!\nSee [Contributing Guidelines](CONTRIBUTING.md).\n\n## Contact\nFeel free to connect with me on [LinkedIn](https://www.linkedin.com/in/arjun-jadeja/)\n\n## License\n```xml\nMIT License\n\nCopyright (c) 2024 Arjun Jadeja\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjunjadeja%2Fsamachar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farjunjadeja%2Fsamachar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjunjadeja%2Fsamachar/lists"}