# cheesestringer/salary-seeker architecture

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

- Interactive diagram: https://gitdiagram.com/cheesestringer/salary-seeker
- Repository: https://github.com/cheesestringer/salary-seeker

## Overview

##### Project Type Understanding
This is a browser extension project that integrates with Seek job listings to reveal hidden salary information. The project is primarily frontend-focused, as it operates within the user's browser without a backend server.

##### Main Components

a. Browser Extension Layer:
- Supported browsers: Chrome, Firefox, Opera, and Edge

b. Core Components (based on src/ structure):
- Components Module (src/components)
- Contents Module (src/contents)
- Services Module (src/services)

c. External Integration:
- Seek.com.au and Seek.co.nz websites
- Browser Extension APIs

##### Component Relationships

**Browser → Extension → Seek Website**
- ↓
- Content Scripts
- ↓
- Seek Service
- ↓
- UI Components

##### Specific Implementation Details

- Rounded rectangles for services
- Hexagons for external interfaces

##### Key Elements to Highlight

a. Content Script Integration:
- How seekJob.tsx and seekListing.tsx inject into Seek pages
- Content script's interaction with the DOM

b. Service Layer:
- Demonstrate how seekService.ts interfaces with Seek's content
- Salary data extraction flow

c. Component Layer:
- How seek.tsx renders the salary information
- Integration with the page's existing content

##### Technical Details

- TypeScript as the primary language (indicated by .ts and .tsx files)
- Browser extension manifest and permissions
- Content script injection points
- DOM manipulation flows

##### Important Notes

- A note about privacy (all processing happens client-side)
- Browser compatibility information
- Extension's activation flow
- Where salary data is extracted and displayed

**[Browser Layer]**
- ↓
**[Extension Framework]**
- ↓
**[Content Scripts]**
- ↓
**[Services]**
- ↓
**[UI Components]**
- ↓
**[Seek Website Integration]**

## Diagram (Mermaid)

```mermaid
%%{init: {
  'theme': 'base',
  'themeVariables': {
    'primaryColor': '#2a9d8f',
    'primaryTextColor': '#fff',
    'primaryBorderColor': '#2a9d8f',
    'lineColor': '#264653',
    'secondaryColor': '#e9c46a',
    'tertiaryColor': '#f4a261'
  }
}}%%

flowchart TB
    classDef browser fill:#264653,stroke:#264653,color:#fff
    classDef extension fill:#2a9d8f,stroke:#2a9d8f,color:#fff
    classDef content fill:#e9c46a,stroke:#e9c46a,color:#333
    classDef service fill:#f4a261,stroke:#f4a261,color:#333
    classDef component fill:#e76f51,stroke:#e76f51,color:#fff
    classDef external fill:#grey,stroke:#grey,color:#333

    subgraph Browsers
        Chrome[Chrome]:::browser
        Firefox[Firefox]:::browser
        Opera[Opera]:::browser
        Edge[Edge]:::browser
    end

    subgraph ExtensionFramework["Browser Extension Framework"]
        Manifest[("Manifest\n& Permissions")]:::extension
        ExtAPI["Extension APIs"]:::extension
    end

    subgraph ContentScripts["Content Scripts Layer"]
        JobPages["Job Pages Handler"]:::content
        ListingPages["Listing Pages Handler"]:::content
        click JobPages "https://github.com/cheesestringer/salary-seeker/blob/master/src/contents/seekJob.tsx"
        click ListingPages "https://github.com/cheesestringer/salary-seeker/blob/master/src/contents/seekListing.tsx"
    end

    subgraph ServiceLayer["Service Layer"]
        SeekService["Seek Service"]:::service
        Utils["Common Utilities"]:::service
        Constants["Constants"]:::service
        click SeekService "https://github.com/cheesestringer/salary-seeker/blob/master/src/services/seekService.ts"
        click Utils "https://github.com/cheesestringer/salary-seeker/blob/master/src/common.ts"
        click Constants "https://github.com/cheesestringer/salary-seeker/blob/master/src/constants.ts"
    end

    subgraph ComponentLayer["Component Layer"]
        UIComponents["UI Components"]:::component
        SeekComponent["Seek Component"]:::component
        click UIComponents "https://github.com/cheesestringer/salary-seeker/tree/master/src/components/"
        click SeekComponent "https://github.com/cheesestringer/salary-seeker/blob/master/src/components/seek.tsx"
    end

    subgraph External["External Integration"]
        SeekAU["Seek.com.au"]:::external
        SeekNZ["Seek.co.nz"]:::external
    end

    Chrome & Firefox & Opera & Edge --> ExtensionFramework
    ExtensionFramework --> ContentScripts
    ContentScripts --> ServiceLayer
    ServiceLayer --> ComponentLayer
    ComponentLayer --> External

    %% Click events for directories
    click ContentScripts "https://github.com/cheesestringer/salary-seeker/tree/master/src/contents/"
    click ServiceLayer "https://github.com/cheesestringer/salary-seeker/tree/master/src/services/"

    %% Legend
    classDef legendClass fill:none,stroke:none
    subgraph Legend
        B1[Browser]:::browser
        E1[Extension]:::extension
        C1[Content]:::content
        S1[Service]:::service
        CO1[Component]:::component
        EX1[External]:::external
    end
```
