# kartikmehta8/bizzy-network architecture

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

- Interactive diagram: https://gitdiagram.com/kartikmehta8/bizzy-network
- Repository: https://github.com/kartikmehta8/bizzy-network

## Overview

##### Main Components to Illustrate
- Frontend: Represent React as the client-side framework. Include key elements like:
- Landing page and dashboards (different for business and contractor roles)
- Authentication pages (Login/Signup)
- UI components (Navbar, InfoPopup, and role-specific modals for chat, contract creation/submission, etc.)
- Backend/Services: Show Firebase as the backend service.
- Authentication (Firebase Auth)
- Databases (Firestore and Realtime Database for contract data, chats, and user profiles)
- Payment Module: Include the PaymanAI Payment SDK as a component that handles:
- Payee creation and direct payments
- Transaction tracking and metadata storage
- External Integrations: Although tightly coupled with Firebase and PaymanAI, indicate any external dependencies or APIs used, along with links to any ancillary services (e.g., hosting on Vercel).

##### Relationships and Interactions
- Data flow starting from user interactions on the frontend.
- How contract creation in the frontend triggers updates to Firebase’s Firestore/Realtime Database.
- The Frontend and Firebase for authentication, contract management, and chat interactions.
- The Frontend and the Payment Module (PaymanAI SDK) for processing payments.
- Real-time chat functionality between business and contractor, possibly as a bi-directional communication channel.

##### Architectural Patterns & Design Principles
- Separation of Concerns: Clearly separate components by user roles (business vs. contractor) and functionalities (contracts, chat, payments, authentication).
- Component-Based Architecture: Highlight independent React components (e.g., Navbar, InfoPopup, and role-specific modal components) and modular code structure.
- Event-Driven (Real-Time Updates): Showcase Firebase’s real-time updates supporting chat and contract status changes.
- Security & Scalability: Note Firebase Auth for secure login and user management, and how Firestore supports scalable data storage.

