# aharneish/daily-job-digest architecture

> Architecture diagram of the GitHub repository aharneish/daily-job-digest, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aharneish/daily-job-digest
- Repository: https://github.com/aharneish/daily-job-digest

## Overview

##### Project Type and Purpose
- This is an automation/batch-job project (not a full-stack web app).
- It runs on a schedule (GitHub Actions) or manually and collects job listings to send a daily email digest.

##### Main Components
a. Scheduler
- GitHub Actions workflow (cron + manual trigger).
b. Execution Environment
- GitHub runner (Ubuntu) OR local developer machine OR Docker container.
c. Application Code
- Entry points: `daily_job_digest.py` (main digest logic) and `main.py` (utilities/CLI).
- Internal module: `Job-bot/` (helper functions, scrapers).
d. Data Store
- Static CSV: `job_listings.csv`.
e. External Services
- LinkedIn (job scraping via session cookie).
- Gmail SMTP (send email via `GMAIL_USER`/`GMAIL_PASS`).
f. Configuration
- Environment variables (`.env` or CI secrets).
- `render.yaml`, `pyproject.toml`, `requirements.txt`, lock files.

##### Relationships and Data Flows
- Scheduler → clones repo → spins up runner/container
- Runner/container → installs dependencies → executes `daily_job_digest.py`
- Script → reads `job_listings.csv` → optionally scrapes LinkedIn (using `LINKEDIN_SESSION_COOKIE`) → aggregates listings
- Script → connects to Gmail SMTP → sends digest email to recipients
- Workflow logs/results return to GitHub Actions for audit

##### Architectural Patterns & Design Principles
- Batch-processing pipeline (ETL-style): Extract (CSV + scraping), Transform (aggregate/filter), Load (email).
- Twelve-factor app principles for config via environment variables.
- Containerization for environment consistency.

##### Technologies & Frameworks
- Python 3.x
- GitHub Actions (YAML workflow)
- Docker (Dockerfile.dockerfile)
- Gmail SMTP
- CSV file I/O, HTTP scraping (inside Job-bot module)

##### Final Composition
- Middle layer:
- Code components:
– `daily_job_digest.py`
– `Job-bot/` library
– `main.py` (utility entry)
- Footer: optional “Developer Machine” path replicating the Runner/Container flow.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Scheduler Layer
    subgraph "Scheduler"
        GHWF["GitHub Actions Workflow"]:::scheduler
    end

    %% Execution Environment Layer
    subgraph "Execution Environment"
        RC["Runner/Container (Ubuntu/GitHub Runner/Docker/Local)"]:::compute
        DC["Docker Container Definition"]:::compute
        PV["Python Version Pinning"]:::compute
    end

    %% Application Code Layer
    subgraph "Application Code"
        DJD["daily_job_digest.py"]:::code
        MPY["main.py"]:::code
        JB["Job-bot/"]:::code
    end

    %% Configuration Layer
    subgraph "Configuration"
        ENV["Environment Variables (.env)"]:::config
        RENDER["Render Settings (render.yaml)"]:::config
        PYPROJ["pyproject.toml"]:::config
        REQ["requirements.txt"]:::config
        LOCK["uv.lock"]:::config
        GITIGN[".gitignore"]:::config
        README["README.md"]:::docs
    end

    %% Data Store Layer
    subgraph "Data Store"
        CSV["job_listings.csv"]:::datastore
    end

    %% External Services Layer
    subgraph "External Services"
        LI["LinkedIn"]:::external
        SMTP["Gmail SMTP"]:::external
    end

    %% Connections
    GHWF -->|"triggers"| RC
    RC --> DC
    RC --> PV
    RC -->|executes| DJD
    RC -->|executes| MPY

    DJD -->|uses| JB
    DJD -->|reads/writes| CSV
    DJD -->|calls| LI
    DJD -->|sends email via| SMTP

    MPY -->|utilities| JB

    %% Config connections
    ENV --> DJD
    ENV --> MPY
    ENV --> DC
    ENV --> RC

    RENDER --> RC
    PYPROJ --> RC
    PYPROJ --> DJD
    REQ --> RC
    REQ --> DJD
    LOCK --> RC
    LOCK --> DJD
    GITIGN --> RC
    README --> RC

    %% Click Events
    click GHWF "https://github.com/aharneish/daily-job-digest/blob/master/.github/workflows/daily-job.yml"
    click DC "https://github.com/aharneish/daily-job-digest/blob/master/.dockerfile"
    click PV "https://github.com/aharneish/daily-job-digest/blob/master/.python-version"
    click ENV "https://github.com/aharneish/daily-job-digest/blob/master/.env"
    click RENDER "https://github.com/aharneish/daily-job-digest/blob/master/render.yaml"
    click PYPROJ "https://github.com/aharneish/daily-job-digest/blob/master/pyproject.toml"
    click REQ "https://github.com/aharneish/daily-job-digest/blob/master/requirements.txt"
    click LOCK "https://github.com/aharneish/daily-job-digest/blob/master/uv.lock"
    click GITIGN "https://github.com/aharneish/daily-job-digest/blob/master/.gitignore"
    click README "https://github.com/aharneish/daily-job-digest/blob/master/README.md"
    click DJD "https://github.com/aharneish/daily-job-digest/blob/master/daily_job_digest.py"
    click MPY "https://github.com/aharneish/daily-job-digest/blob/master/main.py"
    click JB "https://github.com/aharneish/daily-job-digest/tree/master/Job-bot/"
    click CSV "https://github.com/aharneish/daily-job-digest/blob/master/job_listings.csv"

    %% Styles
    classDef scheduler fill:#DDA0DD,stroke:#800080,stroke-width:2px
    classDef compute fill:#AFEEEE,stroke:#008B8B,stroke-width:2px
    classDef code fill:#90EE90,stroke:#006400,stroke-width:2px
    classDef config fill:#F0E68C,stroke:#B8860B,stroke-width:2px
    classDef datastore fill:#FFE4B5,stroke:#CD853F,stroke-width:2px
    classDef external fill:#FFA07A,stroke:#FF4500,stroke-width:2px
    classDef docs fill:#E0E0E0,stroke:#A9A9A9,stroke-width:2px
```
