# mahmud0808/nexaracart architecture

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

- Interactive diagram: https://gitdiagram.com/mahmud0808/nexaracart
- Repository: https://github.com/mahmud0808/nexaracart

## Overview

##### Project type and purpose
- Full-stack eCommerce platform
- Two Flutter-based clients:
– Admin Panel (desktop/web Flutter)
– Customer App “NexaraCart” (mobile/desktop/web Flutter)
- Node.js/Express backend with MongoDB persistence
- External integrations: Stripe/Razorpay for payments, OneSignal for push notifications

##### File structure
- Top-level directories:
– server_side/ : Express entrypoint (index.js), Mongoose models, REST routes, file‐upload helper, payment route
– client_side/admin_panel/ : Flutter project for admin—lib/core, lib/screens, lib/services, lib/widgets, platform config for Android/iOS/macOS/Windows/web
– client_side/nexara_cart/ : Flutter customer app—lib/core, lib/screen, lib/services, lib/widget, platform config for Android/iOS/macOS/Windows/web
- Server side organizes by “model” and “routes” (MVC-style)
- Client side organizes by feature folders (screens + providers) and shared utilities
- Configuration and build scripts: package.json, pubspec.yaml, platform config files

##### README
- Confirms a production‐ready eCommerce app
- Client apps use Flutter + Provider for state management
- Backend is Node.js v18 + npm, using MongoDB connection via .env
- Guides for running server and clients

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        subgraph "Admin Panel (Flutter desktop/web)"
            AdminCore["Core Module"]:::client
            AdminUI["UI Layer: lib/screens"]:::client
            AdminSvc["HTTP Services"]:::client
            AdminState["State Management (Provider)"]:::client
            click AdminCore "https://github.com/mahmud0808/nexaracart/tree/main/client_side/admin_panel/lib/core/"
            click AdminUI "https://github.com/mahmud0808/nexaracart/tree/main/client_side/admin_panel/lib/screens/"
            click AdminSvc "https://github.com/mahmud0808/nexaracart/blob/main/client_side/admin_panel/lib/services/http_services.dart"
            click AdminState "https://github.com/mahmud0808/nexaracart/tree/main/client_side/admin_panel/lib/screens/"
        end
        subgraph "Customer App (NexaraCart)"
            CustCore["Core Module"]:::client
            CustUI["UI Layer: lib/screen"]:::client
            CustSvc["HTTP Services"]:::client
            CustState["State Management (Provider)"]:::client
            click CustCore "https://github.com/mahmud0808/nexaracart/tree/main/client_side/nexara_cart/lib/core/"
            click CustUI "https://github.com/mahmud0808/nexaracart/tree/main/client_side/nexara_cart/lib/screen/"
            click CustSvc "https://github.com/mahmud0808/nexaracart/blob/main/client_side/nexara_cart/lib/services/http_services.dart"
            click CustState "https://github.com/mahmud0808/nexaracart/tree/main/client_side/nexara_cart/lib/screen/"
        end
    end

    %% API Layer
    subgraph "API Layer (Express.js)"
        APIServer["Express Entrypoint"]:::backend
        RoutesGroup["Routes Handlers"]:::backend
        ModelsGroup["Mongoose Models"]:::backend
        UploadHelper["File Upload Helper"]:::backend
        PaymentRoute["Payment Route"]:::backend
        NotificationRoute["Notification Route"]:::backend
        click APIServer "https://github.com/mahmud0808/nexaracart/blob/main/server_side/index.js"
        click RoutesGroup "https://github.com/mahmud0808/nexaracart/tree/main/server_side/routes/"
        click ModelsGroup "https://github.com/mahmud0808/nexaracart/tree/main/server_side/model/"
        click UploadHelper "https://github.com/mahmud0808/nexaracart/blob/main/server_side/uploadFile.js"
        click PaymentRoute "https://github.com/mahmud0808/nexaracart/blob/main/server_side/routes/payment.js"
        click NotificationRoute "https://github.com/mahmud0808/nexaracart/blob/main/server_side/routes/notification.js"
    end

    %% Database
    DB["MongoDB"]:::db

    %% External Services
    subgraph "External Services"
        Stripe["Stripe / Razorpay"]:::external
        OneSignal["OneSignal"]:::external
    end

    %% Connections
    AdminCore -->|uses| APIServer
    AdminUI -->|calls API| APIServer
    AdminSvc -->|sends requests| APIServer
    AdminState -->|manages state| AdminUI

    CustCore -->|uses| APIServer
    CustUI -->|calls API| APIServer
    CustSvc -->|sends requests| APIServer
    CustState -->|manages state| CustUI

    APIServer -->|routes to| RoutesGroup
    RoutesGroup -->|uses| ModelsGroup
    RoutesGroup -->|invokes| UploadHelper
    RoutesGroup -->|invokes| PaymentRoute
    RoutesGroup -->|invokes| NotificationRoute

    APIServer -->|read/write| DB

    APIServer -->|process payment| Stripe
    APIServer -->|send notification| OneSignal

    %% Styles
    classDef client fill:#D6EAF8,stroke:#21618C,color:#1B4F72
    classDef backend fill:#D5F5E3,stroke:#1D8348,color:#145A32
    classDef db fill:#FCF3CF,stroke:#B7950B,color:#7D6608
    classDef external fill:#FADBD8,stroke:#C0392B,color:#78281F
```
