# mehmetkirkoca/social-media-manager architecture

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

- Interactive diagram: https://gitdiagram.com/mehmetkirkoca/social-media-manager
- Repository: https://github.com/mehmetkirkoca/social-media-manager

## Overview

##### Main Components

A. Frontend Layer:
- Vue.js UI application (from the /ui directory)
- Nginx as reverse proxy/load balancer (nginx.conf present)

B. Microservices Layer:
- Gateway Service (services/gateway)
- Social Media Services:
- LinkedIn Service (services/linkedin)
- Twitter Service (services/twitter)
- Support Services:
- Socket Service (services/socket)
- Formatter Service (services/formatter)
- AI Grammar Correction Service (services/ai_grammar_correction)

C. Message Queue Layer:
- RabbitMQ (evidenced by RabbitMQConnector, Producer, and Listener in utils)

**[Client Tier]**
- ↓ ↑
**[Service Tier]**
- ↓ ↑
**[Message Queue Tier]**

##### Component Representation

- Rectangles with rounded corners for UI components (blue)
- Hexagons for microservices (green)
- Diamonds for external social media APIs (gray)
- Rectangles for utility services (orange)

##### Connection Flows

a) Client requests flow:
- Browser → Nginx → Gateway Service
- Gateway Service → Individual Microservices

b) Message queue interactions:
- Services → RabbitMQ → Consumers

c) External API connections:
- Social media services → External APIs

##### Key Elements to Highlight

a) Frontend Components:
- Vue.js application with main components (PostSender, NavBar, Footer)
- Nginx reverse proxy

b) Service Layer:
- Gateway service as the entry point
- Social media integration services
- Formatter and AI services for content processing
- WebSocket service for real-time features

c) Message Queue:
- RabbitMQ for inter-service communication
- Message flow patterns

##### Additional Details

Annotations for:
- API endpoints and protocols (REST, WebSocket)
- Data flow direction
- Service responsibilities

##### Technical Specifications

Important technical details:
- Node.js-based microservices
- Python for AI service
- Vue.js + TypeScript frontend
- Docker containerization
- RabbitMQ message broker

Remember to emphasize the scalability aspects and how the microservices architecture allows for independent deployment and scaling of each service. This is particularly important for a social media management platform that might need to handle varying loads across different services.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]
    end

    subgraph "Frontend Layer"
        UI["Vue.js UI"]:::frontend
        NGINX["NGINX Reverse Proxy"]:::proxy
        PS["PostSender"]:::component
        NB["NavBar"]:::component
        FT["Footer"]:::component
    end

    subgraph "Service Layer"
        GW["Gateway Service"]:::service
        
        subgraph "Social Media Services"
            LS["LinkedIn Service"]:::service
            TS["Twitter Service"]:::service
        end
        
        subgraph "Support Services"
            SS["Socket Service"]:::service
            FS["Formatter Service"]:::service
            AI["AI Grammar Correction"]:::service
        end
    end

    subgraph "Message Queue Layer"
        RMQ["RabbitMQ"]:::queue
        RMQC["RabbitMQ Connector"]:::util
        RMQP["RabbitMQ Producer"]:::util
        RMQL["RabbitMQ Listener"]:::util
    end

    subgraph "External APIs"
        LI["LinkedIn API"]:::external
        TW["Twitter API"]:::external
    end

    %% Connections
    Browser --> NGINX
    NGINX --> UI
    UI --> PS
    UI --> NB
    UI --> FT
    NGINX --> GW
    GW --> LS
    GW --> TS
    GW --> SS
    GW --> FS
    GW --> AI
    LS --> RMQP
    TS --> RMQP
    RMQP --> RMQ
    RMQ --> RMQL
    RMQC --- RMQP
    RMQC --- RMQL
    LS --> LI
    TS --> TW

    %% Click Events
    click UI "https://github.com/mehmetkirkoca/social-media-manager/tree/main/ui"
    click PS "https://github.com/mehmetkirkoca/social-media-manager/blob/main/ui/src/components/PostSender.vue"
    click NB "https://github.com/mehmetkirkoca/social-media-manager/blob/main/ui/src/components/NavBar.vue"
    click FT "https://github.com/mehmetkirkoca/social-media-manager/blob/main/ui/src/components/Footer.vue"
    click NGINX "https://github.com/mehmetkirkoca/social-media-manager/blob/main/nginx.conf"
    click GW "https://github.com/mehmetkirkoca/social-media-manager/blob/main/services/gateway/server.js"
    click LS "https://github.com/mehmetkirkoca/social-media-manager/blob/main/services/linkedin/index.js"
    click TS "https://github.com/mehmetkirkoca/social-media-manager/blob/main/services/twitter/index.js"
    click SS "https://github.com/mehmetkirkoca/social-media-manager/blob/main/services/socket/index.js"
    click FS "https://github.com/mehmetkirkoca/social-media-manager/blob/main/services/formatter/index.js"
    click AI "https://github.com/mehmetkirkoca/social-media-manager/blob/main/services/ai_grammar_correction/app.py"
    click RMQC "https://github.com/mehmetkirkoca/social-media-manager/blob/main/services/utils/RabbitMQConnector.js"
    click RMQP "https://github.com/mehmetkirkoca/social-media-manager/blob/main/services/utils/RabbitMQProducer.js"
    click RMQL "https://github.com/mehmetkirkoca/social-media-manager/blob/main/services/utils/RabbitMQListener.js"

    %% Styles
    classDef frontend fill:#2196F3,stroke:#1565C0,color:white
    classDef proxy fill:#607D8B,stroke:#455A64,color:white
    classDef service fill:#4CAF50,stroke:#2E7D32,color:white
    classDef component fill:#FF9800,stroke:#F57C00,color:white
    classDef queue fill:#9C27B0,stroke:#6A1B9A,color:white
    classDef util fill:#FF5722,stroke:#D84315,color:white
    classDef external fill:#9E9E9E,stroke:#616161,color:white

    %% Legend
    subgraph Legend
        L1["Frontend Component"]:::frontend
        L2["Proxy"]:::proxy
        L3["Microservice"]:::service
        L4["UI Component"]:::component
        L5["Message Queue"]:::queue
        L6["Queue Utility"]:::util
        L7["External API"]:::external
    end
```
