# teretzdev/linkedin_auto_jobs_applier_with_ai architecture

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

- Interactive diagram: https://gitdiagram.com/teretzdev/linkedin_auto_jobs_applier_with_ai
- Repository: https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai

## Overview

##### Project Type and Purpose
- This is an automation tool (a full-stack automation script) aimed at simplifying and optimizing the job search process on LinkedIn.
- The README explains that it performs automated job application submissions, dynamic resume creation, and uses AI-powered personalization (via the OpenAI API).
- The presence of multiple configuration files (config.yaml, plain_text_resume.yaml, secrets.yaml) and modules dedicated to handling LinkedIn interactions indicates it is modular and designed for high configurability.

##### Analyzing the File Structure
- Top-level Python scripts (e.g., main.py, linkedin_bot.py, gpt.py, linkedIn_easy_applier.py) indicate core business logic related to job application automation.
- Utility scripts, such as file_manager.py, config_validator.py, and utils.py, support processing and configuration validation.
- Several batch (and shell/PS1) scripts like create_venv.bat, setup.sh, setup_env.ps1, and install_requirements.bat support environment setup and dependency installation.
- The inclusion of package.json and package-lock.json—as well as JavaScript files in directories like resume_template and petals-chat.js—imply that some parts of the system may handle presentation or templating aspects (for dynamic resume generation) using Node.js.
- The data_folder and data_folder_example directories hold the YAML configuration and resume templates—the main configuration and sensitive data are segregated.

##### Main Components
a. Setup and Configuration Management:
- Environment Setup: Scripts such as create_venv.bat, install_dependencies.bat, and setup.sh.
- Configuration Files: .env, data_folder/config.yaml, data_folder/plain_text_resume.yaml, data_folder/secrets.yaml.
- Example folder: data_folder_example which serves as a guideline for correct configuration.

b. Core Automation Modules:
- LinkedIn Bot Components: Files like linkedin_bot.py, linkedIn_authenticator.py, linkedIn_bot_facade.py, linkedIn_easy_applier.py, and linkedIn_job_manager.py are the central modules that handle authentication, job search/filtering, and job application submission.
- Main Entrypoints: main.py and main_mix.py which orchestrate the execution flow.
- Supporting Modules: Modules like gpt.py (integrating AI services using OpenAI’s API), resume.py (dynamic resume generation), and file_manager.py (handling file operations).

c. Utility and Helper Scripts:
- Scripts such as config_validator.py, fix_encoding.py, archive_creator.py, strings.py, and utils.py provide supporting functionality (data validation, file management, encoding fixes, etc.).

d. Template and Presentation Layer:
- Resume Templates: The resume_template folder containing JavaScript and CSS files (casual_markdown.js, reorganizeHeader.js, resume.css) for resume formatting.
- Additional JavaScript files: petals-chat.js and files under path/to indicate there might be UI or template manipulation aspects, likely used in combination with Node.js.

e. External Dependencies:
- Third-Party APIs: OpenAI and Google APIs (configured via .env and YAML secrets).
- Chrome (and ChromeDriver) for automation – as noted in troubleshooting and usage.
- Node.js environment dependencies (referenced in package.json).

##### Relationships and Interactions
- The Setup/Configuration Block (environment variables, YAML files) feeds into the Automation Modules.
- The Core modules (LinkedIn Bot components) interact with external services (LinkedIn, OpenAI, Google) and utilize the configuration data.
- The Resume Generation component uses the plain_text_resume.yaml data and resume_template scripts to generate tailored resumes.
- Utility components support tasks like error logging (screenshots), configuration validation, and file management.

