# muhammad-abdullha/brand-promotion architecture

> Architecture diagram of the GitHub repository muhammad-abdullha/brand-promotion, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/muhammad-abdullha/brand-promotion
- Repository: https://github.com/muhammad-abdullha/brand-promotion

## Overview

Brand Promotion Platform is a multi-role marketing product for brand admins, influencers, and end users. Users enter through role-specific dashboards to manage campaigns and ads, collaborate with partners, publish and engage with social content, and review analytics; billing and support round out the workflow. The graph retains the README’s major capability areas, using sampled frontend dispatches and backend route/controller evidence where available. Some subsystems are represented by exact source directories because their implementation files were not sampled; their internal links are therefore omitted when unverified.

Main entry points: [`src/App.jsx`](https://github.com/muhammad-abdullha/brand-promotion/blob/main/src/App.jsx) (Role dashboards), [`backend/config/config.go`](https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/config/config.go) (PostgreSQL data), [`src/components/combineCampaign`](https://github.com/muhammad-abdullha/brand-promotion/tree/main/src/components/combineCampaign) (Combined campaigns), [`backend/controllers/adController.go`](https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/adController.go) (Ad management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User experience"]
  node_app["Role dashboards<br/>[App.jsx]"]
end

subgraph group_marketing["Campaign marketing"]
  node_campaigns["Campaign lifecycle"]
  node_collaboration["Combined campaigns"]
  node_recommendations["Partner discovery"]
  node_ads["Ad management<br/>[adController.go]"]
  node_ad_delivery["Ad delivery<br/>[DisplayAds.jsx]"]
  node_gamification["Rewards and leaderboard<br/>[gamification.go]"]
end

subgraph group_social["Social engagement"]
  node_social["Social feed and stories<br/>[postController.go]"]
  node_discovery["User search and follows<br/>[Search.jsx]"]
  node_messaging["Direct and group chat<br/>[chatController.go]"]
end

subgraph group_insights["Insights and engagement"]
  node_analytics["Campaign and ad analytics"]
  node_post_analytics["Post performance"]
end

subgraph group_platform["Platform services"]
  node_auth["Identity and access<br/>[authController.go]"]
  node_media["Media assets"]
  node_ws["WebSocket hub<br/>[chat_hub.go]"]
  node_billing["Subscriptions and payments"]
  node_coupons["Coupons<br/>[coupons.go]"]
  node_notifications["Notifications<br/>[notification.go]"]
  node_support["Customer support"]
  node_search_api["Search API"]
  node_database[("PostgreSQL data<br/>[config.go]")]
end

node_users(("Platform users"))
node_cloudinary["Cloudinary"]
node_stripe["Stripe"]
node_mistral["Mistral AI"]

node_users -->|"opens"| node_app
node_app -.->|"authenticates"| node_auth
node_app -.->|"manages campaigns"| node_campaigns
node_app -.->|"manages ads"| node_ads
node_app -.->|"starts collaboration"| node_collaboration
node_app -.->|"uses social layer"| node_social
node_app -.->|"views insights"| node_analytics
node_app -.->|"manages subscription"| node_billing
node_app -.->|"uses rewards"| node_gamification
node_app -.->|"views updates"| node_notifications
node_app -.->|"requests support"| node_support
node_collaboration -.->|"requests rankings"| node_recommendations
node_collaboration -.->|"initializes group chat"| node_messaging
node_collaboration -.->|"logs events"| node_analytics
node_ads -.->|"generates suggestions"| node_mistral
node_recommendations -.->|"ranks partners"| node_mistral
node_ads -.->|"stores media"| node_media
node_media -.->|"uploads assets"| node_cloudinary
node_ad_delivery -.->|"fetches published ads"| node_database
node_app -.->|"serves ads"| node_ad_delivery
node_social -.->|"searches people"| node_discovery
node_discovery -->|"queries users"| node_search_api
node_app -.->|"opens conversations"| node_messaging
node_messaging -.->|"serves WebSocket"| node_ws
node_app -.->|"reviews post metrics"| node_post_analytics
node_billing -.->|"processes payments"| node_stripe
node_campaigns -.->|"persists campaigns"| node_database
node_ads -.->|"persists ads"| node_database
node_social -.->|"persists content"| node_database
node_analytics -.->|"stores event logs"| node_database
node_gamification -.->|"stores rewards"| node_database
node_billing -.->|"records transactions"| node_database

click node_app "https://github.com/muhammad-abdullha/brand-promotion/blob/main/src/App.jsx"
click node_auth "https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/authController.go"
click node_campaigns "https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/campaignController.go"
click node_collaboration "https://github.com/muhammad-abdullha/brand-promotion/tree/main/src/components/combineCampaign"
click node_recommendations "https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/recommendationController.go"
click node_ads "https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/adController.go"
click node_ad_delivery "https://github.com/muhammad-abdullha/brand-promotion/blob/main/src/components/publishads/DisplayAds.jsx"
click node_media "https://github.com/muhammad-abdullha/brand-promotion/tree/main/backend/cloudinary"
click node_gamification "https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/models/gamification.go"
click node_social "https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/postController.go"
click node_discovery "https://github.com/muhammad-abdullha/brand-promotion/blob/main/src/components/social/Search.jsx"
click node_messaging "https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/chatController.go"
click node_ws "https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/ws/chat_hub.go"
click node_analytics "https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/analyticsController.go"
click node_post_analytics "https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/postAnalyticsController.go"
click node_billing "https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/stripeController.go"
click node_coupons "https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/coupons.go"
click node_notifications "https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/notification.go"
click node_support "https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/supportController.go"
click node_search_api "https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/searchController.go"
click node_database "https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/config/config.go"

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_app,node_users toneBlue
class node_campaigns,node_collaboration,node_recommendations,node_ads,node_ad_delivery,node_gamification toneAmber
class node_social,node_discovery,node_messaging toneMint
class node_analytics,node_post_analytics toneRose
class node_auth,node_media,node_ws,node_billing,node_coupons,node_notifications,node_support,node_search_api,node_database,node_cloudinary,node_stripe,node_mistral toneIndigo
```

## Components

### User experience

- [Role dashboards](https://github.com/muhammad-abdullha/brand-promotion/blob/main/src/App.jsx): `src/App.jsx`

### Campaign marketing

- [Campaign lifecycle](https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/campaignController.go): `backend/controllers/campaignController.go`
- [Combined campaigns](https://github.com/muhammad-abdullha/brand-promotion/tree/main/src/components/combineCampaign): `src/components/combineCampaign`
- [Partner discovery](https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/recommendationController.go): `backend/controllers/recommendationController.go`
- [Ad management](https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/adController.go): `backend/controllers/adController.go`
- [Ad delivery](https://github.com/muhammad-abdullha/brand-promotion/blob/main/src/components/publishads/DisplayAds.jsx): `src/components/publishads/DisplayAds.jsx`
- [Rewards and leaderboard](https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/models/gamification.go): `backend/models/gamification.go`

### Social engagement

- [Social feed and stories](https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/postController.go): `backend/controllers/postController.go`
- [User search and follows](https://github.com/muhammad-abdullha/brand-promotion/blob/main/src/components/social/Search.jsx): `src/components/social/Search.jsx`
- [Direct and group chat](https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/chatController.go): `backend/controllers/chatController.go`

### Insights and engagement

- [Campaign and ad analytics](https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/analyticsController.go): `backend/controllers/analyticsController.go`
- [Post performance](https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/postAnalyticsController.go): `backend/controllers/postAnalyticsController.go`

### Platform services

- [Identity and access](https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/authController.go): `backend/controllers/authController.go`
- [Media assets](https://github.com/muhammad-abdullha/brand-promotion/tree/main/backend/cloudinary): `backend/cloudinary`
- [WebSocket hub](https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/ws/chat_hub.go): `backend/ws/chat_hub.go`
- [Subscriptions and payments](https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/stripeController.go): `backend/controllers/stripeController.go`
- [Coupons](https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/coupons.go): `backend/controllers/coupons.go`
- [Notifications](https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/notification.go): `backend/controllers/notification.go`
- [Customer support](https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/supportController.go): `backend/controllers/supportController.go`
- [Search API](https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/controllers/searchController.go): `backend/controllers/searchController.go`
- [PostgreSQL data](https://github.com/muhammad-abdullha/brand-promotion/blob/main/backend/config/config.go): `backend/config/config.go`

### Other components

- **Platform users**
- **Cloudinary**
- **Stripe**
- **Mistral AI**

## Connections

- Platform users → Role dashboards: opens (evidence: `src/App.jsx`)
- Role dashboards → Identity and access: authenticates (evidence: `README.md`)
- Role dashboards → Campaign lifecycle: manages campaigns (evidence: `README.md`)
- Role dashboards → Ad management: manages ads (evidence: `README.md`)
- Role dashboards → Combined campaigns: starts collaboration (evidence: `README.md`)
- Role dashboards → Social feed and stories: uses social layer (evidence: `README.md`)
- Role dashboards → Campaign and ad analytics: views insights (evidence: `README.md`)
- Role dashboards → Subscriptions and payments: manages subscription (evidence: `README.md`)
- Role dashboards → Rewards and leaderboard: uses rewards (evidence: `README.md`)
- Role dashboards → Notifications: views updates (evidence: `README.md`)
- Role dashboards → Customer support: requests support (evidence: `README.md`)
- Combined campaigns → Partner discovery: requests rankings (evidence: `README.md`)
- Combined campaigns → Direct and group chat: initializes group chat (evidence: `README.md`)
- Combined campaigns → Campaign and ad analytics: logs events (evidence: `README.md`)
- Ad management → Mistral AI: generates suggestions (evidence: `README.md`)
- Partner discovery → Mistral AI: ranks partners (evidence: `README.md`)
- Ad management → Media assets: stores media (evidence: `README.md`)
- Media assets → Cloudinary: uploads assets (evidence: `README.md`)
- Ad delivery → PostgreSQL data: fetches published ads (evidence: `README.md`)
- Role dashboards → Ad delivery: serves ads (evidence: `README.md`)
- Social feed and stories → User search and follows: searches people (evidence: `README.md`)
- User search and follows → Search API: queries users
- Role dashboards → Direct and group chat: opens conversations (evidence: `README.md`)
- Direct and group chat → WebSocket hub: serves WebSocket (evidence: `README.md`)
- Role dashboards → Post performance: reviews post metrics (evidence: `README.md`)
- Subscriptions and payments → Stripe: processes payments (evidence: `README.md`)
- Campaign lifecycle → PostgreSQL data: persists campaigns (evidence: `README.md`)
- Ad management → PostgreSQL data: persists ads (evidence: `README.md`)
- Social feed and stories → PostgreSQL data: persists content (evidence: `README.md`)
- Campaign and ad analytics → PostgreSQL data: stores event logs (evidence: `README.md`)
- Rewards and leaderboard → PostgreSQL data: stores rewards (evidence: `README.md`)
- Subscriptions and payments → PostgreSQL data: records transactions (evidence: `README.md`)
