# chathrapathinikhil/web-extension architecture

> Architecture diagram of the GitHub repository chathrapathinikhil/web-extension, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chathrapathinikhil/web-extension
- Repository: https://github.com/chathrapathinikhil/web-extension

## Overview

HireSignal is a Chrome extension and Express service for job seekers to inspect employer hiring history and news, check job-description eligibility signals, and submit data corrections. The main workflow runs from a job-board listing through the content script’s injected controls to a locally computed eligibility result and an employer-insights request; reporting and .edu email verification are supporting flows. The sampled source supports the extension/backend wiring and SQL, news, and email integrations; several README capabilities, including detailed trend rendering and auto-reactivity, are described but not fully visible in the excerpts.

Main entry points: [`frontend/public/extension.js`](https://github.com/chathrapathinikhil/web-extension/blob/main/frontend/public/extension.js) (Listing controls), [`frontend/public/popup.js`](https://github.com/chathrapathinikhil/web-extension/blob/main/frontend/public/popup.js) (Login popup), [`backend/controllers/index.js`](https://github.com/chathrapathinikhil/web-extension/blob/main/backend/controllers/index.js) (Employer lookup), [`backend/routes/index.js`](https://github.com/chathrapathinikhil/web-extension/blob/main/backend/routes/index.js) (HTTP routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_extension["Job-board extension"]
  node_content_script["Listing controls<br/>[extension.js]"]
  node_eligibility["Eligibility check<br/>[extension.js]"]
  node_background["Extension messaging<br/>[background.js]"]
  node_report_form["Issue report form<br/>[report.js]"]
end

subgraph group_identity["Access and identity"]
  node_popup["Login popup<br/>[popup.js]"]
  node_verification["Email verification<br/>[verify.js]"]
  node_local_state[("Login state")]
end

subgraph group_service["Insights service"]
  node_insights_page["Company insights<br/>[index.js]"]
  node_routes["HTTP routes<br/>[index.js]"]
  node_server["Express server<br/>[app.js]"]
  node_employer_lookup["Employer lookup<br/>[index.js]"]
  node_report_handler["Report handler<br/>[index.js]"]
end

subgraph group_integrations["Data and external services"]
  node_firebase["Firebase Auth"]
  node_sql_db[("Hiring records")]
  node_news_service["Company news API"]
  node_email_service["Report email"]
end

node_seeker(("Job seeker"))
node_job_board["Job board"]

node_seeker -->|"views listings"| node_job_board
node_job_board -->|"hosts script"| node_content_script
node_content_script -->|"adds controls"| node_job_board
node_content_script -->|"checks login"| node_local_state
node_content_script -->|"checks description"| node_eligibility
node_content_script -->|"requests login"| node_background
node_background -->|"opens popup"| node_popup
node_popup -->|"authenticates"| node_firebase
node_popup -->|"opens verification"| node_verification
node_verification -->|"checks verification"| node_firebase
node_popup -->|"stores login"| node_local_state
node_content_script -->|"requests employer data"| node_server
node_server -->|"dispatches"| node_routes
node_routes -->|"dispatches lookup"| node_employer_lookup
node_employer_lookup -->|"queries records"| node_sql_db
node_employer_lookup -->|"fetches news"| node_news_service
node_employer_lookup -->|"renders insights"| node_insights_page
node_insights_page -->|"shows trends and news"| node_seeker
node_content_script -->|"opens report form"| node_report_form
node_report_form -->|"posts report"| node_server
node_routes -->|"dispatches report"| node_report_handler
node_report_handler -->|"sends report"| node_email_service

click node_content_script "https://github.com/chathrapathinikhil/web-extension/blob/main/frontend/public/extension.js"
click node_eligibility "https://github.com/chathrapathinikhil/web-extension/blob/main/frontend/public/extension.js"
click node_popup "https://github.com/chathrapathinikhil/web-extension/blob/main/frontend/public/popup.js"
click node_background "https://github.com/chathrapathinikhil/web-extension/blob/main/frontend/public/background.js"
click node_verification "https://github.com/chathrapathinikhil/web-extension/blob/main/frontend/public/verify.js"
click node_insights_page "https://github.com/chathrapathinikhil/web-extension/blob/main/backend/controllers/index.js"
click node_report_form "https://github.com/chathrapathinikhil/web-extension/blob/main/frontend/public/report.js"
click node_routes "https://github.com/chathrapathinikhil/web-extension/blob/main/backend/routes/index.js"
click node_server "https://github.com/chathrapathinikhil/web-extension/blob/main/backend/app.js"
click node_employer_lookup "https://github.com/chathrapathinikhil/web-extension/blob/main/backend/controllers/index.js"
click node_report_handler "https://github.com/chathrapathinikhil/web-extension/blob/main/backend/controllers/index.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_content_script,node_eligibility,node_background,node_report_form toneBlue
class node_popup,node_verification,node_local_state toneAmber
class node_insights_page,node_routes,node_server,node_employer_lookup,node_report_handler toneMint
class node_firebase,node_sql_db,node_news_service,node_email_service toneRose
class node_seeker,node_job_board toneIndigo
```

## Components

### Job-board extension

- [Listing controls](https://github.com/chathrapathinikhil/web-extension/blob/main/frontend/public/extension.js): `frontend/public/extension.js`
- [Eligibility check](https://github.com/chathrapathinikhil/web-extension/blob/main/frontend/public/extension.js): `frontend/public/extension.js`
- [Extension messaging](https://github.com/chathrapathinikhil/web-extension/blob/main/frontend/public/background.js): `frontend/public/background.js`
- [Issue report form](https://github.com/chathrapathinikhil/web-extension/blob/main/frontend/public/report.js): `frontend/public/report.js`

### Access and identity

- [Login popup](https://github.com/chathrapathinikhil/web-extension/blob/main/frontend/public/popup.js): `frontend/public/popup.js`
- [Email verification](https://github.com/chathrapathinikhil/web-extension/blob/main/frontend/public/verify.js): `frontend/public/verify.js`
- **Login state**

### Insights service

- [Company insights](https://github.com/chathrapathinikhil/web-extension/blob/main/backend/controllers/index.js): `backend/controllers/index.js`
- [HTTP routes](https://github.com/chathrapathinikhil/web-extension/blob/main/backend/routes/index.js): `backend/routes/index.js`
- [Express server](https://github.com/chathrapathinikhil/web-extension/blob/main/backend/app.js): `backend/app.js`
- [Employer lookup](https://github.com/chathrapathinikhil/web-extension/blob/main/backend/controllers/index.js): `backend/controllers/index.js`
- [Report handler](https://github.com/chathrapathinikhil/web-extension/blob/main/backend/controllers/index.js): `backend/controllers/index.js`

### Data and external services

- **Firebase Auth**
- **Hiring records**
- **Company news API**
- **Report email**

### Other components

- **Job seeker**
- **Job board**

## Connections

- Job seeker → Job board: views listings
- Job board → Listing controls: hosts script
- Listing controls → Job board: adds controls
- Listing controls → Login state: checks login
- Listing controls → Eligibility check: checks description
- Listing controls → Extension messaging: requests login
- Extension messaging → Login popup: opens popup
- Login popup → Firebase Auth: authenticates
- Login popup → Email verification: opens verification
- Email verification → Firebase Auth: checks verification
- Login popup → Login state: stores login
- Listing controls → Express server: requests employer data
- Express server → HTTP routes: dispatches
- HTTP routes → Employer lookup: dispatches lookup
- Employer lookup → Hiring records: queries records
- Employer lookup → Company news API: fetches news
- Employer lookup → Company insights: renders insights
- Company insights → Job seeker: shows trends and news
- Listing controls → Issue report form: opens report form
- Issue report form → Express server: posts report
- HTTP routes → Report handler: dispatches report
- Report handler → Report email: sends report
