# khushi17380/fashnow architecture

> Architecture diagram of the GitHub repository khushi17380/fashnow, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/khushi17380/fashnow
- Repository: https://github.com/khushi17380/fashnow

## Overview

##### Project Type and Purpose
- This is a full-stack mobile client: a Flutter-based e-commerce application (“fashnow_”) targeting Android and iOS.
- The repo contains:
- android/ & ios/ folders (platform wrappers, Gradle/Xcode projects, Firebase config)
- lib/ folder (Dart UI and feature modules)
- pubspec.yaml (Flutter dependencies)

##### File-Structure Analysis
- Top-level “android/” and “ios/” directories hold the native shell, build scripts, platform-specific config, and Firebase (google-services.json).
- “lib/” houses all Dart code, organized by feature:
- Address&Payments
- CART (cart & wishlist)
- PRODUCTS (grid & detail pages)
- categories (beauty, kids, men, women)
- Authentication (login_page.dart, sign_in.dart)
- Search, Orders, About & Terms, FirstScreen, main.dart
- There’s no on-repo backend; the app likely consumes REST/Firebase services.

##### Key Insights from README
- Described only as a Flutter e-commerce starter.
- Presence of Firebase config implies use of Firebase Auth/Firestore/Cloud Functions for backend services.

##### Main Components
a. Presentation Layer (Flutter UI Screens)
- Feature modules (ProductGrid, ProductPage, Cart, Wishlist, Address Management, Payment, Orders, Search, Categories, About & Terms)
- main.dart and routing
b. Business Logic / State Management
- Services or BLoCs/Providers (even if not yet implemented, a placeholder for where state lives)
c. Data Layer
- Repositories that wrap API calls or Firebase SDK
d. External Services
- Firebase Auth, Firestore / Realtime Database, Cloud Storage
- Third-party payment gateway (e.g., Stripe or in-app purchase)
- REST/WebSocket APIs (if any)
e. Platform Shell
- Android native wrapper (Gradle, AndroidManifest)
- iOS native wrapper (Xcode project, Info.plist, Swift bridging header)

##### Relationships and Data Flows
- UI → State Management → Repositories → External Services
- Repositories ↔ Firebase SDK or REST API
- UI ↔ Native Platform (push notifications, in-app purchases)
- Initialization path: main.dart bootstraps Flutter Engine, binds to native shell.