##### Relevant Technologies and Frameworks
- React with Ant Design (for a modern, dark-themed UI)
- Firebase (Firestore, Realtime Database, and Auth)
- PaymanAI Payment SDK for transactions
- Vercel for deployment (if necessary, include as part of cloud service architecture)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Subgraph
    subgraph "Frontend"
        direction TB
        FE1["React Frontend (UI)"]:::frontend
        FE2["Authentication Pages"]:::frontend
        FE3["Landing & Routing"]:::frontend
        FE4["Dashboard (Role-based)"]:::frontend
        FE6["UI Components (Navbar, InfoPopup, etc.)"]:::frontend
    end

    %% Business Components Subgraph
    subgraph "Business Components"
        direction TB
        B1["Business Dashboard"]:::business
        B2["Business Profile"]:::business
        B3["Business Chat & Contract Modals"]:::business
    end

    %% Contractor Components Subgraph
    subgraph "Contractor Components"
        direction TB
        C1["Contractor Dashboard"]:::contractor
        C2["Contractor Profile"]:::contractor
        C3["Contractor Chat & Work Submission"]:::contractor
    end

    %% Backend Services Subgraph
    subgraph "Backend Services (Firebase)"
        direction TB
        F1["Firebase Auth"]:::firebase
        F2["Firestore Database"]:::firebase
        F3["Realtime Database"]:::firebase
    end

    %% Payment Module and Cloud Hosting
    Payment["PaymanAI Payment SDK"]:::payment
    Cloud["Vercel Hosting"]:::cloud

    %% Utility Subgraph
    subgraph "Utilities"
        direction TB
        U1["Toast/Notification Utility"]:::utility
    end

    %% Connections from Frontend to Backend/Services & Payment
    FE1 -->|"initiateAuth"| F1
    FE2 -->|"LoginSignup"| F1
    FE4 -->|"createContract"| F2
    FE4 -->|"chatMessages"| F3
    FE4 -->|"initiatePayment"| Payment
    FE6 -->|"renderComponents"| FE1

    %% Grouping Role-based interactions within Frontend Layer
    FE4 -->|"businessFlow"| B1
    FE4 -->|"businessFlow"| B2
    FE4 -->|"businessFlow"| B3
    FE4 -->|"contractorFlow"| C1
    FE4 -->|"contractorFlow"| C2
    FE4 -->|"contractorFlow"| C3

    %% Real-time Chat between Business and Contractor Components
    B3 <==>|"realTimeChat"| C3

    %% Payment Module Interaction with Backend Database for Tracking
    Payment -->|"trackTransaction"| F2

    %% Click Events for Frontend Components
    click FE1 "https://github.com/kartikmehta8/bizzy-network/blob/main/src/pages/index.js"
    click FE2 "https://github.com/kartikmehta8/bizzy-network/blob/main/src/pages/auth/Login.js"
    click FE3 "https://github.com/kartikmehta8/bizzy-network/blob/main/src/pages/Landing.js"
    click FE4 "https://github.com/kartikmehta8/bizzy-network/blob/main/src/pages/Dashboard.js"
    click FE6 "https://github.com/kartikmehta8/bizzy-network/blob/main/src/components/Navbar.js"
    
    %% Click Events for Business Role Components
    click B1 "https://github.com/kartikmehta8/bizzy-network/blob/main/src/pages/business/BusinessDashboard.js"
    click B2 "https://github.com/kartikmehta8/bizzy-network/blob/main/src/pages/business/BusinessProfile.js"
    click B3 "https://github.com/kartikmehta8/bizzy-network/blob/main/src/components/business/index.js"
    click B3 "https://github.com/kartikmehta8/bizzy-network/blob/main/src/components/business/ChatModal.js"
    click B3 "https://github.com/kartikmehta8/bizzy-network/blob/main/src/components/business/ContractCard.js"
    click B3 "https://github.com/kartikmehta8/bizzy-network/blob/main/src/components/business/CreateContractModal.js"
    click B3 "https://github.com/kartikmehta8/bizzy-network/blob/main/src/components/business/ViewContractModal.js"

    %% Click Events for Contractor Role Components
    click C1 "https://github.com/kartikmehta8/bizzy-network/blob/main/src/pages/contractor/ContractorDashboard.js"
    click C2 "https://github.com/kartikmehta8/bizzy-network/blob/main/src/pages/contractor/ContractorProfile.js"
    click C3 "https://github.com/kartikmehta8/bizzy-network/blob/main/src/components/contractor/index.js"
    click C3 "https://github.com/kartikmehta8/bizzy-network/blob/main/src/components/contractor/ChatModal.js"
    click C3 "https://github.com/kartikmehta8/bizzy-network/blob/main/src/components/contractor/ContractCard.js"
    click C3 "https://github.com/kartikmehta8/bizzy-network/blob/main/src/components/contractor/SubmitWorkModal.js"

    %% Click Event for Firebase Service Integration
    click F1 "https://github.com/kartikmehta8/bizzy-network/blob/main/src/providers/firebase.js"

    %% Click Event for Utility Functions
    click U1 "https://github.com/kartikmehta8/bizzy-network/blob/main/src/utils/toast.js"

    %% Styling
    classDef frontend fill:#BBDEFB,stroke:#0D47A1,stroke-width:2px;
    classDef business fill:#C8E6C9,stroke:#1B5E20,stroke-width:2px;
    classDef contractor fill:#FFCDD2,stroke:#B71C1C,stroke-width:2px;
    classDef firebase fill:#FFF9C4,stroke:#F57F17,stroke-width:2px;
    classDef payment fill:#D1C4E9,stroke:#4A148C,stroke-width:2px;
    classDef cloud fill:#B2EBF2,stroke:#006064,stroke-width:2px;
    classDef utility fill:#F0F4C3,stroke:#827717,stroke-width:2px;
```
