# mohammedshibilpv0/freelance-x-client architecture

> Architecture diagram of the GitHub repository mohammedshibilpv0/freelance-x-client, 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/mohammedshibilpv0/freelance-x-client
- Repository: https://github.com/mohammedshibilpv0/freelance-x-client

## Overview

##### Main Components

Frontend Architecture:
- Client-Side Components
- User Module
- Admin Module
- Authentication Module
- Payment Module
- Chat Module
- Profile Management
- File Upload System

State Management:
- Redux Store (evident from store directory)
- Admin Store
- User Store

API Layer:
- Axios Instances
- User API Services
- Admin API Services
- Authentication Services

External Services:
- Socket.IO Integration (for real-time chat)
- Payment Gateway
- Google Authentication
- File Storage System (for images/audio)

**┌─────────────────────────────────────────────┐**
- Frontend App                  │
- ┬─────────┬──────────┬─────────────┤
- User   │  Admin  │   Auth   │   Shared    │
- Module  │ Module  │  Module  │ Components  │
- ┴─────────┴──────────┴─────────────┘

**┌─────────────────────────────────────────────┐**
- Feature Modules                 │
- ┬──────────┬──────────┬───────────┤
- Chat    │ Payment  │  Posts   │   Gigs    │
- System   │ Gateway  │ Manager  │ Manager   │
- ┴──────────┴──────────┴───────────┘

**┌─────────────────────────────────────────────┐**
- Services & Integration            │
- ┬──────────┬──────────┬───────────┤
- Socket  │  Redux   │  Axios   │  External │
- IO     │  Store   │  Layer   │ Services  │
- ┴──────────┴──────────┴───────────┘

##### Important Elements to Highlight

Protected Routes:
- Routing structure with protected routes for both admin and client
- Authentication flow

API Integration:
- Separation between admin and user API services
- How axios instances are configured

Real-time Features:
- WebSocket connections for chat
- Audio/video call integration

State Management:
- Redux store structure
- State flow between components

##### Specific Implementation Details

- The separation between admin and user interfaces
- The chat system's real-time capabilities
- The payment processing workflow
- The file handling system for images and audio
- The authentication flow including Google Auth
- The profile management system
- The post/gig creation and management flow

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Frontend["Frontend App"]:::frontend
        UserModule["User Module"]:::module
        AdminModule["Admin Module"]:::module
        AuthModule["Authentication Module"]:::module
        SharedComp["Shared Components"]:::module
    end

    subgraph Features
        ChatSystem["Chat System"]:::feature
        PaymentGateway["Payment Gateway"]:::feature
        PostManager["Posts Manager"]:::feature
        GigManager["Gigs Manager"]:::feature
        FileUpload["File Upload System"]:::feature
        ProfileMgmt["Profile Management"]:::feature
    end

    subgraph Core
        ReduxStore["Redux Store"]:::core
        SocketIO["Socket.IO"]:::core
        APILayer["API Layer"]:::core
    end

    subgraph State
        AdminStore["Admin Store"]:::state
        UserStore["User Store"]:::state
    end

    subgraph Protection
        AdminProtected["Admin Protected Routes"]:::security
        ClientProtected["Client Protected Routes"]:::security
    end

    subgraph External
        GoogleAuth["Google Authentication"]:::external
        PaymentProcessor["Payment Processing"]:::external
        FileStorage["File Storage"]:::external
    end

    Frontend --> UserModule
    Frontend --> AdminModule
    Frontend --> AuthModule
    Frontend --> SharedComp

    UserModule --> ChatSystem
    UserModule --> PostManager
    UserModule --> GigManager
    UserModule --> ProfileMgmt
    UserModule --> FileUpload

    AdminModule --> AdminProtected
    UserModule --> ClientProtected

    ChatSystem --> SocketIO
    PaymentGateway --> PaymentProcessor
    AuthModule --> GoogleAuth
    FileUpload --> FileStorage

    ReduxStore --> AdminStore
    ReduxStore --> UserStore
    
    APILayer --> AdminStore
    APILayer --> UserStore

    %% Click Events
    click UserModule "https://github.com/Mohammedshibilpv0/Freelance-X-Client/tree/main/src/components/user"
    click AdminModule "https://github.com/Mohammedshibilpv0/Freelance-X-Client/tree/main/src/components/admin"
    click AuthModule "https://github.com/Mohammedshibilpv0/Freelance-X-Client/tree/main/src/components/auth"
    click PaymentGateway "https://github.com/Mohammedshibilpv0/Freelance-X-Client/tree/main/src/components/payment"
    click ChatSystem "https://github.com/Mohammedshibilpv0/Freelance-X-Client/tree/main/src/components/user/chat"
    click ProfileMgmt "https://github.com/Mohammedshibilpv0/Freelance-X-Client/tree/main/src/pages/profile"
    click FileUpload "https://github.com/Mohammedshibilpv0/Freelance-X-Client/tree/main/src/components/user/imageuploader"
    click ReduxStore "https://github.com/Mohammedshibilpv0/Freelance-X-Client/blob/main/src/store/store.tsx"
    click AdminStore "https://github.com/Mohammedshibilpv0/Freelance-X-Client/blob/main/src/store/adminStore.tsx"
    click UserStore "https://github.com/Mohammedshibilpv0/Freelance-X-Client/blob/main/src/store/createUserSlice.tsx"
    click APILayer "https://github.com/Mohammedshibilpv0/Freelance-X-Client/blob/main/src/api/axios.ts"
    click SocketIO "https://github.com/Mohammedshibilpv0/Freelance-X-Client/blob/main/src/socket/socket.ts"
    click GoogleAuth "https://github.com/Mohammedshibilpv0/Freelance-X-Client/blob/main/src/pages/auth/googleAuth/googleAuth.tsx"
    click PaymentProcessor "https://github.com/Mohammedshibilpv0/Freelance-X-Client/blob/main/src/components/payment/paymentForm.tsx"
    click AdminProtected "https://github.com/Mohammedshibilpv0/Freelance-X-Client/blob/main/src/Routers/adminProtectedRoute.tsx"
    click ClientProtected "https://github.com/Mohammedshibilpv0/Freelance-X-Client/blob/main/src/Routers/ClientProtectedRoute.tsx"
    click PostManager "https://github.com/Mohammedshibilpv0/Freelance-X-Client/tree/main/src/components/user/CreatePost"
    click GigManager "https://github.com/Mohammedshibilpv0/Freelance-X-Client/blob/main/src/pages/user/CreateGig.tsx"

    %% Styles
    classDef frontend fill:#2196F3,stroke:#1565C0,color:white
    classDef module fill:#42A5F5,stroke:#1565C0,color:white
    classDef feature fill:#66BB6A,stroke:#388E3C,color:white
    classDef core fill:#FF7043,stroke:#E64A19,color:white
    classDef state fill:#FFA726,stroke:#F57C00,color:white
    classDef security fill:#AB47BC,stroke:#7B1FA2,color:white
    classDef external fill:#78909C,stroke:#455A64,color:white
```