##### Architectural Patterns and Design Principles
- The system follows a modular design, segregating configuration, core automation logic, and utility functions.
- Emphasis is on separation of concerns: configuration management is clearly separated from business logic (i.e., the LinkedIn bot functionality) and presentation (resume templates).
- An orchestration pattern is visible via the main entry point (main.py) that calls various specialized modules in sequence.
- The integration of both Python and Node.js components suggests a polyglot ecosystem with distinct layers handling backend processing and template/formatting tasks.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Subgraph 1: Setup and Configuration
    subgraph "1. Setup and Configuration"
        A["create_venv.bat"]:::envsetup
        B["install_dependencies.bat"]:::envsetup
        C["setup.sh"]:::envsetup
        D["setup_env.ps1"]:::envsetup
        E["setup_python_env.bat"]:::envsetup
        F[".env.example"]:::config
        G["data_folder/config.yaml"]:::config
        H["data_folder/plain_text_resume.yaml"]:::config
        I["data_folder/secrets.yaml"]:::config
        J["data_folder_example"]:::config
    end

    %% Subgraph 2: Core Automation Modules
    subgraph "2. Core Automation Modules"
        K["main.py"]:::entrypoint
        L["main_mix.py"]:::entrypoint
        M["linkedin_bot.py"]:::core
        N["linkedIn_authenticator.py"]:::core
        O["linkedIn_bot_facade.py"]:::core
        P["linkedIn_easy_applier.py"]:::core
        Q["linkedIn_job_manager.py"]:::core
        R["job.py"]:::core
        S["gpt.py"]:::support
        T["resume.py"]:::support
        U["file_manager.py"]:::support
    end

    %% Subgraph 3: Utility and Helper Scripts
    subgraph "3. Utility and Helper Scripts"
        V["config_validator.py"]:::utility
        W["fix_encoding.py"]:::utility
        X["archive_creator.py"]:::utility
        Y["strings.py"]:::utility
        Z["utils.py"]:::utility
    end

    %% Subgraph 4: Template and Presentation Layer
    subgraph "4. Template and Presentation Layer"
        AA["resume_template (folder)"]:::template
        AB["casual_markdown.js"]:::template
        AC["reorganizeHeader.js"]:::template
        AD["resume.css"]:::template
        AE["petals-chat.js"]:::template
        AF["path/to (folder)"]:::template
    end

    %% Subgraph 5: External Integrations
    subgraph "5. External Integrations"
        AG["LinkedIn"]:::external
        AH["OpenAI API"]:::external
        AI["Google API"]:::external
        AJ["Chrome Automation"]:::external
    end

    %% Arrows from Setup and Configuration to Core Automation
    A -->|"init"| K
    B -->|"init"| K
    C -->|"init"| K
    D -->|"init"| K
    E -->|"init"| K
    F -->|"config"| K
    G -->|"config"| M
    H -->|"config"| T
    I -->|"config"| M
    J -->|"config"| M

    %% Internal interactions within Core Automation
    K -->|"orchestrates"| M
    K -->|"orchestrates"| L
    M -->|"authenticate"| AG
    N -->|"validate"| AG
    O -->|"facade"| M
    P -->|"submit"| AG
    Q -->|"manage"| M
    R -->|"job details"| M
    S -->|"calls"| AH
    T -->|"generates"| AA
    U -->|"handles"| T

    %% Utility interactions
    K -->|"validate"| V
    U -->|"assist"| Z

    %% Template internal details
    AA -->|"uses"| AB
    AA -->|"uses"| AC
    AA -->|"styles"| AD
    T -->|"formats"| AE

    %% External integration from Core
    K -->|"drives"| AJ

    %% Additional External contextual link (if needed)
    S -->|"may call"| AI

    %% Class definitions for color coding
    classDef envsetup fill:#AED6F1,stroke:#1F618D,stroke-width:2px;
    classDef config fill:#85C1E9,stroke:#1A5276,stroke-width:2px;
    classDef entrypoint fill:#82E0AA,stroke:#27AE60,stroke-width:2px;
    classDef core fill:#7DCEA0,stroke:#1E8449,stroke-width:2px;
    classDef support fill:#A9DFBF,stroke:#27AE60,stroke-width:2px;
    classDef utility fill:#FFCC80,stroke:#D68910,stroke-width:2px;
    classDef template fill:#F9E79F,stroke:#F4D03F,stroke-width:2px;
    classDef external fill:#F1948A,stroke:#C0392B,stroke-width:2px;

    %% Click Events
    click A "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/create_venv.bat"
    click B "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/install_dependencies.bat"
    click C "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/setup.sh"
    click D "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/setup_env.ps1"
    click E "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/setup_python_env.bat"
    click F "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/.env.example"
    click G "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/data_folder/config.yaml"
    click H "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/data_folder/plain_text_resume.yaml"
    click I "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/data_folder/secrets.yaml"
    click J "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/tree/main/data_folder_example"
    click K "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/main.py"
    click L "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/main_mix.py"
    click M "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/linkedin_bot.py"
    click N "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/linkedIn_authenticator.py"
    click O "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/linkedIn_bot_facade.py"
    click P "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/linkedIn_easy_applier.py"
    click Q "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/linkedIn_job_manager.py"
    click R "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/job.py"
    click S "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/gpt.py"
    click T "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/resume.py"
    click U "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/file_manager.py"
    click V "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/config_validator.py"
    click W "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/fix_encoding.py"
    click X "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/archive_creator.py"
    click Y "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/strings.py"
    click Z "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/utils.py"
    click AA "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/tree/main/resume_template"
    click AB "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/resume_template/casual_markdown.js"
    click AC "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/resume_template/reorganizeHeader.js"
    click AD "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/resume_template/resume.css"
    click AE "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/blob/main/petals-chat.js"
    click AF "https://github.com/teretzdev/linkedin_auto_jobs_applier_with_ai/tree/main/path/to"
```
