Skip to content

Repository files navigation

ShopEase 🛍️

A modern, tactile, and highly responsive E-Commerce application built with Flutter and Firebase. ShopEase delivers a seamless shopping experience with elegant "Purple Clay" glassmorphic UI elements and robust state management using Clean Architecture principles.


✨ Key Features

🎨 Tactile & Immersive UI

  • Claymorphism Design System: A custom Material 3 theme incorporating soft, pillowy drop shadows and inner shadows to create a "tactile" 3D button effect.
  • Dynamic "Purple Clay" Palette: Utilizing deep purples, soft slates, and white glassmorphic backgrounds to create a premium shopping environment.
  • Animated Splash Screen: A beautiful 2.5-second sequence using AnimatedBuilder and TweenSequence for bouncing scaling effects and graceful opacity fades before the app initiates.

🔐 Robust Authentication

  • Multi-Provider Support: Seamlessly integrate with Firebase Authentication to offer Email/Password login, Anonymous Guest Login, and structured logic ready for Google Sign-In.
  • Real-Time Route Guards: Integrating a custom GoRouterRefreshStream that continuously monitors the AuthBloc stream, instantly booting unauthenticated users back to the /login screen if a token expires or state changes.

🧭 Advanced Navigation & Deep Linking

  • Declarative Routing: Powered by go_router, allowing for URL-based navigation (/app/products/:productId).
  • Stateful Bottom Navigation: Implementing a ShellRoute alongside an IndexedStack to maintain the scroll positions and state of the Home, Products, and Profile tabs without reloading the widgets on every tab switch.
  • Reactive URL Query Filtering: The Products page dynamically reads URL query parameters (e.g., ?category=electronics) to filter the catalog, making the app deeply linkable and SEO/Web ready.

📦 State Management & Data Flow

  • Predictable Global State: Leveraging flutter_bloc for complex, global states (like Authentication) to guarantee consistent state emission and UI updates.
  • Error Handling via Functional Programming: Utilizing the dartz package to return Either<AuthFailure, User> from repositories. This guarantees that UI widgets gracefully handle all failure edge cases without relying on risky try/catch blocks at the UI level.

🏗️ Clean Architecture

ShopEase strictly adheres to Uncle Bob's Clean Architecture to separate concerns, ensure extreme testability, and completely decouple the UI from external frameworks.

1. Domain Layer (The Core)

The absolute core of the app. It has zero dependencies on Flutter, Firebase, or external APIs.

  • Entities: Pure Dart classes representing core business objects (e.g., User, Product).
  • Failures: Abstract failure classes (e.g., AuthFailure) to represent business errors.
  • Repositories (Interfaces): Abstract contracts defining what data operations are possible, without caring how they are implemented.

2. Data Layer (The Outside World)

Responsible for interacting with APIs, Local Storage, and Firebase.

  • Repository Implementations: Concrete implementations of the Domain interfaces (e.g., AuthRepositoryImpl mapping Firebase calls).
  • Models / DTOs: Data Transfer Objects containing fromJson / toJson factories to translate external, messy API JSON into clean Domain Entities.
  • Exception Mapping: Catches external FirebaseAuthExceptions and translates them into our safe Domain AuthFailure objects.

3. Presentation Layer (The UI)

Responsible for rendering pixels and capturing user input.

  • Pages / Screens: The Flutter StatelessWidget and StatefulWidget classes.
  • State Management (Bloc/Provider): Receives events from the UI, communicates with the Domain layer repositories, and emits new States for the UI to consume via BlocConsumer or BlocBuilder.

🛠️ Technology Stack


🚀 Getting Started

Prerequisites

  • Flutter SDK (stable channel)
  • Dart SDK
  • A Firebase Project (for Authentication & Database services)

Installation & Setup

  1. Clone the repository:

    git clone https://github.com/yourusername/shopease.git
    cd shopease
  2. Install dependencies:

    flutter pub get
  3. Configure Firebase: Ensure you have the Firebase CLI installed. Run the following command to link the app to your Firebase backend:

    flutterfire configure

    (Note: The firebase_options.dart file will be automatically generated in your lib/ directory).

  4. Launch the App:

    flutter run

📂 Project Structure Directory

lib/
├── core/
│   └── theme/
│       └── app_theme.dart          # Centralized Material 3 Theme tokens & Clay shadows
├── features/
│   ├── auth/                       # Authentication Feature
│   │   ├── application/            # AuthBloc, States, and Events
│   │   ├── data/                   # AuthRepositoryImpl, FirebaseAuth integration
│   │   ├── domain/                 # User Entity, AuthFailures, Repository Interfaces
│   │   └── presentation/           # Login, Register, Forgot Password UI screens
│   ├── cart/                       # Shopping Cart Feature
│   ├── checkout/                   # Checkout Flow
│   ├── home/                       # Landing Page / Dashboard with interactive chips
│   ├── orders/                     # Order History
│   ├── products/                   # Product Listing, Details, & Reactive filtering
│   ├── profile/                    # User Settings & Profile
│   └── splash/                     # Custom Animated Boot Screen
├── main.dart                       # App Entry Point, Bloc Providers, & GoRouter Config
└── firebase_options.dart           # Generated Firebase Configuration

🗺️ Roadmap & Future Enhancements

  • Firestore Cart Synchronization: Migrate the local cart state to cloud_firestore to allow users to sync their shopping carts across multiple devices (users/{userId}/cart).
  • Payment Gateway Integration: Wire up Stripe or an equivalent payment processor in the Checkout flow.
  • Advanced Animations: Introduce Hero animations for seamless transitions between the Product List grid and the Product Details screen.
  • Image Caching: Implement cached_network_image to persist product images on disk for offline viewing and performance improvements.

🤝 Contributing

Contributions, issues, and feature requests are welcome! If you're planning to contribute, please ensure you adhere to the Clean Architecture boundaries established in the features/ directory.

About

Open-source Flutter E-Commerce application demonstrating Clean Architecture, flutter_bloc state management, GoRouter deep linking, and Firebase Authentication.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages