How rahul-badgujar/eshopee-flutter-ecommerce-app works
Project type and purpose
• This is a full-stack mobile eCommerce application built with Flutter for the UI and Firebase (Auth, Cloud Firestore, Storage) as the backend. Its purpose is to let users browse products, manage carts and addresses, place mock orders, upload products, and handle user profile operations.
File structure
• Top-level:
• android/ & ios/ – native project wrappers for Android and iOS platform integration and packaging
• lib/ – Dart source, organized into:
– components/ (reusable widgets)
– screens/ (one folder per feature/screen, each with sub-folders for UI, forms, provider models)
– services/ (Authentication, Data Streams, Firestore DB helpers, Storage access, Local file access)
– models/ (domain objects: Product, CartItem, User, etc.)
– wrappers/ (authentication state wrapper)
– exceptions/ (error handling for FirebaseAuth and file handling)
– app.dart & main.dart (entry points), theme, constants, utils, size_config
README
• Confirms the use of Flutter + Firebase (Auth, Firestore, Storage).
• Highlights features: authentication, product CRUD, categories, cart, favorites, orders, reviews, address management.
• No custom backend—the app communicates directly with Firebase SDKs.
Main components & their interactions
a. Presentation Layer (UI)
– lib/screens/*: Widgets for sign-in, sign-up, home, product details, cart, orders, profile screens
– lib/components/*: Reusable UI parts (buttons, fields, cards)
b. State Management / ViewModels
– provider_models under certain screens: hold screen state, expose data streams and service calls to UI
– authentification_wrapper: bootstraps user auth state before rendering app
c. Service Layer
– AuthenticationService: wraps Firebase Auth operations (sign-in, sign-up, reauth, password reset)
– DataStreams: subscribe to Firestore collections (products, cart items, orders, favorites, addresses)
– DatabaseHelpers: perform CRUD on Firestore documents (products, reviews, users)
– FirestoreFilesAccessService: upload/download product images to Firebase Storage
– LocalFilesAccessService: pick images from device for uploads
d. Data Layer
– Models (Product, CartItem, Address, Review, etc.) represent Firestore documents
e. External Services
– Firebase Authentication, Cloud Firestore, Firebase Storage
f. Platform Integration
– Android and iOS folders: Gradle, Xcode projects for building, plus platform-specific configuration (google-services.json, Info.plist, CocoaPods)
Architectural patterns & principles
• MVVM-style layering: UI (View) → Provider Models (ViewModel) → Services/Models (Model)
• Reactive streams: DataStreams classes use Firestore’s real-time listeners to push updates to UI
• Separation of concerns: UI components know nothing about how data is fetched; they rely on provider models and services
• Single-source services: each service is a singleton or static instance, injectable into provider models