##### Architectural Patterns & Principles
- Layered Architecture (Presentation → Domain → Data)
- Feature-driven modularization (each folder in lib/ is a self-contained feature)
- Dependency inversion: UI depends on abstract services; implementations talk to Firebase or HTTP.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Presentation, Domain, Data
    subgraph "Flutter App"
        direction TB
        subgraph "Presentation Layer"
            direction TB
            Main["main.dart"]:::ui
            FS["First Screen"]:::ui
            LoginPage["Login Page"]:::ui
            SignIn["Sign In"]:::ui
            ProdGrid["Product Grid"]:::ui
            ProdPage["Product Detail Page"]:::ui
            Cart["Cart"]:::ui
            Wishlist["Wishlist"]:::ui
            AddAddr["Add Address"]:::ui
            EditAddr["Edit Address"]:::ui
            AddrDetails["Address Details"]:::ui
            PayMethod["Payment Method"]:::ui
            PayDone["Payment Confirmation"]:::ui
            Beauty["Beauty Category"]:::ui
            Kids["Kids Category"]:::ui
            Men["Men Category"]:::ui
            Women["Women Category"]:::ui
            Search["Search"]:::ui
            OrdersList["Orders List"]:::ui
            OrderCartView["Order & Cart View"]:::ui
            ReturnItem["Return Item"]:::ui
            ReturnConfirmed["Return Confirmed"]:::ui
            About["About"]:::ui
            Terms["Terms"]:::ui
        end
        subgraph "Domain Layer"
            direction TB
            Domain["BLoC/Providers"]:::domain
        end
        subgraph "Data Layer"
            direction TB
            DataRepo["Repositories"]:::data
        end
    end

    subgraph "External Services"
        direction TB
        FirebaseAuth["Firebase Auth"]:::external
        Firestore["Firestore/Database"]:::external
        CloudStorage["Cloud Storage"]:::external
        CloudFunctions["Cloud Functions"]:::external
        PaymentGateway["Payment Gateway"]:::external
        RestAPI["REST API"]:::external
    end

    subgraph "Platform Shell"
        direction TB
        Android["Android Native Wrapper"]:::shell
        iOS["iOS Native Wrapper"]:::shell
    end

    %% Connections
    Main -->|boots| Domain
    Domain -->|uses| DataRepo
    DataRepo -->|auth| FirebaseAuth
    DataRepo -->|data| Firestore
    DataRepo -->|storage| CloudStorage
    DataRepo -->|functions| CloudFunctions
    DataRepo -->|payment| PaymentGateway
    DataRepo -->|api calls| RestAPI
    Main -->|platform APIs| Android
    Main -->|platform APIs| iOS

    %% Click Events
    click Main "https://github.com/khushi17380/fashnow/blob/main/lib/main.dart"
    click FS "https://github.com/khushi17380/fashnow/blob/main/lib/FirstScreen.dart"
    click LoginPage "https://github.com/khushi17380/fashnow/blob/main/lib/login_page.dart"
    click SignIn "https://github.com/khushi17380/fashnow/blob/main/lib/sign_in.dart"
    click ProdGrid "https://github.com/khushi17380/fashnow/blob/main/lib/PRODUCTS/productgrid.dart"
    click ProdPage "https://github.com/khushi17380/fashnow/blob/main/lib/PRODUCTS/productpage.dart"
    click Cart "https://github.com/khushi17380/fashnow/blob/main/lib/CART/cart.dart"
    click Wishlist "https://github.com/khushi17380/fashnow/blob/main/lib/CART/wishlist.dart"
    click AddAddr "https://github.com/khushi17380/fashnow/blob/main/lib/Address&Payments/add_address.dart"
    click EditAddr "https://github.com/khushi17380/fashnow/blob/main/lib/Address&Payments/edit_address.dart"
    click AddrDetails "https://github.com/khushi17380/fashnow/blob/main/lib/Address&Payments/address_details.dart"
    click PayMethod "https://github.com/khushi17380/fashnow/blob/main/lib/Address&Payments/payment_method.dart"
    click PayDone "https://github.com/khushi17380/fashnow/blob/main/lib/Address&Payments/payment_done.dart"
    click Beauty "https://github.com/khushi17380/fashnow/blob/main/lib/categories/beauty/beauty.dart"
    click Kids "https://github.com/khushi17380/fashnow/blob/main/lib/categories/kids/kids.dart"
    click Men "https://github.com/khushi17380/fashnow/blob/main/lib/categories/men/men.dart"
    click Women "https://github.com/khushi17380/fashnow/blob/main/lib/categories/women/women.dart"
    click Search "https://github.com/khushi17380/fashnow/blob/main/lib/search/search.dart"
    click OrdersList "https://github.com/khushi17380/fashnow/blob/main/lib/my_orders/my_orders.dart"
    click OrderCartView "https://github.com/khushi17380/fashnow/blob/main/lib/my_orders/order&cartview.dart"
    click ReturnItem "https://github.com/khushi17380/fashnow/blob/main/lib/my_orders/return_item.dart"
    click ReturnConfirmed "https://github.com/khushi17380/fashnow/blob/main/lib/my_orders/return_request_confirmed.dart"
    click About "https://github.com/khushi17380/fashnow/blob/main/lib/about_and_terms/about.dart"
    click Terms "https://github.com/khushi17380/fashnow/blob/main/lib/about_and_terms/terms.dart"
    click Android "https://github.com/khushi17380/fashnow/tree/main/android/"
    click iOS "https://github.com/khushi17380/fashnow/tree/main/ios/Runner"

    %% Styles
    classDef ui fill:#ADD8E6,stroke:#000
    classDef domain fill:#98FB98,stroke:#000
    classDef data fill:#FFA500,stroke:#000
    classDef external fill:#FFFF99,stroke:#000
    classDef shell fill:#D3D3D3,stroke:#000
```
