# sp201004/applyonce architecture

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

- Interactive diagram: https://gitdiagram.com/sp201004/applyonce
- Repository: https://github.com/sp201004/applyonce

## Overview

ApplyOnce is a Chrome extension and web dashboard for building a reusable application profile, syncing it to the extension, and autofilling job forms for user review. The extension’s content script handles form interaction; the README also documents profile matching, local AI assistance, and resume parsing. The dashboard manages profile and resume data, while Supabase supplies authentication and storage. The extension’s internal dispatch and storage wiring is not established by the shown excerpts, so those connections are omitted; documented but unsampled capabilities are retained.

Main entry points: [`content/content.js`](https://github.com/sp201004/applyonce/blob/main/content/content.js) (Form autofill), [`web/app/dashboard/DashboardClient.tsx`](https://github.com/sp201004/applyonce/blob/main/web/app/dashboard/DashboardClient.tsx) (Profile and resume editor), [`web/app/connect/ConnectClient.tsx`](https://github.com/sp201004/applyonce/blob/main/web/app/connect/ConnectClient.tsx) (Extension session handoff), [`web/app/dashboard/page.tsx`](https://github.com/sp201004/applyonce/blob/main/web/app/dashboard/page.tsx) (Dashboard page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_extension["Browser extension"]
  node_content["Form autofill<br/>[content.js]"]
  node_repeat["Repeated fields<br/>[repeat-groups.js]"]
  node_background["Extension service worker<br/>[background.js]"]
  node_sidepanel["Extension side panel<br/>[sidepanel.js]"]
  node_settings["Provider settings<br/>[options.js]"]
  node_provider_config["Provider configuration"]
end

subgraph group_web["Web dashboard"]
  node_dashboard_page["Dashboard page<br/>[page.tsx]"]
  node_dashboard["Profile and resume editor"]
  node_resume_parser["Resume parsing<br/>[gemini-web.ts]"]
  node_connect_page["Extension connect page<br/>[page.tsx]"]
  node_connect["Extension session handoff<br/>[ConnectClient.tsx]"]
end

subgraph group_backend["Auth and profile data"]
  node_profile_api["Extension profile endpoint<br/>[route.ts]"]
  node_refresh_api["Session refresh endpoint<br/>[route.ts]"]
  node_auth_callback["Sign-in callback<br/>[route.ts]"]
  node_supabase_adapter["Server auth client<br/>[server.ts]"]
end

subgraph group_ai["AI assistance"]
  node_extension_gemini["Extension Gemini client<br/>[gemini-model.js]"]
  node_gemini["Gemini service"]
  node_groq["Groq service"]
end

node_applicant(("Job applicant"))
node_job_site["Job application page"]
node_supabase[("Supabase auth and database")]

node_applicant -->|"edits profile"| node_dashboard
node_dashboard_page -->|"renders"| node_dashboard
node_dashboard -->|"parses resume"| node_resume_parser
node_dashboard_page -->|"loads profile"| node_supabase
node_dashboard -->|"stores profile and resume"| node_supabase
node_applicant -->|"connects extension"| node_connect_page
node_connect_page -->|"renders"| node_connect
node_connect -->|"sends session"| node_background
node_connect -->|"gets session"| node_supabase
node_profile_api -->|"reads profile"| node_supabase
node_refresh_api -->|"refreshes session"| node_supabase
node_auth_callback -->|"exchanges code"| node_supabase_adapter
node_supabase_adapter -->|"creates auth client"| node_supabase
node_applicant -->|"opens application"| node_job_site
node_content -->|"fills fields"| node_job_site
node_applicant -->|"reviews answers"| node_content
node_content -->|"syncs profile"| node_supabase
node_content -.->|"requests AI answers"| node_gemini
node_content -.->|"fallback answers"| node_groq

click node_content "https://github.com/sp201004/applyonce/blob/main/content/content.js"
click node_repeat "https://github.com/sp201004/applyonce/blob/main/content/repeat-groups.js"
click node_background "https://github.com/sp201004/applyonce/blob/main/background/background.js"
click node_sidepanel "https://github.com/sp201004/applyonce/blob/main/sidepanel/sidepanel.js"
click node_settings "https://github.com/sp201004/applyonce/blob/main/options/options.js"
click node_provider_config "https://github.com/sp201004/applyonce/blob/main/provider-settings.js"
click node_extension_gemini "https://github.com/sp201004/applyonce/blob/main/background/gemini-model.js"
click node_dashboard_page "https://github.com/sp201004/applyonce/blob/main/web/app/dashboard/page.tsx"
click node_dashboard "https://github.com/sp201004/applyonce/blob/main/web/app/dashboard/DashboardClient.tsx"
click node_resume_parser "https://github.com/sp201004/applyonce/blob/main/web/lib/gemini-web.ts"
click node_connect_page "https://github.com/sp201004/applyonce/blob/main/web/app/connect/page.tsx"
click node_connect "https://github.com/sp201004/applyonce/blob/main/web/app/connect/ConnectClient.tsx"
click node_profile_api "https://github.com/sp201004/applyonce/blob/main/web/app/api/profile/route.ts"
click node_refresh_api "https://github.com/sp201004/applyonce/blob/main/web/app/api/auth/refresh/route.ts"
click node_auth_callback "https://github.com/sp201004/applyonce/blob/main/web/app/auth/callback/route.ts"
click node_supabase_adapter "https://github.com/sp201004/applyonce/blob/main/web/lib/supabase/server.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_content,node_repeat,node_background,node_sidepanel,node_settings,node_provider_config toneBlue
class node_dashboard_page,node_dashboard,node_resume_parser,node_connect_page,node_connect,node_supabase toneAmber
class node_profile_api,node_refresh_api,node_auth_callback,node_supabase_adapter toneMint
class node_extension_gemini,node_gemini,node_groq toneRose
class node_applicant,node_job_site toneIndigo
```

## Components

### Browser extension

- [Form autofill](https://github.com/sp201004/applyonce/blob/main/content/content.js): `content/content.js`
- [Repeated fields](https://github.com/sp201004/applyonce/blob/main/content/repeat-groups.js): `content/repeat-groups.js`
- [Extension service worker](https://github.com/sp201004/applyonce/blob/main/background/background.js): `background/background.js`
- [Extension side panel](https://github.com/sp201004/applyonce/blob/main/sidepanel/sidepanel.js): `sidepanel/sidepanel.js`
- [Provider settings](https://github.com/sp201004/applyonce/blob/main/options/options.js): `options/options.js`
- [Provider configuration](https://github.com/sp201004/applyonce/blob/main/provider-settings.js): `provider-settings.js`

### Web dashboard

- [Dashboard page](https://github.com/sp201004/applyonce/blob/main/web/app/dashboard/page.tsx): `web/app/dashboard/page.tsx`
- [Profile and resume editor](https://github.com/sp201004/applyonce/blob/main/web/app/dashboard/DashboardClient.tsx): `web/app/dashboard/DashboardClient.tsx`
- [Resume parsing](https://github.com/sp201004/applyonce/blob/main/web/lib/gemini-web.ts): `web/lib/gemini-web.ts`
- [Extension connect page](https://github.com/sp201004/applyonce/blob/main/web/app/connect/page.tsx): `web/app/connect/page.tsx`
- [Extension session handoff](https://github.com/sp201004/applyonce/blob/main/web/app/connect/ConnectClient.tsx): `web/app/connect/ConnectClient.tsx`

### Auth and profile data

- [Extension profile endpoint](https://github.com/sp201004/applyonce/blob/main/web/app/api/profile/route.ts): `web/app/api/profile/route.ts`
- [Session refresh endpoint](https://github.com/sp201004/applyonce/blob/main/web/app/api/auth/refresh/route.ts): `web/app/api/auth/refresh/route.ts`
- [Sign-in callback](https://github.com/sp201004/applyonce/blob/main/web/app/auth/callback/route.ts): `web/app/auth/callback/route.ts`
- [Server auth client](https://github.com/sp201004/applyonce/blob/main/web/lib/supabase/server.ts): `web/lib/supabase/server.ts`

### AI assistance

- [Extension Gemini client](https://github.com/sp201004/applyonce/blob/main/background/gemini-model.js): `background/gemini-model.js`
- **Gemini service**
- **Groq service**

### Other components

- **Job applicant**
- **Job application page**
- **Supabase auth and database**

## Connections

- Job applicant → Profile and resume editor: edits profile (evidence: `README.md`)
- Dashboard page → Profile and resume editor: renders (evidence: `web/app/dashboard/page.tsx`)
- Profile and resume editor → Resume parsing: parses resume (evidence: `web/app/dashboard/DashboardClient.tsx`)
- Dashboard page → Supabase auth and database: loads profile (evidence: `web/app/dashboard/page.tsx`)
- Profile and resume editor → Supabase auth and database: stores profile and resume (evidence: `README.md`)
- Job applicant → Extension connect page: connects extension (evidence: `README.md`)
- Extension connect page → Extension session handoff: renders (evidence: `web/app/connect/page.tsx`)
- Extension session handoff → Extension service worker: sends session (evidence: `web/app/connect/ConnectClient.tsx`)
- Extension session handoff → Supabase auth and database: gets session (evidence: `web/app/connect/ConnectClient.tsx`)
- Extension profile endpoint → Supabase auth and database: reads profile (evidence: `web/app/api/profile/route.ts`)
- Session refresh endpoint → Supabase auth and database: refreshes session (evidence: `web/app/api/auth/refresh/route.ts`)
- Sign-in callback → Server auth client: exchanges code (evidence: `web/app/auth/callback/route.ts`)
- Server auth client → Supabase auth and database: creates auth client (evidence: `web/lib/supabase/server.ts`)
- Job applicant → Job application page: opens application (evidence: `README.md`)
- Form autofill → Job application page: fills fields (evidence: `README.md`)
- Job applicant → Form autofill: reviews answers (evidence: `README.md`)
- Form autofill → Supabase auth and database: syncs profile (evidence: `README.md`)
- Form autofill → Gemini service: requests AI answers (evidence: `README.md`)
- Form autofill → Groq service: fallback answers (evidence: `README.md`)
