# jacob1802/seek-automation architecture

> Architecture diagram of the GitHub repository jacob1802/seek-automation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jacob1802/seek-automation
- Repository: https://github.com/jacob1802/seek-automation

## Overview

##### Project type and purpose
- This is a Python-based automation pipeline (CLI) that scrapes job listings, uses an LLM to generate customized cover letters, and sends out email applications with attachments, while tracking which applications have been sent.

##### File structure
- Top‐level files:
- `.env.example` / env variables → secrets for Apify & SMTP
- `main.py` → entry‐point
- `pyproject.toml`, `requirements.txt`, `uv.lock` → build/runtime dependencies
- Directories/modules:
- `config/` → argument parser (`args.py`) and runtime config (`run_config.json`)
- `scrapers/` → `scraper.py`: interfaces with Apify Seek Job Scraper API
- `agents/` → `agent.py`: encapsulates LLM interaction for cover‐letter generation
- `application_pipeline/` → `job_application_pipeline.py`: orchestrates the end-to-end flow
- `email_sender/` → `email_sender.py`: wraps SMTP logic for sending applications
- `application_materials/` → static inputs (resume.txt/pdf) and `applied.csv` for tracking
- `common/utils.py` & `utils.py` → shared helper functions

##### Extract architecture insights from README
- External services: Apify API (scraping), MetaAI LLM (cover letters), Gmail SMTP (email)
- Configurable search terms, result limits, sorting via JSON config or CLI flags
- Tracking to avoid duplicates via CSV

##### Main components & their interactions
a. Components
1. CLI Runner (main.py + uv runner)
2. Configuration Manager (config/args.py + run_config.json + env loader)
3. Scraper Module (scrapers/scraper.py ↔ Apify)
4. LLM Agent (agents/agent.py ↔ MetaAI LLM)
5. Pipeline Orchestrator (application_pipeline/job_application_pipeline.py)
6. Email Sender (email_sender/email_sender.py ↔ Gmail SMTP)
7. Data Store (application_materials/applied.csv)
b. Relationships & data flow
- CLI Runner loads env vars & config → passes into Pipeline Orchestrator
- Orchestrator invokes Scraper → receives job listings
- For each listing: call LLM Agent → generates cover letter text
- Attach resume (PDF) + generated cover letter → pass to Email Sender
- On success: append to `applied.csv` via Common Utils
c. Architectural patterns
- Pipeline pattern (linear, stage‐based)
- Modular separation: “one module = one responsibility” (Single Responsibility Principle)
d. Key technologies/frameworks
- Python 3.x, `uv` runner
- Apify Seek Job Scraper API
- MetaAI LLM API
- Gmail SMTP (via Python `smtplib` or similar)
- JSON config + CLI flags

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Automation Engine"
        CLI["CLI Runner"]:::internal
        ArgsParser["Args Parser"]:::internal
        RunConfig["run_config.json"]:::internal
        Orchestrator["Pipeline Orchestrator"]:::internal
        Scraper["Scraper Module"]:::internal
        Agent["LLM Agent"]:::internal
        EmailSender["Email Sender"]:::internal
    end

    Apify["Apify Job Scraper API"]:::external
    MetaAI["MetaAI LLM"]:::external
    SMTP["Gmail SMTP"]:::external
    DataStore["applied.csv"]:::database

    ArgsParser -->|loads config| Orchestrator
    RunConfig -->|provides settings| Orchestrator
    CLI -->|initiates pipeline| Orchestrator
    Orchestrator -->|fetch listings| Scraper
    Scraper -->|calls API| Apify
    Orchestrator -->|generate letters| Agent
    Agent -->|calls LLM| MetaAI
    Orchestrator -->|send email| EmailSender
    EmailSender -->|SMTP send| SMTP
    EmailSender -->|append record| DataStore

    click CLI "https://github.com/jacob1802/seek-automation/blob/main/main.py"
    click ArgsParser "https://github.com/jacob1802/seek-automation/blob/main/config/args.py"
    click RunConfig "https://github.com/jacob1802/seek-automation/blob/main/config/run_config.json"
    click Scraper "https://github.com/jacob1802/seek-automation/blob/main/scrapers/scraper.py"
    click Agent "https://github.com/jacob1802/seek-automation/blob/main/agents/agent.py"
    click Orchestrator "https://github.com/jacob1802/seek-automation/blob/main/application_pipeline/job_application_pipeline.py"
    click EmailSender "https://github.com/jacob1802/seek-automation/blob/main/email_sender/email_sender.py"
    click DataStore "https://github.com/jacob1802/seek-automation/blob/main/application_materials/applied.csv"

    classDef internal fill:#ADD8E6,stroke:#000;
    classDef external fill:#FFA500,stroke:#000;
    classDef database fill:#90EE90,stroke:#000;
```
