# jsmastery-pro/jobpilot architecture

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

- Interactive diagram: https://gitdiagram.com/jsmastery-pro/jobpilot
- Repository: https://github.com/jsmastery-pro/jobpilot
- Video tour (about a minute): https://gitdiagram.com/jsmastery-pro/jobpilot/video

## Overview

JobPilot supports a technical job seeker from profile setup and authenticated LinkedIn discovery through match scoring, job review, resume tailoring, and optional experimental application automation. The map retains the documented recording and review capabilities. Sampled route excerpts and SOURCE INDEX references establish the main orchestration; unsampled subsystems are included where README capabilities are clear, with evidence limits reflected in edges.

Main entry points: [`app/api/agent/find/route.ts`](https://github.com/jsmastery-pro/jobpilot/blob/main/app/api/agent/find/route.ts) (Find Jobs API), [`lib/insforge-server.ts`](https://github.com/jsmastery-pro/jobpilot/blob/main/lib/insforge-server.ts) (InsForge Data), [`app/api/resume/tailor/route.ts`](https://github.com/jsmastery-pro/jobpilot/blob/main/app/api/resume/tailor/route.ts) (Resume APIs), [`app/(app)/jobs/page.tsx`](https://github.com/jsmastery-pro/jobpilot/blob/main/app/(app)/jobs/page.tsx) (Job Inventory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User Experience"]
  node_profile_ui["Profile Editor<br/>[ProfileForm.tsx]"]
  node_jobs_page["Job Inventory<br/>[page.tsx]"]
  node_job_table["Inventory Table"]
  node_job_detail["Job Review<br/>[JobDetails.tsx]"]
  node_agent_controls["Discovery Controls<br/>[AgentControls.tsx]"]
end

subgraph group_jobs["Job Discovery"]
  node_find_route["Find Jobs API<br/>[route.ts]"]
  node_linkedin_discovery["LinkedIn Discovery<br/>[linkedin.ts]"]
  node_matcher["Match Scoring<br/>[matcher.ts]"]
end

subgraph group_resume["Resume Workflow"]
  node_resume_routes["Resume APIs<br/>[route.ts]"]
  node_resume_engine["Resume Generation<br/>[resume.tsx]"]
end

subgraph group_automation["Apply Automation"]
  node_apply_route["Apply API<br/>[route.ts]"]
  node_agent_runtime["Apply Orchestrator<br/>[index.ts]"]
  node_apply_agent["Apply Worker<br/>[apply.ts]"]
  node_stagehand["Browser Automation<br/>[stagehand.ts]"]
  node_recording["Session Recordings<br/>[recording.ts]"]
end

subgraph group_platform["Identity and Data"]
  node_profile_action["Profile Actions<br/>[profile.ts]"]
  node_insforge[("InsForge Data<br/>[insforge-server.ts]")]
  node_auth["Authentication<br/>[auth.ts]"]
end

node_seeker(("Job Seeker"))
node_browserbase{{"Browserbase"}}
node_linkedin{{"LinkedIn"}}
node_agentspan{{"AgentSpan"}}

node_seeker -->|"edits profile"| node_profile_ui
node_profile_ui -->|"submits changes"| node_profile_action
node_profile_action -->|"writes profile"| node_insforge
node_seeker -->|"starts search"| node_agent_controls
node_agent_controls -.->|"requests discovery"| node_find_route
node_find_route -->|"checks session"| node_auth
node_find_route -->|"creates run"| node_insforge
node_find_route -->|"discovers jobs"| node_linkedin_discovery
node_linkedin_discovery -->|"searches listings"| node_linkedin
node_linkedin_discovery -->|"uses saved session"| node_browserbase
node_find_route -->|"scores discovered jobs"| node_matcher
node_matcher -.->|"stores matches"| node_insforge
node_seeker -->|"reviews matches"| node_jobs_page
node_jobs_page -->|"loads inventory"| node_insforge
node_jobs_page -->|"renders inventory"| node_job_table
node_seeker -->|"opens role"| node_job_detail
node_job_detail -.->|"requests tailoring"| node_resume_routes
node_resume_routes -->|"checks session"| node_auth
node_resume_routes -->|"reads profile and stores PDF"| node_insforge
node_resume_routes -->|"generates PDF"| node_resume_engine
node_seeker -->|"triggers apply"| node_apply_route
node_apply_route -->|"starts orchestration"| node_agent_runtime
node_agent_runtime -->|"dispatches job"| node_apply_agent
node_apply_agent -->|"automates forms"| node_stagehand
node_stagehand -->|"runs browser session"| node_browserbase
node_apply_agent -->|"saves recording"| node_recording
node_agent_runtime -->|"runs durable jobs"| node_agentspan

click node_profile_ui "https://github.com/jsmastery-pro/jobpilot/blob/main/components/profile/ProfileForm.tsx"
click node_profile_action "https://github.com/jsmastery-pro/jobpilot/blob/main/actions/profile.ts"
click node_jobs_page "https://github.com/jsmastery-pro/jobpilot/blob/main/app/(app)/jobs/page.tsx"
click node_job_table "https://github.com/jsmastery-pro/jobpilot/blob/main/components/jobs/JobsInventoryTable.tsx"
click node_job_detail "https://github.com/jsmastery-pro/jobpilot/blob/main/components/jobs/JobDetails.tsx"
click node_agent_controls "https://github.com/jsmastery-pro/jobpilot/blob/main/components/dashboard/AgentControls.tsx"
click node_find_route "https://github.com/jsmastery-pro/jobpilot/blob/main/app/api/agent/find/route.ts"
click node_linkedin_discovery "https://github.com/jsmastery-pro/jobpilot/blob/main/agent/linkedin.ts"
click node_matcher "https://github.com/jsmastery-pro/jobpilot/blob/main/agent/matcher.ts"
click node_insforge "https://github.com/jsmastery-pro/jobpilot/blob/main/lib/insforge-server.ts"
click node_resume_routes "https://github.com/jsmastery-pro/jobpilot/blob/main/app/api/resume/tailor/route.ts"
click node_resume_engine "https://github.com/jsmastery-pro/jobpilot/blob/main/lib/resume.tsx"
click node_apply_route "https://github.com/jsmastery-pro/jobpilot/blob/main/app/api/agent/apply/route.ts"
click node_agent_runtime "https://github.com/jsmastery-pro/jobpilot/blob/main/agent/index.ts"
click node_apply_agent "https://github.com/jsmastery-pro/jobpilot/blob/main/agent/apply.ts"
click node_stagehand "https://github.com/jsmastery-pro/jobpilot/blob/main/lib/stagehand.ts"
click node_recording "https://github.com/jsmastery-pro/jobpilot/blob/main/agent/recording.ts"
click node_auth "https://github.com/jsmastery-pro/jobpilot/blob/main/lib/auth.ts"

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_profile_ui,node_jobs_page,node_job_table,node_job_detail,node_agent_controls,node_browserbase toneBlue
class node_find_route,node_linkedin_discovery,node_matcher toneAmber
class node_resume_routes,node_resume_engine toneMint
class node_apply_route,node_agent_runtime,node_apply_agent,node_stagehand,node_recording toneRose
class node_profile_action,node_insforge,node_auth,node_seeker,node_linkedin,node_agentspan toneIndigo
```

## Components

### User Experience

- [Profile Editor](https://github.com/jsmastery-pro/jobpilot/blob/main/components/profile/ProfileForm.tsx): `components/profile/ProfileForm.tsx`
- [Job Inventory](https://github.com/jsmastery-pro/jobpilot/blob/main/app/(app)/jobs/page.tsx): `app/(app)/jobs/page.tsx`
- [Inventory Table](https://github.com/jsmastery-pro/jobpilot/blob/main/components/jobs/JobsInventoryTable.tsx): `components/jobs/JobsInventoryTable.tsx`
- [Job Review](https://github.com/jsmastery-pro/jobpilot/blob/main/components/jobs/JobDetails.tsx): `components/jobs/JobDetails.tsx`
- [Discovery Controls](https://github.com/jsmastery-pro/jobpilot/blob/main/components/dashboard/AgentControls.tsx): `components/dashboard/AgentControls.tsx`

### Job Discovery

- [Find Jobs API](https://github.com/jsmastery-pro/jobpilot/blob/main/app/api/agent/find/route.ts): `app/api/agent/find/route.ts`
- [LinkedIn Discovery](https://github.com/jsmastery-pro/jobpilot/blob/main/agent/linkedin.ts): `agent/linkedin.ts`
- [Match Scoring](https://github.com/jsmastery-pro/jobpilot/blob/main/agent/matcher.ts): `agent/matcher.ts`

### Resume Workflow

- [Resume APIs](https://github.com/jsmastery-pro/jobpilot/blob/main/app/api/resume/tailor/route.ts): `app/api/resume/tailor/route.ts`
- [Resume Generation](https://github.com/jsmastery-pro/jobpilot/blob/main/lib/resume.tsx): `lib/resume.tsx`

### Apply Automation

- [Apply API](https://github.com/jsmastery-pro/jobpilot/blob/main/app/api/agent/apply/route.ts): `app/api/agent/apply/route.ts`
- [Apply Orchestrator](https://github.com/jsmastery-pro/jobpilot/blob/main/agent/index.ts): `agent/index.ts`
- [Apply Worker](https://github.com/jsmastery-pro/jobpilot/blob/main/agent/apply.ts): `agent/apply.ts`
- [Browser Automation](https://github.com/jsmastery-pro/jobpilot/blob/main/lib/stagehand.ts): `lib/stagehand.ts`
- [Session Recordings](https://github.com/jsmastery-pro/jobpilot/blob/main/agent/recording.ts): `agent/recording.ts`

### Identity and Data

- [Profile Actions](https://github.com/jsmastery-pro/jobpilot/blob/main/actions/profile.ts): `actions/profile.ts`
- [InsForge Data](https://github.com/jsmastery-pro/jobpilot/blob/main/lib/insforge-server.ts): `lib/insforge-server.ts`
- [Authentication](https://github.com/jsmastery-pro/jobpilot/blob/main/lib/auth.ts): `lib/auth.ts`

### Other components

- **Job Seeker**
- **Browserbase**
- **LinkedIn**
- **AgentSpan**

## Connections

- Job Seeker → Profile Editor: edits profile (evidence: `README.md`)
- Profile Editor → Profile Actions: submits changes (evidence: `components/profile/ProfileForm.tsx`)
- Profile Actions → InsForge Data: writes profile (evidence: `actions/profile.ts`)
- Job Seeker → Discovery Controls: starts search (evidence: `README.md`)
- Discovery Controls → Find Jobs API: requests discovery
- Find Jobs API → Authentication: checks session (evidence: `app/api/agent/find/route.ts`)
- Find Jobs API → InsForge Data: creates run (evidence: `app/api/agent/find/route.ts`)
- Find Jobs API → LinkedIn Discovery: discovers jobs (evidence: `app/api/agent/find/route.ts`)
- LinkedIn Discovery → LinkedIn: searches listings (evidence: `README.md`)
- LinkedIn Discovery → Browserbase: uses saved session (evidence: `README.md`)
- Find Jobs API → Match Scoring: scores discovered jobs (evidence: `app/api/agent/find/route.ts`)
- Match Scoring → InsForge Data: stores matches (evidence: `agent/matcher.ts`)
- Job Seeker → Job Inventory: reviews matches (evidence: `README.md`)
- Job Inventory → InsForge Data: loads inventory (evidence: `app/(app)/jobs/page.tsx`)
- Job Inventory → Inventory Table: renders inventory (evidence: `app/(app)/jobs/page.tsx`)
- Job Seeker → Job Review: opens role (evidence: `README.md`)
- Job Review → Resume APIs: requests tailoring
- Resume APIs → Authentication: checks session (evidence: `app/api/resume/tailor/route.ts`)
- Resume APIs → InsForge Data: reads profile and stores PDF (evidence: `app/api/resume/tailor/route.ts`)
- Resume APIs → Resume Generation: generates PDF (evidence: `app/api/resume/tailor/route.ts`)
- Job Seeker → Apply API: triggers apply (evidence: `README.md`)
- Apply API → Apply Orchestrator: starts orchestration (evidence: `app/api/agent/apply/route.ts`)
- Apply Orchestrator → Apply Worker: dispatches job (evidence: `agent/index.ts`)
- Apply Worker → Browser Automation: automates forms (evidence: `agent/apply.ts`)
- Browser Automation → Browserbase: runs browser session (evidence: `README.md`)
- Apply Worker → Session Recordings: saves recording (evidence: `agent/apply.ts`)
- Apply Orchestrator → AgentSpan: runs durable jobs (evidence: `agent/index.ts`)
