# sadhurevanthchowdary-cell/influencer-client-platform architecture

> Architecture diagram of the GitHub repository sadhurevanthchowdary-cell/influencer-client-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sadhurevanthchowdary-cell/influencer-client-platform
- Repository: https://github.com/sadhurevanthchowdary-cell/influencer-client-platform

## Overview

Collab Sphere is a marketplace for brands and influencers to discover profiles, manage promotions, and collaborate. The main workflow runs from role-based signup and profile setup through campaign creation, dashboards, chat, and reviews. The React client uses an Express API backed by MongoDB, with a separate Socket.io service for live messaging and optional Cloudinary and Gemini integrations. The graph preserves documented product areas; many page and route implementations were not sampled, so their detailed internal calls are not asserted.

Main entry points: [`server/index.js`](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/index.js) (Express API), [`client/src/index.js`](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/client/src/index.js) (Web application), [`server/Controllers/PromotionController.js`](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Controllers/PromotionController.js) (Promotions API), [`server/Controllers/InfluencerController.js`](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Controllers/InfluencerController.js) (Influencer and reviews API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_webapp["Web application<br/>[index.js]"]
  node_auth_pages["Signup and login<br/>[Signup.jsx]"]
  node_directory["Profile discovery<br/>[Influencers.jsx]"]
  node_profile_pages["Profiles and reviews"]
  node_dashboards["Campaign dashboards"]
  node_chat_ui["Chat interface<br/>[Chat.jsx]"]
end

subgraph group_accounts["Accounts and profiles"]
  node_user_context["User context<br/>[UserContext.js]"]
  node_client_edit["Client profile editing<br/>[UpdateClient.jsx]"]
  node_media_upload["Image uploads"]
end

subgraph group_campaigns["Campaign collaboration"]
  node_promotion_api["Promotions API"]
end

subgraph group_backend["API and persistence"]
  node_identity_api["Authentication API<br/>[UserController.js]"]
  node_client_api["Client profiles API"]
  node_influencer_api["Influencer and reviews API"]
  node_auth_middleware["JWT authorization<br/>[authMiddleware.js]"]
  node_client_model[("Client records<br/>[ClientModel.js]")]
  node_influencer_model[("Influencer records<br/>[InfluencerModel.js]")]
  node_promotion_model[("Promotion records<br/>[PromotionModel.js]")]
  node_chat_model[("Conversation records<br/>[ChatModel.js]")]
  node_message_model[("Message records<br/>[MessageModel.js]")]
  node_api_server["Express API<br/>[index.js]"]
end

subgraph group_realtime_ai["Realtime and AI"]
  node_chat_api["Conversation API<br/>[ChattController.js]"]
  node_message_api["Message API"]
  node_ai_api["AI assistant API"]
  node_socket_server["Socket.io service<br/>[index.js]"]
end

node_people(("Influencers and clients"))
node_mongo[("MongoDB")]
node_cloudinary["Cloudinary"]
node_gemini["Gemini API"]

node_people -->|"use"| node_webapp
node_webapp -->|"routes to"| node_auth_pages
node_webapp -->|"routes to"| node_directory
node_webapp -->|"routes to"| node_profile_pages
node_webapp -->|"routes to"| node_dashboards
node_webapp -->|"routes to"| node_chat_ui
node_auth_pages -->|"registers and logs in"| node_identity_api
node_auth_pages -.->|"sets session"| node_user_context
node_profile_pages -->|"reads profiles and reviews"| node_influencer_api
node_profile_pages -->|"reads client profiles"| node_client_api
node_profile_pages -->|"submits reviews"| node_influencer_api
node_client_edit -->|"updates profile"| node_client_api
node_client_edit -->|"uploads images"| node_media_upload
node_media_upload -->|"uploads media"| node_cloudinary
node_dashboards -->|"manages campaigns"| node_promotion_api
node_chat_ui -->|"manages conversations"| node_chat_api
node_chat_ui -->|"sends messages"| node_message_api
node_chat_ui -->|"delivers live messages"| node_socket_server
node_webapp -->|"asks assistant"| node_ai_api
node_ai_api -->|"queries"| node_gemini
node_api_server -->|"connects"| node_mongo
node_api_server -->|"mounts client routes"| node_client_api
node_api_server -->|"mounts influencer routes"| node_influencer_api
node_api_server -->|"mounts promotion routes"| node_promotion_api
node_api_server -->|"mounts chat routes"| node_chat_api
node_api_server -->|"mounts message routes"| node_message_api
node_api_server -->|"mounts user routes"| node_identity_api
node_api_server -->|"mounts AI routes"| node_ai_api
node_client_api -->|"reads and updates"| node_client_model
node_influencer_api -->|"reads and updates"| node_influencer_model
node_influencer_api -->|"checks reviewer"| node_client_model
node_identity_api -->|"selects by role"| node_client_model
node_identity_api -->|"selects by role"| node_influencer_model
node_promotion_api -->|"creates and updates"| node_promotion_model
node_promotion_api -->|"updates counters"| node_client_model
node_promotion_api -->|"updates counters"| node_influencer_model
node_chat_api -->|"reads and writes"| node_chat_model
node_auth_middleware -.->|"authorizes requests"| node_api_server
node_message_api -.->|"stores messages"| node_message_model
node_chat_model -.->|"persists in"| node_mongo
node_message_model -.->|"persists in"| node_mongo
node_client_model -.->|"persists in"| node_mongo
node_influencer_model -.->|"persists in"| node_mongo
node_promotion_model -.->|"persists in"| node_mongo

click node_webapp "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/client/src/index.js"
click node_auth_pages "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/client/src/Pages/Signup.jsx"
click node_directory "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/client/src/Pages/Influencers.jsx"
click node_profile_pages "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/client/src/Pages/InfluencerProfile.jsx"
click node_dashboards "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/client/src/Pages/InfluencerDashboard.jsx"
click node_chat_ui "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/client/src/Pages/Chat/Chat.jsx"
click node_user_context "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/client/src/Context/UserContext.js"
click node_client_edit "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/client/src/Pages/UpdateClient.jsx"
click node_media_upload "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/client/src/CloudServices/cloudinaryServices.js"
click node_identity_api "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Controllers/UserController.js"
click node_client_api "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Controllers/ClientController.js"
click node_influencer_api "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Controllers/InfluencerController.js"
click node_promotion_api "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Controllers/PromotionController.js"
click node_chat_api "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Controllers/ChattController.js"
click node_message_api "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Controllers/MessageController.js"
click node_ai_api "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Controllers/AiChatController.js"
click node_auth_middleware "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Middleware/authMiddleware.js"
click node_client_model "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Models/ClientModel.js"
click node_influencer_model "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Models/InfluencerModel.js"
click node_promotion_model "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Models/PromotionModel.js"
click node_chat_model "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Models/ChatModel.js"
click node_message_model "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Models/MessageModel.js"
click node_api_server "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/index.js"
click node_socket_server "https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/socket/index.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webapp,node_auth_pages,node_directory,node_profile_pages,node_dashboards,node_chat_ui,node_people toneBlue
class node_user_context,node_client_edit,node_media_upload,node_mongo toneAmber
class node_promotion_api,node_gemini toneMint
class node_identity_api,node_client_api,node_influencer_api,node_auth_middleware,node_client_model,node_influencer_model,node_promotion_model,node_chat_model,node_message_model,node_api_server toneRose
class node_chat_api,node_message_api,node_ai_api,node_socket_server,node_cloudinary toneIndigo
```

## Components

### React client

- [Web application](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/client/src/index.js): `client/src/index.js`
- [Signup and login](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/client/src/Pages/Signup.jsx): `client/src/Pages/Signup.jsx`
- [Profile discovery](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/client/src/Pages/Influencers.jsx): `client/src/Pages/Influencers.jsx`
- [Profiles and reviews](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/client/src/Pages/InfluencerProfile.jsx): `client/src/Pages/InfluencerProfile.jsx`
- [Campaign dashboards](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/client/src/Pages/InfluencerDashboard.jsx): `client/src/Pages/InfluencerDashboard.jsx`
- [Chat interface](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/client/src/Pages/Chat/Chat.jsx): `client/src/Pages/Chat/Chat.jsx`

### Accounts and profiles

- [User context](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/client/src/Context/UserContext.js): `client/src/Context/UserContext.js`
- [Client profile editing](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/client/src/Pages/UpdateClient.jsx): `client/src/Pages/UpdateClient.jsx`
- [Image uploads](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/client/src/CloudServices/cloudinaryServices.js): `client/src/CloudServices/cloudinaryServices.js`

### Campaign collaboration

- [Promotions API](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Controllers/PromotionController.js): `server/Controllers/PromotionController.js`

### API and persistence

- [Authentication API](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Controllers/UserController.js): `server/Controllers/UserController.js`
- [Client profiles API](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Controllers/ClientController.js): `server/Controllers/ClientController.js`
- [Influencer and reviews API](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Controllers/InfluencerController.js): `server/Controllers/InfluencerController.js`
- [JWT authorization](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Middleware/authMiddleware.js): `server/Middleware/authMiddleware.js`
- [Client records](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Models/ClientModel.js): `server/Models/ClientModel.js`
- [Influencer records](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Models/InfluencerModel.js): `server/Models/InfluencerModel.js`
- [Promotion records](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Models/PromotionModel.js): `server/Models/PromotionModel.js`
- [Conversation records](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Models/ChatModel.js): `server/Models/ChatModel.js`
- [Message records](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Models/MessageModel.js): `server/Models/MessageModel.js`
- [Express API](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/index.js): `server/index.js`

### Realtime and AI

- [Conversation API](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Controllers/ChattController.js): `server/Controllers/ChattController.js`
- [Message API](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Controllers/MessageController.js): `server/Controllers/MessageController.js`
- [AI assistant API](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/server/Controllers/AiChatController.js): `server/Controllers/AiChatController.js`
- [Socket.io service](https://github.com/sadhurevanthchowdary-cell/influencer-client-platform/blob/main/socket/index.js): `socket/index.js`

### Other components

- **Influencers and clients**
- **MongoDB**
- **Cloudinary**
- **Gemini API**

## Connections

- Influencers and clients → Web application: use
- Web application → Signup and login: routes to (evidence: `client/src/index.js`)
- Web application → Profile discovery: routes to (evidence: `client/src/index.js`)
- Web application → Profiles and reviews: routes to (evidence: `client/src/index.js`)
- Web application → Campaign dashboards: routes to (evidence: `client/src/index.js`)
- Web application → Chat interface: routes to (evidence: `client/src/index.js`)
- Signup and login → Authentication API: registers and logs in
- Signup and login → User context: sets session
- Profiles and reviews → Influencer and reviews API: reads profiles and reviews
- Profiles and reviews → Client profiles API: reads client profiles
- Profiles and reviews → Influencer and reviews API: submits reviews
- Client profile editing → Client profiles API: updates profile (evidence: `client/src/Pages/UpdateClient.jsx`)
- Client profile editing → Image uploads: uploads images (evidence: `client/src/Pages/UpdateClient.jsx`)
- Image uploads → Cloudinary: uploads media (evidence: `client/src/CloudServices/cloudinaryServices.js`)
- Campaign dashboards → Promotions API: manages campaigns
- Chat interface → Conversation API: manages conversations
- Chat interface → Message API: sends messages
- Chat interface → Socket.io service: delivers live messages
- Web application → AI assistant API: asks assistant
- AI assistant API → Gemini API: queries
- Express API → MongoDB: connects (evidence: `server/index.js`)
- Express API → Client profiles API: mounts client routes (evidence: `server/index.js`)
- Express API → Influencer and reviews API: mounts influencer routes (evidence: `server/index.js`)
- Express API → Promotions API: mounts promotion routes (evidence: `server/index.js`)
- Express API → Conversation API: mounts chat routes (evidence: `server/index.js`)
- Express API → Message API: mounts message routes (evidence: `server/index.js`)
- Express API → Authentication API: mounts user routes (evidence: `server/index.js`)
- Express API → AI assistant API: mounts AI routes (evidence: `server/index.js`)
- Client profiles API → Client records: reads and updates (evidence: `server/Controllers/ClientController.js`)
- Influencer and reviews API → Influencer records: reads and updates (evidence: `server/Controllers/InfluencerController.js`)
- Influencer and reviews API → Client records: checks reviewer (evidence: `server/Controllers/InfluencerController.js`)
- Authentication API → Client records: selects by role (evidence: `server/Controllers/UserController.js`)
- Authentication API → Influencer records: selects by role (evidence: `server/Controllers/UserController.js`)
- Promotions API → Promotion records: creates and updates (evidence: `server/Controllers/PromotionController.js`)
- Promotions API → Client records: updates counters (evidence: `server/Controllers/PromotionController.js`)
- Promotions API → Influencer records: updates counters (evidence: `server/Controllers/PromotionController.js`)
- Conversation API → Conversation records: reads and writes (evidence: `server/Controllers/ChattController.js`)
- JWT authorization → Express API: authorizes requests
- Message API → Message records: stores messages
- Conversation records → MongoDB: persists in
- Message records → MongoDB: persists in
- Client records → MongoDB: persists in
- Influencer records → MongoDB: persists in
- Promotion records → MongoDB: persists in
