# artchiee/job_hunt architecture

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

- Interactive diagram: https://gitdiagram.com/artchiee/job_hunt
- Repository: https://github.com/artchiee/job_hunt

## Overview

##### Project type and purpose
- This is a standalone CLI-based web-scraping tool written in Python. Its sole responsibility is to automate job searches on the Indeed worldwide site, parse results, and persist them into a JSON file.

##### File structure
- Top-level files:
- Job_Scapper.py      → main orchestrator script
- web_driver_configs.py → Selenium/ChromeDriver configuration
- locations.json       → input lookup table for location IDs
- chromedriver         → binary used by Selenium
- requirements.txt, Pipfile, Pipfile.lock → dependency manifests
- README.md, Todo.txt → documentation
- No subdirectories—this is a single-module project with clear separation between code, configuration, and data.

##### README for additional insights
- The README confirms it is CLI-driven, expects two optional inputs (location ID or city, and job title), and writes out a JSON file of scraped job postings.
- It uses pipenv or pip install for environment setup.
- The script internally navigates the Indeed UI via Selenium, sets the date filter to “Last 7 days,” and saves results.

a. Main components:
1. CLI Interface (User)
2. Python Runtime Environment (Virtualenv / Pipenv)
3. Job_Scapper Module (orchestrator)
4. Configuration Module (web_driver_configs.py + locations.json)
5. WebDriver (ChromeDriver binary + Selenium bindings)
6. External Service (Indeed.com)
7. Data Store (output JSON file)

b. Relationships and interactions:
- The User invokes the CLI → passes inputs into Job_Scapper.
- Job_Scapper loads configurations from web_driver_configs.py and locations.json.
- Job_Scapper instantiates Selenium WebDriver (chromedriver binary) under Python.
- WebDriver sends HTTP requests and browser commands to Indeed.com → retrieves HTML.
- Job_Scapper parses the HTML → assembles job postings objects.
- Parsed results are serialized and written to a local JSON file.

c. Architectural patterns / design principles:
- Single-responsibility: each module handles one concern (config vs scraping logic).
- Layered interaction: CLI → Orchestrator → Config → WebDriver → External site → Data store.
- Stateless between runs: no persistent database, only file I/O.

d. Key technologies and libraries:
- Python 3.x, pipenv / pip
- Selenium WebDriver, ChromeDriver
- JSON for input (locations.json) and output serialization
- requests or built-in urllib (if used) – in this case, Selenium only.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Components
    UserCLI["User / CLI"]:::external
    PythonEnv["Python Runtime Environment"]:::internal
    JobScapper["Job_Scapper.py"]:::internal
    Config["Configuration Module\n(web_driver_configs.py + locations.json)"]:::internal
    WebDriver["Selenium WebDriver\n(chromedriver)"]:::internal
    Indeed["Indeed.com\n(External Service)"]:::external
    Output["Output: jobs.json"]:::data

    %% Flow
    UserCLI -->|"invoke CLI"| JobScapper
    JobScapper -->|"load config"| Config
    JobScapper -->|"instantiate"| WebDriver
    WebDriver -->|"navigate & fetch HTML"| Indeed
    Indeed -->|"HTML response"| WebDriver
    JobScapper -->|"parse & serialize"| Output

    %% Click Events
    click JobScapper "https://github.com/artchiee/job_hunt/blob/master/Job_Scapper.py"
    click PythonEnv "https://github.com/artchiee/job_hunt/tree/master/Pipfile"
    click PythonEnv "https://github.com/artchiee/job_hunt/blob/master/Pipfile.lock"
    click PythonEnv "https://github.com/artchiee/job_hunt/blob/master/requirements.txt"
    click Config "https://github.com/artchiee/job_hunt/blob/master/web_driver_configs.py"
    click Config "https://github.com/artchiee/job_hunt/blob/master/locations.json"
    click WebDriver "https://github.com/artchiee/job_hunt/tree/master/chromedriver"

    %% Styles
    classDef internal fill:#D6EAF8,stroke:#1B4F72,stroke-width:1px;
    classDef external fill:#F5B7B1,stroke:#641E16,stroke-width:1px;
    classDef data fill:#ABEBC6,stroke:#145A32,stroke-width:1px;
```
