Skip to content

vanard/VShop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

183 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

VShop

Screenshot 2025-04-06 at 13 19 34

Features

  • Authentication System - Complete login and signup functionality with validation
  • Clean Architecture - Multi-module structure following clean architecture principles
  • MVVM Pattern - Reactive UI with ViewModels and state management
  • User Profile Management - View and manage authenticated user profiles
  • Shopping Cart - Add/remove products with local persistence
  • Wishlist - Save favorite products for later
  • Guest Mode - Continue shopping without authentication
  • Product Catalog - Browse and search products with filtering
  • Modern UI - Beautiful Jetpack Compose UI with Material Design 3

Architecture

VShop follows Clean Architecture principles with clear separation of concerns:

  • Domain Layer: Pure Kotlin business logic, entities, and use cases
  • Data Layer: Repository implementations, local database, and network calls
  • Presentation Layer: ViewModels, Compose UI, and navigation

πŸ“š See detailed architecture documentation

Tech Stack

  • Language: Kotlin
  • Architecture: Clean Architecture + MVVM
  • UI: Jetpack Compose + Material Design 3
  • DI: Hilt
  • Database: Room
  • Preferences: DataStore
  • Image Loading: Coil
  • Navigation: Navigation Compose
  • Async: Coroutines + Flow
  • Modularization: Multi-module structure
  • State Management: StateFlow + Compose State

Module Structure

β”œβ”€β”€ app/                 # Main application module
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ common/         # Shared utilities and constants
β”‚   β”œβ”€β”€ ui/             # Shared UI components and theme
β”‚   └── resources/      # Shared resources
β”œβ”€β”€ domain/             # Business logic (pure Kotlin)
β”œβ”€β”€ data/               # Data layer implementation
└── feature/            # Feature-specific UI and ViewModels

Demo Credentials

For testing the login functionality, you can use:

Or create a new account using the signup feature.

Key Features

πŸ” Authentication

  • Email/password login with validation
  • User registration with comprehensive validation
  • Secure session management with DataStore
  • Guest mode for non-authenticated users

πŸ›οΈ Shopping Experience

  • Product browsing and search
  • Category filtering
  • Add to cart/wishlist functionality
  • Shopping cart management

πŸ‘€ User Profile

  • View user information
  • Authentication status
  • Logout functionality
  • Profile management options

πŸ—οΈ Architecture Benefits

  • Testable: Easy unit testing with pure domain layer
  • Maintainable: Clear separation of concerns
  • Scalable: Easy to add new features
  • Framework Independent: Business logic isolated from Android framework

Getting Started

  1. Clone the repository
  2. Open in Android Studio
  3. Build and run the project
  4. Use demo credentials or create a new account

Testing

  • Run unit tests: ./gradlew test
  • Run instrumented tests: ./gradlew connectedAndroidTest

Contributing

  1. Follow the existing architecture patterns
  2. Add unit tests for new business logic
  3. Use the established package structure
  4. Follow clean code principles

Sneak Peek

0427.mp4

VShop

Screenshot 2025-04-06 at 13 19 34

A modern Android e-commerce application built with Clean Architecture and Jetpack Compose.


πŸ—οΈ Architecture

VShop follows Clean Architecture principles with clear separation of concerns:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Presentation Layer (UI)            β”‚
β”‚  β€’ Jetpack Compose β€’ ViewModels β€’ Navigation   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚ depends on
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Domain Layer (Business Logic)      β”‚
β”‚  β€’ Use Cases β€’ Entities β€’ Repository Interfaces β”‚
β”‚  β€’ NO Framework Dependencies (Pure Kotlin)      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚ depends on
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Data Layer (Implementation)        β”‚
β”‚  β€’ Repositories β€’ Database β€’ Network β€’ Cache    οΏ½οΏ½οΏ½
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key Use Cases

1. AuthUseCase (Authentication Operations)

  • βœ… Login / Signup with validation
  • βœ… Logout
  • βœ… Session validation (isUserLoggedIn)
  • βœ… Input validation (email, password)

2. UserUseCase (User Data Operations)

  • βœ… Get current user data
  • βœ… Update user profile
  • βœ… User preferences management
  • βœ… Profile completeness calculation

3. ProductUseCase (Product & Cart Operations)

  • βœ… Browse products (all, by ID, by category)
  • βœ… Manage favorites
  • βœ… Cart operations (add, remove, update quantity)

