# ved-asole/ekart-ecommerce-app architecture

> Architecture diagram of the GitHub repository ved-asole/ekart-ecommerce-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ved-asole/ekart-ecommerce-app
- Repository: https://github.com/ved-asole/ekart-ecommerce-app

## Overview

##### Main System Components

a) Frontend Layer (React Application)
- Sub-components:
- User Interface Components
- Admin Interface Components
- Redux Store
- Authentication Layer

b) Backend Services (mentioned as Spring Boot in README)
- Endpoints for:
- User Management
- Product Management
- Order Management
- Category Management

c) External Services
- Payment Gateway Integration
- Authentication Service
- Image Storage Service

##### Component Relationships

a) Data Flow

b) State Management
- Cart Slice
- Products Slice
- Categories Slice
- Orders Slice
- Top Deals Slice

##### Detailed Component Breakdown

Frontend Architecture:
- Pages Layer
- Public Pages (Home, Products, Cart)
- Protected Pages (Orders, Profile)
- Admin Pages (Dashboard, Management)
- Components Layer
- Common Components
- Feature Components
- Admin Components
- Redux Layer
- Store
- Slices
- Utils Layer
- Authentication
- Data Fetching
- Common Utils

##### Technical Stack Indicators

Technology badges for:
- React + Vite
- Redux Toolkit
- Bootstrap
- Axios
- Spring Boot (Backend)
- Payment Gateway Integration

##### Deployment Architecture

Deployment-related components:
- Netlify hosting (as mentioned in README)
- CI/CD pipeline (GitHub Actions)
- SonarCloud integration
- Better Stack monitoring

This system design should effectively communicate both the overall architecture and the specific implementation details of this e-commerce platform, making it valuable for both high-level understanding and detailed development work.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        UI["Frontend (React + Vite)"]
        Pages["Pages Layer"]
        Components["Components Layer"]
        ReduxLayer["Redux Layer"]
        AuthLayer["Authentication Layer"]
        Utils["Utils Layer"]

        UI --> Pages
        UI --> Components
        UI --> ReduxLayer
        UI --> AuthLayer
        UI --> Utils

        subgraph Pages
            PublicPages["Public Pages"]
            ProtectedPages["Protected Pages"]
            AdminPages["Admin Pages"]
        end

        subgraph Components
            CommonComp["Common Components"]
            FeatureComp["Feature Components"]
            AdminComp["Admin Components"]
        end

        subgraph ReduxLayer
            Store["Redux Store"]
            CartSlice["Cart Slice"]
            ProductsSlice["Products Slice"]
            CategoriesSlice["Categories Slice"]
            OrdersSlice["Orders Slice"]
            TopDealsSlice["Top Deals Slice"]

            Store --> CartSlice
            Store --> ProductsSlice
            Store --> CategoriesSlice
            Store --> OrdersSlice
            Store --> TopDealsSlice
        end
    end

    subgraph Backend
        API["Backend (Spring Boot API)"]
        UserMgmt["User Management"]
        ProductMgmt["Product Management"]
        OrderMgmt["Order Management"]
        CategoryMgmt["Category Management"]

        API --> UserMgmt
        API --> ProductMgmt
        API --> OrderMgmt
        API --> CategoryMgmt
    end

    subgraph ExternalServices
        Payment["Payment Gateway"]
        Auth["Authentication Service"]
        Storage["Image Storage Service"]
    end

    subgraph Deployment
        Netlify["Netlify Hosting"]
        CICD["CI/CD Pipeline"]
        SonarCloud["SonarCloud"]
        Monitoring["Better Stack"]
    end

    UI <--> API
    API <--> ExternalServices
    UI <--> ExternalServices

    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef external fill:#f1c40f,stroke:#f39c12,color:black
    classDef deployment fill:#e74c3c,stroke:#c0392b,color:white

    class UI,Pages,Components,ReduxLayer,AuthLayer,Utils frontend
    class API,UserMgmt,ProductMgmt,OrderMgmt,CategoryMgmt backend
    class Payment,Auth,Storage external
    class Netlify,CICD,SonarCloud,Monitoring deployment

    %% Click events for component mapping
    click UI "https://github.com/ved-asole/eKart-ecommerce-app/blob/master/src/App.jsx"
    click Pages "https://github.com/ved-asole/eKart-ecommerce-app/tree/master/src/pages"
    click PublicPages "https://github.com/ved-asole/eKart-ecommerce-app/blob/master/src/pages/Home.jsx"
    click ProtectedPages "https://github.com/ved-asole/eKart-ecommerce-app/blob/master/src/pages/Orders.jsx"
    click AdminPages "https://github.com/ved-asole/eKart-ecommerce-app/blob/master/src/pages/AdminPanel.jsx"
    click CommonComp "https://github.com/ved-asole/eKart-ecommerce-app/tree/master/src/components/common"
    click FeatureComp "https://github.com/ved-asole/eKart-ecommerce-app/tree/master/src/components/products"
    click AdminComp "https://github.com/ved-asole/eKart-ecommerce-app/tree/master/src/components/admin"
    click Store "https://github.com/ved-asole/eKart-ecommerce-app/blob/master/src/redux/store.js"
    click CartSlice "https://github.com/ved-asole/eKart-ecommerce-app/blob/master/src/redux/slices/cartSlice.js"
    click ProductsSlice "https://github.com/ved-asole/eKart-ecommerce-app/blob/master/src/redux/slices/productsSlice.js"
    click CategoriesSlice "https://github.com/ved-asole/eKart-ecommerce-app/blob/master/src/redux/slices/categoriesSlice.js"
    click OrdersSlice "https://github.com/ved-asole/eKart-ecommerce-app/blob/master/src/redux/slices/orderSlice.js"
    click TopDealsSlice "https://github.com/ved-asole/eKart-ecommerce-app/blob/master/src/redux/slices/topDealsSlice.js"
    click AuthLayer "https://github.com/ved-asole/eKart-ecommerce-app/tree/master/src/components/auth"
    click Utils "https://github.com/ved-asole/eKart-ecommerce-app/blob/master/src/util/appUtil.js"
    click CICD "https://github.com/ved-asole/eKart-ecommerce-app/blob/master/.github/workflows/build-checks.yml"
    click SonarCloud "https://github.com/ved-asole/eKart-ecommerce-app/blob/master/.github/workflows/sonarcloud.yml"
```
