# palanikannan1437/salesmigo architecture

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

- Interactive diagram: https://gitdiagram.com/palanikannan1437/salesmigo
- Repository: https://github.com/palanikannan1437/salesmigo

## Overview

##### Main System Components

a) Frontend Layer (Next.js Application):
- Landing Pages (Home, Features, Pricing, Contact)
- Dashboard Systems (Customer & Employee)
- Face Detection Components
- Authentication UI
- Real-time Components (WebSocket clients)

b) AI/ML Processing Layer:
- Face Detection Models
- Emotion Analysis
- Gesture Recognition
- Customer Tracking

c) Backend Services:
- Authentication Service (NextAuth.js)
- API Routes
- WebSocket Server
- Data Processing Services

d) External Services:
- Google OAuth
- AWS Services
- Vercel Deployment

##### Component Relationships

- WebSocket connections for real-time features

##### Specific Implementation Details

Create sub-sections showing:
a) Frontend Architecture:
- Components structure (/components directory)
- Page routing (/pages directory)
- State management (auth-context, modal-context)

b) AI Processing Pipeline:
- Model loading from /public/models
- Face detection flow
- Emotion analysis pipeline
- Gesture recognition system

##### Technical Stack Indicators

Technology badges for:
- Next.js/React
- face-api.js
- TensorFlow.js
- Styled Components
- WebSocket
- AWS

##### Deployment Flow

Deployment pipeline:
- Development environment
- Build process
- Vercel deployment
- AWS integration

##### External Services Layer

- Real-time nature of the system
- AI model integration points
- Clear separation between customer and employee flows
- Error handling and fallback paths
- Document WebSocket connection points
- Model loading and initialization process

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph UI
        FE[Frontend Layer]
        LP["Landing Pages"]:::frontend
        CD["Customer Dashboard"]:::frontend
        ED["Employee Dashboard"]:::frontend
        AU["Authentication UI"]:::frontend
        RT["Real-time Components"]:::frontend
        
        FE --> LP
        FE --> CD
        FE --> ED
        FE --> AU
        FE --> RT
    end

    subgraph AI
        FDM["Face Detection Models"]:::ai
        EA["Emotion Analysis"]:::ai
        GR["Gesture Recognition"]:::ai
        CT["Customer Tracking"]:::ai
        
        FDM --> EA
        FDM --> GR
        EA --> CT
        GR --> CT
    end

    subgraph BE
        AS["Authentication Service"]:::backend
        API["API Routes"]:::backend
        WS["WebSocket Server"]:::backend
        DP["Data Processing"]:::backend
        
        AS --> API
        WS --> DP
        API --> DP
    end

    subgraph EXT
        GO["Google OAuth"]:::external
        AWS["AWS Services"]:::external
        VD["Vercel Deployment"]:::external
    end

    subgraph SM[State Management]
        AC["Auth Context"]:::state
        MC["Modal Context"]:::state
    end

    subgraph SYS[System Components]
        CAS["Customer Allocation"]:::system
        WAS["Worker Allocation"]:::system
        FM["File Management"]:::system
    end

    FE <--> BE
    BE <--> AI
    BE <--> EXT
    FE <--> SM
    BE <--> SYS

    classDef frontend fill:#3498db
    classDef ai fill:#2ecc71
    classDef backend fill:#e74c3c
    classDef external fill:#9b59b6
    classDef state fill:#f1c40f
    classDef system fill:#e67e22

    click AS "https://github.com/Palanikannan1437/Salesmigo/blob/main/pages/api/auth/[...nextauth].js"
    click FDM "https://github.com/Palanikannan1437/Salesmigo/blob/main/components/FaceDetection/FaceDetection.jsx"
    click EA "https://github.com/Palanikannan1437/Salesmigo/blob/main/components/FaceDetection/EmotionDetection.jsx"
    click GR "https://github.com/Palanikannan1437/Salesmigo/blob/main/components/FaceDetection/GestureDetection.jsx"
    click FDM "https://github.com/Palanikannan1437/Salesmigo/tree/main/public/models/"
    click WS "https://github.com/Palanikannan1437/Salesmigo/blob/main/utils/socket.js"
    click AC "https://github.com/Palanikannan1437/Salesmigo/blob/main/store/auth-context.js"
    click MC "https://github.com/Palanikannan1437/Salesmigo/blob/main/store/modal-context.js"
    click CD "https://github.com/Palanikannan1437/Salesmigo/blob/main/components/Dashboard/CustomerDashboard.jsx"
    click ED "https://github.com/Palanikannan1437/Salesmigo/blob/main/components/Dashboard/EmployeeDashboard.jsx"
    click LP "https://github.com/Palanikannan1437/Salesmigo/tree/main/views/HomePage/"
    click CAS "https://github.com/Palanikannan1437/Salesmigo/blob/main/components/CustomerAllocation/CustomerAllocation.jsx"
    click WAS "https://github.com/Palanikannan1437/Salesmigo/blob/main/components/WorkerAllocation/WorkerAllocation.jsx"
    click FM "https://github.com/Palanikannan1437/Salesmigo/tree/main/components/Files/"
    click AU "https://github.com/Palanikannan1437/Salesmigo/blob/main/components/Login.jsx"
    click API "https://github.com/Palanikannan1437/Salesmigo/tree/main/pages/api/"
    click FE "https://github.com/Palanikannan1437/Salesmigo/tree/main/pages/"
```