πŸ“¦ Module Structure

VShop/
β”œβ”€β”€ app/                    # Application module
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ common/            # Shared utilities, constants
β”‚   β”œβ”€β”€ resources/         # Shared resources (colors, strings, icons)
β”‚   └── ui/                # Shared UI components, base classes
β”œβ”€β”€ data/                  # Data layer implementation
β”‚   β”œβ”€β”€ dao/              # Room DAOs
β”‚   β”œβ”€β”€ entities/         # Database entities
β”‚   β”œβ”€β”€ di/               # Dependency injection modules
β”‚   β”œβ”€β”€ mappers/          # Entity ↔ Domain model mappers
β”‚   └── repositoryImpl/   # Repository implementations
β”œβ”€β”€ domain/                # Domain layer (Pure Kotlin)
β”‚   β”œβ”€β”€ model/            # Domain entities
β”‚   β”œβ”€β”€ repository/       # Repository interfaces
β”‚   β”œβ”€β”€ usecase/          # Business logic use cases
β”‚   └── validation/       # Domain validation logic
└── feature/               # Feature modules (UI)
    β”œβ”€β”€ auth/             # Login, Signup screens
    β”œβ”€β”€ home/             # Home screen
    β”œβ”€β”€ cart/             # Cart screen
    β”œβ”€β”€ favorite/         # Favorites screen
    └── profile/          # Profile screen

πŸš€ Getting Started

Prerequisites

  • Android Studio Hedgehog or later
  • JDK 17 or higher
  • Android SDK 34

Build & Run

git clone https://github.com/yourusername/VShop.git
cd VShop
./gradlew build

Demo Credentials

For testing the login feature, use these credentials:

  • Email: demo@vshop.com
  • Password: demo123

🎯 Key Features

βœ… Implemented

  • πŸ” Complete Authentication System

    • Login / Signup with validation
    • Session management with DataStore
    • Auto-logout on session expiry
  • πŸ‘€ User Profile Management

    • View user information
    • Profile completeness tracking
    • Logout functionality
  • πŸ›’ Product Browsing

    • Product catalog
    • Product details
    • Favorites management
  • πŸ›οΈ Shopping Cart

    • Add/remove items
    • Quantity management
    • Cart persistence
  • 🎨 Modern UI/UX

    • Material Design 3
    • Consistent color scheme
    • Beautiful animations

πŸ”§ Base Screen System

  • Automatic session handling
  • Auto-redirect to login when needed
  • Easy access to user data in any screen
  • Loading state management

πŸ“š Documentation


πŸ› οΈ Tech Stack

Architecture

  • Clean Architecture
  • MVVM Pattern
  • Multi-module architecture

UI

  • Jetpack Compose
  • Material Design 3
  • Navigation Component

Dependency Injection

  • Hilt

Database

  • Room Database
  • DataStore (for preferences)

Async

  • Kotlin Coroutines
  • Flow

Code Quality

  • Kotlin DSL
  • Domain-driven design
  • Separation of concerns

🎨 Color Scheme

paint_01: #292526  // Dark - Primary buttons, links
paint_02: #787676  // Medium Gray - Secondary text, icons
paint_03: #A3A1A2  // Light Gray - Borders
paint_04: #F2F2F2  // Very Light Gray - Card backgrounds
paint_05: #121111  // Very Dark - Primary text
White:    #FFFFFF  // Main background, button text

πŸ“± Screens

  1. Onboard Screen - Welcome with login/signup/guest options
  2. Login Screen - Email/password authentication
  3. Sign Up Screen - New user registration
  4. Home Screen - Product catalog with personalized greeting
  5. Cart Screen - Shopping cart management
  6. Favorite Screen - Saved favorite products
  7. Profile Screen - User profile and logout

πŸ§ͺ Testing

# Run unit tests
./gradlew test

# Run instrumented tests
./gradlew connectedAndroidTest

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License.


πŸ‘¨β€πŸ’» Author

Vanard


🌟 Highlights

  • βœ… Production-ready clean architecture
  • βœ… Scalable modular structure
  • βœ… Testable domain layer with no framework dependencies
  • βœ… Maintainable clear separation of concerns
  • βœ… Modern latest Android development practices

Built with ❀️ using Kotlin and Jetpack Compose

About

E-commerce Small Project (On Progress)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages