# nimish-html/all-socials architecture

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

- Interactive diagram: https://gitdiagram.com/nimish-html/all-socials
- Repository: https://github.com/nimish-html/all-socials

## Overview

##### Main System Components

A. Frontend Layer
- Client-side components (src/app and src/components)
- UI Components (src/components/ui)
- Rich Text Editor (Editor.tsx)

B. API Layer
- Next.js API Routes (src/pages/api)
- Individual Social Media Endpoints
- Twitter/X Integration
- Bluesky Integration
- Threads Integration

C. External Services Layer
- Twitter/X API
- Bluesky Social Network
- Threads/Instagram API

##### Component Relationships

**[Frontend] → [API Layer] → [External Services]**

##### Detailed Component Breakdown

Frontend Section:
**┌─ Client Layer ─────────────┐**
- ┌─ Editor Component ─────┐ │
- Rich Text Input      │ │
- Character Counter    │ │
- Platform Selectors   │ │
- ┘ │
- ┌─ UI Components ────────┐  │
- Buttons             │  │
- Checkboxes          │  │
- Progress Indicators │  │
- ┘ │
- ┘

API Layer:
**┌─ API Routes ──────────────┐**
- /api/postToTwitter     │
- /api/postToBluesky     │
- /api/postToThreads     │
- ┘

##### Technical Details

Annotations for:
- Next.js 14 framework
- TypeScript implementation
- Tailwind CSS styling
- Environment variables handling
- API authentication methods

**[User Interface Layer]**
- ↓
**[Next.js API Routes]**
- ↓
**[External Services]**

##### Additional Elements

Include:
- Version information
- Authentication flow markers
- Error handling paths
- Rate limiting indicators

##### Authentication and security measures

Remember to maintain a balance between detail and clarity, focusing on the core functionality of simultaneous social media posting while showing the technical implementation details that make it possible.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        Client["Main Client Page"]
        Layout["Layout Component"]
        Editor["Rich Text Editor"]
        
        subgraph UIComponents["UI Components"]
            direction TB
            Button["Button Component"]
            Checkbox["Checkbox Component"]
            Progress["Progress Indicator"]
            Label["Label Component"]
        end
        
        Client --> Editor
        Editor --> UIComponents
    end
    
    subgraph APILayer["API Layer"]
        direction TB
        Twitter["Twitter API Route"]
        Bluesky["Bluesky API Route"]
        Threads["Threads API Route"]
        Utils["Utility Functions"]
        
        Twitter --> Utils
        Bluesky --> Utils
        Threads --> Utils
    end
    
    subgraph ExternalServices["External Services"]
        direction TB
        TwitterAPI["Twitter/X API"]
        BlueskyAPI["Bluesky Social"]
        ThreadsAPI["Threads/Instagram API"]
    end
    
    Editor --> Twitter
    Editor --> Bluesky
    Editor --> Threads
    
    Twitter --> TwitterAPI
    Bluesky --> BlueskyAPI
    Threads --> ThreadsAPI
    
    %% Click events for component mapping
    click Editor "https://github.com/nimish-html/all-socials/blob/main/src/components/Editor.tsx"
    click Button "https://github.com/nimish-html/all-socials/blob/main/src/components/ui/button.tsx"
    click Checkbox "https://github.com/nimish-html/all-socials/blob/main/src/components/ui/checkbox.tsx"
    click Progress "https://github.com/nimish-html/all-socials/blob/main/src/components/ui/circle-progress.tsx"
    click Label "https://github.com/nimish-html/all-socials/blob/main/src/components/ui/label.tsx"
    click Twitter "https://github.com/nimish-html/all-socials/blob/main/src/pages/api/postToTwitter.ts"
    click Bluesky "https://github.com/nimish-html/all-socials/blob/main/src/pages/api/postToBluesky.ts"
    click Threads "https://github.com/nimish-html/all-socials/blob/main/src/pages/api/postToThreads.ts"
    click Client "https://github.com/nimish-html/all-socials/blob/main/src/app/page.tsx"
    click Layout "https://github.com/nimish-html/all-socials/blob/main/src/app/layout.tsx"
    click Utils "https://github.com/nimish-html/all-socials/blob/main/src/lib/utils.ts"
    
    %% Styling
    classDef frontend fill:#e1f5fe,stroke:#01579b
    classDef ui fill:#e8f5e9,stroke:#2e7d32
    classDef api fill:#fff3e0,stroke:#ff6f00
    classDef external fill:#fce4ec,stroke:#c2185b
    
    class Client,Layout,Editor frontend
    class Button,Checkbox,Progress,Label ui
    class Twitter,Bluesky,Threads,Utils api
    class TwitterAPI,BlueskyAPI,ThreadsAPI external
    
    %% Legend
    subgraph Legend
        Frontend_L["Frontend Components"]:::frontend
        UI_L["UI Components"]:::ui
        API_L["API Routes"]:::api
        External_L["External Services"]:::external
    end
```
