{"id":20216079,"url":"https://github.com/okellosam21/chatwise-assignment","last_synced_at":"2025-03-03T11:22:02.338Z","repository":{"id":251898861,"uuid":"838752873","full_name":"OkelloSam21/ChatWise-Assignment","owner":"OkelloSam21","description":"This Android application is a simple product catalog viewer developed as part of the ChatWise assignment. The app allows users to browse a list of products and view detailed information about each produc","archived":false,"fork":false,"pushed_at":"2024-08-07T12:34:33.000Z","size":131,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-13T22:17:09.764Z","etag":null,"topics":["coil","kotlin-android","retrofit2","xml"],"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/OkelloSam21.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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-08-06T09:18:09.000Z","updated_at":"2024-08-07T12:43:51.000Z","dependencies_parsed_at":"2024-11-14T06:27:11.370Z","dependency_job_id":"d0aacbc4-c3f5-4566-9353-ce0728f8ed1e","html_url":"https://github.com/OkelloSam21/ChatWise-Assignment","commit_stats":null,"previous_names":["okellosam21/chatwise-assignment"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OkelloSam21%2FChatWise-Assignment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OkelloSam21%2FChatWise-Assignment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OkelloSam21%2FChatWise-Assignment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OkelloSam21%2FChatWise-Assignment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OkelloSam21","download_url":"https://codeload.github.com/OkelloSam21/ChatWise-Assignment/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241653104,"owners_count":19997602,"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":["coil","kotlin-android","retrofit2","xml"],"created_at":"2024-11-14T06:26:14.709Z","updated_at":"2025-03-03T11:22:02.320Z","avatar_url":"https://github.com/OkelloSam21.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# Chatwise Assignment\r\n\r\nThis project is an Android application that displays a list of products and their details. It uses Retrofit for network requests, Gson for JSON serialization/deserialization, and Coil for image loading.\r\n\r\n## Features\r\n\r\n- Fetches a list of products from a remote API.\r\n- Displays the list of products in a `RecyclerView`.\r\n- Shows product details in a separate activity when a product is clicked.\r\n\r\n## Technologies Used\r\n\r\n- Kotlin\r\n- Retrofit\r\n- Gson\r\n- Coil\r\n- AndroidX Libraries\r\n- Coroutines\r\n\r\n## Project Structure\r\n\r\n```\r\napp/\r\n├── src/\r\n│   ├── main/\r\n│   │   ├── java/com/samuelokello/chatwiseassignment/\r\n│   │   │   ├── data/\r\n│   │   │   │   └── remote/\r\n│   │   │   │       └── ApiService.kt\r\n│   │   │   ├── domain/\r\n│   │   │   │   └── ProductRepository.kt\r\n│   │   │   ├── ui/\r\n│   │   │   │   ├── ProductAdapter.kt\r\n│   │   │   │   ├── ProductDetailActivity.kt\r\n│   │   │   │   └── ProductListActivity.kt\r\n│   │   │   └── Product.kt\r\n│   │   ├── res/\r\n│   │   │   ├── layout/\r\n│   │   │   │   ├── activity_product_detail.xml\r\n│   │   │   │   ├── activity_product_list.xml\r\n│   │   │   │   └── product_item.xml\r\n│   │   │   └── values/\r\n│   │   │       └── strings.xml\r\n│   └── build.gradle\r\n└── build.gradle\r\n```\r\n\r\n## Getting Started\r\n\r\n### Prerequisites\r\n\r\n- Android Studio\r\n- Kotlin 1.5+\r\n- Gradle 7.0+\r\n\r\n### Installation\r\n\r\n1. Clone the repository:\r\n    ```sh\r\n    git clone https://github.com/OkelloSam21/chatwise-assignment.git\r\n    ```\r\n2. Open the project in Android Studio.\r\n3. Sync the project with Gradle files.\r\n\r\n### Running the App\r\n\r\n1. Connect an Android device or start an emulator.\r\n2. Click on the \"Run\" button in Android Studio.\r\n\r\n## Code Overview\r\n\r\n### `ApiService`\r\n\r\nDefines the API endpoints using Retrofit.\r\n\r\n```kotlin\r\ninterface ApiService {\r\n    @GET(\"products\")\r\n    suspend fun getProducts(): ProductResponse\r\n}\r\n```\r\n\r\n### `ProductRepository`\r\n\r\nHandles data operations and provides a clean API for data access to the rest of the application.\r\n\r\n```kotlin\r\nclass ProductRepository {\r\n    private val apiService: ApiService = // initialize Retrofit service\r\n\r\n    suspend fun getProducts(): List\u003cProduct\u003e {\r\n        return apiService.getProducts().products\r\n    }\r\n}\r\n```\r\n\r\n### `ProductListActivity`\r\n\r\nDisplays a list of products using a `RecyclerView`.\r\n\r\n```kotlin\r\nclass ProductListActivity : AppCompatActivity() {\r\n    // Implementation details\r\n}\r\n```\r\n\r\n### `ProductDetailActivity`\r\n\r\nDisplays the details of a selected product.\r\n\r\n```kotlin\r\nclass ProductDetailActivity : AppCompatActivity() {\r\n    // Implementation details\r\n}\r\n```\r\n\r\n### `ProductAdapter`\r\n\r\nAdapter for the `RecyclerView` in `ProductListActivity`.\r\n\r\n```kotlin\r\nclass ProductAdapter(\r\n    private var products: List\u003cProduct\u003e,\r\n    private val onItemClick: (Product) -\u003e Unit\r\n) : RecyclerView.Adapter\u003cProductAdapter.ProductViewHolder\u003e() {\r\n    // Implementation details\r\n}\r\n```\r\n\r\n## Screenshots\r\n![image](https://github.com/user-attachments/assets/601fa3d9-ade9-4a5b-8eda-85d0338bcac5)\r\n![image](https://github.com/user-attachments/assets/fac4b6b9-3b66-4825-b7f0-c567bff239a6)\r\n![image](https://github.com/user-attachments/assets/75d97d16-9ead-4656-bb6e-1fddf06635e0)\r\n\r\n\r\n\r\nThis project is licensed under the MIT License. See the `LICENSE` file for details.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokellosam21%2Fchatwise-assignment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fokellosam21%2Fchatwise-assignment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokellosam21%2Fchatwise-assignment/lists"}