# angelplusultra/job-shell architecture

> Architecture diagram of the GitHub repository angelplusultra/job-shell, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/angelplusultra/job-shell
- Repository: https://github.com/angelplusultra/job-shell

## Overview

##### Main Components

a. Core Components:
- CLI Interface Module
- Discord Integration Module
- Scraper Engine
- Data Management System
- AI Integration (Gemini)
- Job Report Generator

b. External Services:
- Company Job Boards
- Discord Webhook
- Google Chrome (Browser Automation)
- Gemini AI API

**┌─ User Interface Layer ─┐**
- CLI Mode           │
- Discord Bot Mode   │
- ┬────────────┘
- ↓
**┌─ Core Service Layer ──┐**
- Scraper Engine    │
- Job Management    │
- Report Generator  │
- AI Integration    │
- ┬────────────┘
- ↓
**┌─ External Services ───┐**
- Company Job Boards │
- Discord Webhook    │
- Chrome Browser     │
- Gemini AI API     │
- ┘

##### Key Relationships to Highlight

a. Data Flow:
- User input → CLI/Discord interface
- Scraper Engine → Company job boards
- Job data → Report Generator
- Discord notifications → Discord Webhook

b. Dependencies:
- Scraper Engine ← Chrome Browser
- AI Integration ← Gemini API
- Job Management ← Data Storage

##### Component Details

a. Scraper Engine:
- Individual company scrapers (src/scrapers/*)
- Modular architecture
- Scheduling mechanism for Discord mode

b. CLI Interface:
- Interactive menu system
- Connection management
- Job bookmarking
- Message drafting

c. Discord Integration:
- Webhook communication
- Scheduled job updates
- Notification formatting

##### Implementation Notes

- Module boundaries (based on src/ structure)
- Async operations
- Error handling patterns
- Configuration management

##### Technical Stack Indicators

- Rust
- Chrome WebDriver
- Discord API
- Gemini AI
- Company APIs/websites

This system design should emphasize JobShell's unique architecture as a dual-mode job scraping tool, highlighting both its interactive CLI capabilities and automated Discord integration, while showing how various components work together to provide a seamless job hunting experience.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and classes
    classDef ui fill:#FFA500,stroke:#333,stroke-width:2px
    classDef core fill:#4169E1,stroke:#333,stroke-width:2px
    classDef external fill:#90EE90,stroke:#333,stroke-width:2px
    classDef data fill:#9370DB,stroke:#333,stroke-width:2px
    classDef infra fill:#808080,stroke:#333,stroke-width:2px

    %% User Interface Layer
    subgraph UI["User Interface Layer"]
        CLI["CLI Interface"]
        Discord["Discord Bot"]
    end

    %% Core Service Layer
    subgraph Core["Core Service Layer"]
        ScraperEngine["Scraper Engine"]
        DataManagement["Data Management"]
        ReportGen["Report Generator"]
        AIIntegration["AI Integration"]
        CronScheduler["Cron Scheduler"]
    end

    %% External Services Layer
    subgraph External["External Services Layer"]
        JobBoards["Company Job Boards"]
        DiscordWebhook["Discord Webhook"]
        Chrome["Chrome Browser"]
        GeminiAPI["Gemini AI API"]
    end

    %% Company Scrapers
    subgraph Scrapers["Company Scrapers"]
        Meta["Meta Scraper"]
        Netflix["Netflix Scraper"]
        Airbnb["Airbnb Scraper"]
        Stripe["Stripe Scraper"]
    end

    %% Relationships
    CLI --> ScraperEngine
    Discord --> CronScheduler
    CronScheduler --> ScraperEngine
    ScraperEngine --> Scrapers
    Scrapers --> JobBoards
    ScraperEngine --> DataManagement
    DataManagement --> ReportGen
    ReportGen --> Discord
    Discord --> DiscordWebhook
    AIIntegration --> GeminiAPI
    ScraperEngine --> Chrome

    %% Click events for component mapping
    click CLI "https://github.com/angelplusultra/job-shell/blob/main/src/handlers/handlers.rs"
    click Discord "https://github.com/angelplusultra/job-shell/blob/main/src/discord.rs"
    click CronScheduler "https://github.com/angelplusultra/job-shell/blob/main/src/cron.rs"
    click ScraperEngine "https://github.com/angelplusultra/job-shell/blob/main/src/scrapers/mod.rs"
    click DataManagement "https://github.com/angelplusultra/job-shell/blob/main/src/models/data.rs"
    click AIIntegration "https://github.com/angelplusultra/job-shell/blob/main/src/models/gemini.rs"
    click ReportGen "https://github.com/angelplusultra/job-shell/blob/main/src/reports.rs"
    click Meta "https://github.com/angelplusultra/job-shell/blob/main/src/scrapers/meta/scraper.rs"
    click Netflix "https://github.com/angelplusultra/job-shell/blob/main/src/scrapers/netflix/scraper.rs"
    click Airbnb "https://github.com/angelplusultra/job-shell/blob/main/src/scrapers/airbnb/scraper.rs"
    click Stripe "https://github.com/angelplusultra/job-shell/blob/main/src/scrapers/stripe/scraper.rs"

    %% Styling
    class CLI,Discord ui
    class ScraperEngine,DataManagement,ReportGen,AIIntegration,CronScheduler core
    class JobBoards,DiscordWebhook,Chrome,GeminiAPI external
    class Meta,Netflix,Airbnb,Stripe core

    %% Legend
    subgraph Legend
        UI_Component["User Interface"]:::ui
        Core_Component["Core Component"]:::core
        External_Service["External Service"]:::external
    end
```
