# pritzvi/linked-out architecture

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

- Interactive diagram: https://gitdiagram.com/pritzvi/linked-out
- Repository: https://github.com/pritzvi/linked-out

## Overview

##### Main System Components

a) Frontend Layer
- React/TypeScript UI (port 5173)
- Key components: OpenAIKeyForm, Home, Progress pages
- Interaction with backend via API calls

b) Backend Layer (port 8000)
- FastAPI application
- Progress management system
- API endpoints for resume upload and automation control

c) Core Automation Layer (browser-use)
- Browser automation framework
- DOM manipulation and interaction
- Telemetry and logging systems

d) Agent Layer
- LinkedIn-specific automation logic
- Message management system
- Controller and registry components

##### Component Relationships

**[Frontend] <--HTTP/WebSocket--> [Backend API] <--> [Agent Layer] <--> [Browser Automation] <--> [Chrome Browser]**

##### Detailed Component Breakdown

For each major component, include these elements:

Frontend Section:
- React/TypeScript components
- State management
- API integration points

Backend Section:
- FastAPI endpoints
- Progress tracking system
- File upload handling

Browser Automation Section:
- DOM manipulation module
- Browser context management
- Telemetry system
- History tree processor

Agent Section:
- Message manager
- Controller registry
- LinkedIn-specific logic
- Resume processing

##### External Dependencies
Connections to:
- OpenAI API
- Gemini API
- Chrome Browser
- LinkedIn platform

##### Data Flow Indicators

- User input flow (resume, API keys, search parameters)
- Browser automation commands
- LinkedIn interaction flow
- Status/progress updates back to UI

##### Technical Details

Annotations for:
- TypeScript/React frontend
- FastAPI backend
- Playwright integration
- LangChain implementation
- Chrome browser interaction

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Frontend
        UI["React/TypeScript UI (5173)"]:::frontend
        OpenAIForm["OpenAI Key Form"]:::frontend
        HomeP["Home Page"]:::frontend
        ProgressP["Progress Page"]:::frontend
        
        UI --> OpenAIForm
        UI --> HomeP
        UI --> ProgressP
    end

    subgraph Backend
        FastAPI["FastAPI Server (8000)"]:::backend
        ProgressMgr["Progress Manager"]:::backend
        
        FastAPI --> ProgressMgr
    end

    subgraph BrowserAutomation
        BrowserCore["Browser Core"]:::automation
        BrowserCtx["Browser Context"]:::automation
        DOMManip["DOM Manipulation"]:::automation
        HistoryProc["History Tree Processor"]:::automation
        Telemetry["Telemetry System"]:::automation
        DOMTree["DOM Tree Builder"]:::automation
        
        BrowserCore --> BrowserCtx
        BrowserCtx --> DOMManip
        DOMManip --> HistoryProc
        DOMManip --> DOMTree
        BrowserCore --> Telemetry
    end

    subgraph AgentLayer
        LinkedInAgent["LinkedIn Agent"]:::agent
        MsgManager["Message Manager"]:::agent
        CtrlRegistry["Controller Registry"]:::agent
        AgentService["Agent Service"]:::agent
        
        LinkedInAgent --> MsgManager
        LinkedInAgent --> AgentService
        AgentService --> CtrlRegistry
    end

    subgraph ExternalServices
        Chrome["Chrome Browser"]:::external
        LinkedIn["LinkedIn Platform"]:::external
        OpenAI["OpenAI API"]:::external
        Gemini["Gemini API"]:::external
    end

    Frontend <--HTTP/WS--> Backend
    Backend <--> AgentLayer
    AgentLayer <--> BrowserAutomation
    BrowserAutomation <--> Chrome
    Chrome <--> LinkedIn
    Backend <--> OpenAI
    Backend <--> Gemini

    %% Click Events
    click UI "https://github.com/pritzvi/linked-out/blob/main/frontend/src/App.tsx"
    click OpenAIForm "https://github.com/pritzvi/linked-out/blob/main/frontend/src/components/OpenAIKeyForm.tsx"
    click HomeP "https://github.com/pritzvi/linked-out/blob/main/frontend/src/pages/Home.tsx"
    click ProgressP "https://github.com/pritzvi/linked-out/blob/main/frontend/src/pages/Progress.tsx"
    click FastAPI "https://github.com/pritzvi/linked-out/blob/main/mimicflow/app/main.py"
    click ProgressMgr "https://github.com/pritzvi/linked-out/blob/main/mimicflow/app/progress_manager.py"
    click BrowserCore "https://github.com/pritzvi/linked-out/blob/main/browser-use/browser_use/browser/browser.py"
    click BrowserCtx "https://github.com/pritzvi/linked-out/blob/main/browser-use/browser_use/browser/context.py"
    click DOMManip "https://github.com/pritzvi/linked-out/blob/main/browser-use/browser_use/dom/service.py"
    click HistoryProc "https://github.com/pritzvi/linked-out/blob/main/browser-use/browser_use/dom/history_tree_processor/service.py"
    click Telemetry "https://github.com/pritzvi/linked-out/blob/main/browser-use/browser_use/telemetry/service.py"
    click LinkedInAgent "https://github.com/pritzvi/linked-out/blob/main/mimicflow/agents/linkedin/linkedin_agent.py"
    click MsgManager "https://github.com/pritzvi/linked-out/blob/main/browser-use/browser_use/agent/message_manager/service.py"
    click CtrlRegistry "https://github.com/pritzvi/linked-out/blob/main/browser-use/browser_use/controller/registry/service.py"
    click AgentService "https://github.com/pritzvi/linked-out/blob/main/browser-use/browser_use/agent/service.py"
    click DOMTree "https://github.com/pritzvi/linked-out/blob/main/browser-use/browser_use/dom/buildDomTree.js"

    %% Styling
    classDef frontend fill:#2374ab
    classDef backend fill:#2a9d8f
    classDef automation fill:#f4a261
    classDef agent fill:#e76f51
    classDef external fill:#grey

    %% Legend
    subgraph Legend
        Frontend_L["Frontend Components"]:::frontend
        Backend_L["Backend Services"]:::backend
        Automation_L["Browser Automation"]:::automation
        Agent_L["Agent Components"]:::agent
        External_L["External Services"]:::external
    end
```
