GithubHelp home page GithubHelp logo

shoppingapp's Introduction

ShoppingApp

A small-scale Android shopping application demonstrating a modern and scalable architecture using MVVM + Clean Architecture principles, Jetpack Compose for UI, and Room for local storage.

Table of Contents

  • Introduction
  • Features
  • Screenshots
  • Modules
  • Architecture
  • Tech Stack and Dependencies
  • Strong Points
  • License

Introduction

ShoppingApp is a sample Android application designed to demonstrate modern Android development practices. It reads products from a JSON file, writes them into a Room database, and displays the product list using animated Compose views. Users can add items to their cart, view product details on a separate screen, and manage their cart by updating item quantities, removing items, or clearing the cart entirely.

Features

  • Product List: View a list of products with clear and animated Compose views.
  • Product Details: View details of a selected product on a separate screen.
  • Add to Cart: Add products to the cart from the product list or product detail screen.
  • Cart Management: View items in the cart, update item quantities, remove items, and clear the cart.
  • Total Calculation: See the total number of items and the total cost in the cart.

Screenshots

Modules

Modularization is a practice of organizing a codebase into loosely coupled and self contained parts. Each part is a module. Each module is independent and serves a clear purpose. By dividing a problem into smaller and easier to solve subproblems, you reduce the complexity of designing and maintaining a large system. (Source)

Architecture

The application follows a Modern Multi Modular clean architecture approach with MVVM, using the following components:

Presentation Layer

  • ViewModels: Handle UI-related logic and data preparation.
  • UI Components: Built with Jetpack Compose for a reactive and animated UI.

Domain Layer

  • UseCases: Encapsulate business logic and coordinate between repositories and ViewModels.

Data Layer

  • Repositories: Abstract data sources, providing a clean API for data access.
  • Data Sources: Manage local data operations with Room database and JSON parsing.

Dependency Injection

  • Dagger Hilt: Manages dependencies across the application, ensuring a modular and testable codebase.

Utils

  • JsonFileParser: Parses JSON files using Moshi.
  • ResourceHelper: Provides easy access to resources.

Tech Stack and Dependencies

This project leverages several modern libraries and frameworks to ensure scalability, maintainability, and efficiency:

Core Libraries

  • Jetpack Compose: Used for building reactive UIs with animations.
  • Room: Provides an abstraction layer over SQLite to allow fluent database access while harnessing the full power of SQLite.
  • Kotlin Coroutines: Simplifies asynchronous programming with concise code and built-in support for structured concurrency.
  • Dagger Hilt: Simplifies dependency injection in Android apps, making it easier to manage dependencies and improve testability.

Testing Libraries

  • JUnit: A simple framework to write repeatable tests.
  • Mockito: A mocking framework that lets you write tests with a clean and simple API.
  • MockK: A modern mocking library for Kotlin.
  • Google Truth: Provides fluent assertions for testing in Java and Android.

UI Libraries

  • Coil: An image loading library for Android backed by Kotlin Coroutines.
  • Material Components: Implements Material Design to ensure a cohesive visual experience.

JSON Parsing

  • Moshi: A modern JSON library for Android and Java, used for parsing JSON files.

Additional Libraries

  • LeakCanary: A memory leak detection library for Android.
  • AppCompat: Provides backward-compatible versions of Android framework APIs.

Strong Points

  • Clean Architecture: Separation of concerns ensures a scalable and maintainable codebase.
  • Modern UI: Uses Jetpack Compose for a reactive and visually appealing UI with animations.
  • Scalability: Modular architecture with distinct layers and feature modules.
  • Local Storage: Efficiently manages local data storage with Room.
  • Error Handling: Well handled Errors for different cases and states.
  • Asynchronous Operations: Utilizes Kotlin Coroutines and Flows for efficient background processing.
  • Dependency Injection: Dagger Hilt simplifies dependency management and improves testability.
  • Extensive Testing: Detailed unit tests ensure reliability and robustness of the application.

shoppingapp's People

Contributors

oguzhandongul avatar

Watchers

 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.