# bsdaoquang/kanban-shopping-app architecture

> Architecture diagram of the GitHub repository bsdaoquang/kanban-shopping-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bsdaoquang/kanban-shopping-app
- Repository: https://github.com/bsdaoquang/kanban-shopping-app

## Overview

##### Main Architecture Components

A. Frontend Layer (Client-Side)
- Next.js Application (Primary container)
- Pages & Routing System
- Components Library
- Redux State Management

B. Services Layer
- API Integration
- Firebase Services
- Authentication System

C. External Services
- Payment Processing
- File Storage (for images)

##### Detailed Component Breakdown

A. Frontend Architecture:
- Pages Layer
- Public Pages (Home, Search, Story)
- Auth Pages (Login, Signup)
- Product Pages (Catalog, Details)
- Shop Pages (Cart, Checkout)
- Profile Pages

- Component Layer
- Shared Components
- Layout Components
- Feature-specific Components

- State Management
- Redux Store
- Auth Reducer
- Cart Reducer

B. Services Integration:
- API Layer
- Axios Client
- API Handlers

- Firebase Integration
- Firebase Config

##### Key Relationships to Highlight

- How the Redux store connects to both auth and cart management
- Relationship between pages and their corresponding components
- Demonstrate API integration points with the frontend
- Authentication flow through Firebase
- Payment processing flow in the checkout process

##### Technical Stack Indicators

- Next.js
- TypeScript
- Redux
- Firebase
- Axios
- Payment processing integration

##### Data Flow Visualization

- User authentication flow
- Shopping cart operations
- Checkout process
- Product browsing and filtering
- Search functionality

- Component hierarchy
- Data flow patterns
- Service integration points
- State management
- Authentication and authorization flow
- Payment processing pipeline

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Frontend Layer"
        NextApp["Next.js Application"]
        
        subgraph "Pages"
            PublicPages["Public Pages"]:::pages
            AuthPages["Auth Pages"]:::pages
            ProductPages["Product Pages"]:::pages
            ShopPages["Shop Pages"]:::pages
            ProfilePages["Profile Pages"]:::pages
        end
        
        subgraph "Components"
            SharedComp["Shared Components"]:::component
            LayoutComp["Layout Components"]:::component
            FeatureComp["Feature Components"]:::component
        end
        
        subgraph "State Management"
            ReduxStore["Redux Store"]:::state
            AuthReducer["Auth Reducer"]:::state
            CartReducer["Cart Reducer"]:::state
        end
    end
    
    subgraph "Services Layer"
        subgraph "API Integration"
            AxiosClient["Axios Client"]:::api
            APIHandlers["API Handlers"]:::api
        end
        
        subgraph "Firebase Services"
            FirebaseConfig["Firebase Config"]:::firebase
        end
        
        subgraph "Payment Processing"
            CreditCard["Credit Card Payment"]:::payment
            PaymentMethod["Payment Method"]:::payment
            ShippingAddr["Shipping Address"]:::payment
        end
    end
    
    subgraph "Models"
        ProductModel["Product Models"]:::model
        ProfileModel["Profile Models"]:::model
        ReviewModel["Review Models"]:::model
    end
    
    %% Relationships
    NextApp --> PublicPages
    NextApp --> AuthPages
    NextApp --> ProductPages
    NextApp --> ShopPages
    NextApp --> ProfilePages
    
    PublicPages --> SharedComp
    AuthPages --> SharedComp
    ProductPages --> SharedComp
    ShopPages --> SharedComp
    ProfilePages --> SharedComp
    
    PublicPages --> LayoutComp
    AuthPages --> LayoutComp
    ProductPages --> LayoutComp
    ShopPages --> LayoutComp
    ProfilePages --> LayoutComp
    
    ProductPages --> FeatureComp
    ShopPages --> FeatureComp
    
    ReduxStore --> AuthReducer
    ReduxStore --> CartReducer
    
    ShopPages --> PaymentMethod
    PaymentMethod --> CreditCard
    ShopPages --> ShippingAddr
    
    APIHandlers --> AxiosClient
    AuthPages --> FirebaseConfig
    
    %% Click Events
    click PublicPages "https://github.com/bsdaoquang/kanban-shopping-app/tree/main/src/pages"
    click AuthPages "https://github.com/bsdaoquang/kanban-shopping-app/tree/main/src/pages/auth"
    click ProductPages "https://github.com/bsdaoquang/kanban-shopping-app/tree/main/src/pages/products"
    click ShopPages "https://github.com/bsdaoquang/kanban-shopping-app/tree/main/src/pages/shop"
    click ProfilePages "https://github.com/bsdaoquang/kanban-shopping-app/tree/main/src/pages/profile"
    click SharedComp "https://github.com/bsdaoquang/kanban-shopping-app/blob/main/src/components/Section.tsx"
    click LayoutComp "https://github.com/bsdaoquang/kanban-shopping-app/blob/main/src/components/HeaderComponent.tsx"
    click FeatureComp "https://github.com/bsdaoquang/kanban-shopping-app/blob/main/src/components/ProductItem.tsx"
    click ReduxStore "https://github.com/bsdaoquang/kanban-shopping-app/blob/main/src/redux/store.ts"
    click AuthReducer "https://github.com/bsdaoquang/kanban-shopping-app/blob/main/src/redux/reducers/authReducer.ts"
    click CartReducer "https://github.com/bsdaoquang/kanban-shopping-app/blob/main/src/redux/reducers/cartReducer.ts"
    click AxiosClient "https://github.com/bsdaoquang/kanban-shopping-app/blob/main/src/apis/axiosClient.ts"
    click APIHandlers "https://github.com/bsdaoquang/kanban-shopping-app/blob/main/src/apis/handleApi.ts"
    click FirebaseConfig "https://github.com/bsdaoquang/kanban-shopping-app/blob/main/src/firebase/firebaseConfig.ts"
    click CreditCard "https://github.com/bsdaoquang/kanban-shopping-app/blob/main/src/pages/shop/components/CreditCardPayment.tsx"
    click PaymentMethod "https://github.com/bsdaoquang/kanban-shopping-app/blob/main/src/pages/shop/components/PaymentMethod.tsx"
    click ShippingAddr "https://github.com/bsdaoquang/kanban-shopping-app/blob/main/src/pages/shop/components/ShipingAddress.tsx"
    click ProductModel "https://github.com/bsdaoquang/kanban-shopping-app/blob/main/src/models/Products.ts"
    click ProfileModel "https://github.com/bsdaoquang/kanban-shopping-app/blob/main/src/models/ProfileModel.ts"
    click ReviewModel "https://github.com/bsdaoquang/kanban-shopping-app/blob/main/src/models/ReviewModel.ts"
    
    %% Styles
    classDef pages fill:#2196F3,color:white
    classDef component fill:#4CAF50,color:white
    classDef state fill:#FF9800,color:white
    classDef api fill:#9C27B0,color:white
    classDef firebase fill:#FF5722,color:white
    classDef payment fill:#795548,color:white
    classDef model fill:#607D8B,color:white
```
