# rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search architecture

> Architecture diagram of the GitHub repository rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search
- Repository: https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search

## Overview

#### Purpose and Entry Points
AutoApply AI is a full-stack job-application workspace: discover jobs, analyze/tailor resumes, manage approval-driven applications, and execute browser automation. The FastAPI app starts at `backend/app/main.py`; versioned REST routes aggregate in `backend/app/api/v1/router.py`, with real-time updates exposed by `backend/app/api/websocket/endpoint.py`. The React/Vite client starts at `frontend/src/main.tsx` and composes routing/UI in `frontend/src/App.tsx`.

#### Client, API, and Tenant Boundary
The frontend has route-level job, application, resume, analytics, and settings views, backed by typed API service modules and client state. It communicates with the backend over REST and WebSocket, rather than directly accessing persistence or automation systems. Authentication/authorization and request dependencies are centralized at `backend/app/api/v1/auth.py` and `backend/app/api/deps.py`; tenant-aware database access is represented by `backend/app/db/tenant.py`.

#### API and Service Orchestration
Route handlers are thin API boundaries for core workflows: jobs, resumes, applications, settings, analytics, and administration. Business orchestration belongs in services, which coordinate models, scoring, storage, queues, and external providers. Key paths: `backend/app/api/v1/jobs.py`, `backend/app/api/v1/applications.py`, `backend/app/services/application.py`, `backend/app/services/resume.py`, and `backend/app/services/job_search.py`.

#### Persistence, State, and Async Execution
SQLAlchemy models capture users, resumes, jobs, applications, platform sessions, credentials, settings, and LLM usage. Database access is asynchronous and migrations are Alembic-managed. Redis supplies queue/cache infrastructure; application submission is dispatched to workers, separating durable application state and approval decisions from long-running browser runs. Key paths: `backend/app/db/session.py`, `backend/app/models/application.py`, `backend/app/services/dispatch.py`, `backend/app/workers/tasks.py`, and `backend/app/db/arq.py`. SQLite is the default runtime database; PostgreSQL is supported.

#### Resume and ATS Pipeline
Resume upload/generation flows parse PDF/DOCX input, persist documents via a pluggable storage abstraction, render output documents, and evaluate candidate-job fit. The ATS subsystem separates keyword, skills, experience, and scoring/optimization concerns; LLM prompting supports tailoring and cover-letter generation. Key paths: `backend/app/core/documents/parser.py`, `backend/app/core/documents/generator.py`, `backend/app/core/ats/scorer.py`, `backend/app/core/ats/optimizer.py`, and `backend/app/core/llm/client.py`. Storage can be local or S3 via `backend/app/core/storage/factory.py`.

#### Discovery and Application Automation
Job search is orchestrated through service/API layers and includes Exa semantic search. Automated application execution is platform-adapter based: a registry selects LinkedIn, Indeed, or Glassdoor implementations; runtime stages observe pages and apply through managed browser sessions. Human intervention and configured apply mode are important control boundaries before submission. Key paths: `backend/app/core/job_discovery/exa_search.py`, `backend/app/core/automation/platforms/registry.py`, `backend/app/core/automation/runtime/apply.py`, `backend/app/core/automation/session_manager.py`, and `backend/app/core/automation/intervention.py`. Browser-use/Playwright are the material automation runtime dependencies.

#### External Services, Events, and Operations
LLM access uses a provider factory/client with usage tracking and fallback-capable provider configuration; supported gateways/providers include LiteLLM/Portkey and OpenAI-family integrations. Credentials are isolated behind secret-store abstractions. WebSocket bus/events propagate worker progress to the UI. Logging, tracing, and Prometheus metrics form the observability boundary. Deployment uses Docker Compose with API, frontend, worker, Redis, and reverse-proxy definitions in `docker-compose.yml`, `docker/Dockerfile.worker`, and `Caddyfile`.

Main entry points: [`backend/app/services/application.py`](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/services/application.py) (Workflow services), [`backend/app/workers/tasks.py`](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/workers/tasks.py) (Application worker), [`backend/app/api/v1/router.py`](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/api/v1/router.py) (v1 routes), [`backend/app/core/documents/parser.py`](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/core/documents/parser.py) (Resume pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client"]
  node_web_client["React workspace<br/>Vite client<br/>[App.tsx]"]
  node_client_entry["Client entry<br/>React bootstrap<br/>[main.tsx]"]
end

subgraph group_api["API & orchestration"]
  node_api_app["FastAPI app<br/>API server<br/>[main.py]"]
  node_api_router["v1 routes<br/>REST router<br/>[router.py]"]
  node_auth_tenant["Auth & tenant scope<br/>request dependencies<br/>[auth.py]"]
  node_jobs_api["Jobs API<br/>route handlers<br/>[jobs.py]"]
  node_applications_api["Applications API<br/>route handlers<br/>[applications.py]"]
  node_workflow_services["Workflow services<br/>business orchestration<br/>[application.py]"]
  node_tenant_db[("Tenant database<br/>async SQLAlchemy<br/>[session.py]")]
  node_resume_pipeline["Resume pipeline<br/>document and ATS processing<br/>[parser.py]"]
  node_llm_client["LLM providers<br/>provider client<br/>[client.py]"]
  node_document_storage["Document storage<br/>local or S3 storage<br/>[factory.py]"]
  node_job_discovery["Job discovery<br/>semantic search<br/>[exa_search.py]"]
end

subgraph group_processing["Async processing"]
  node_dispatch["Submission dispatch<br/>queue producer<br/>[dispatch.py]"]
  node_redis[("Redis<br/>queue and cache<br/>[arq.py]")]
  node_worker["Application worker<br/>async task runner<br/>[tasks.py]"]
  node_websocket["Realtime updates<br/>WebSocket endpoint<br/>[endpoint.py]"]
end

subgraph group_automation["Automation"]
  node_automation_runtime["Browser application runtime<br/>Playwright automation<br/>[apply.py]"]
  node_platform_registry["Platform adapters<br/>automation registry<br/>[registry.py]"]
  node_browser_session["Browser sessions<br/>session manager<br/>[session_manager.py]"]
end

node_operations["Deployment & observability<br/>Docker and telemetry<br/>[docker-compose.yml]"]

node_client_entry -->|"boots"| node_web_client
node_web_client -->|"REST and WebSocket"| node_api_app
node_api_app -->|"mounts"| node_api_router
node_api_router -->|"applies"| node_auth_tenant
node_auth_tenant -->|"scopes access"| node_tenant_db
node_api_router -->|"routes"| node_jobs_api
node_api_router -->|"routes"| node_applications_api
node_jobs_api -->|"delegates"| node_workflow_services
node_applications_api -->|"delegates"| node_workflow_services
node_workflow_services -->|"persists state"| node_tenant_db
node_workflow_services -->|"tailors resumes"| node_resume_pipeline
node_resume_pipeline -->|"stores documents"| node_document_storage
node_resume_pipeline -->|"generates content"| node_llm_client
node_workflow_services -->|"searches jobs"| node_job_discovery
node_workflow_services -->|"queues approved apply"| node_dispatch
node_dispatch -->|"enqueues"| node_redis
node_worker -->|"consumes"| node_redis
node_worker -->|"updates application state"| node_tenant_db
node_worker -->|"runs submission"| node_automation_runtime
node_automation_runtime -->|"selects adapter"| node_platform_registry
node_automation_runtime -->|"uses"| node_browser_session
node_worker -->|"publishes progress"| node_websocket
node_websocket -->|"pushes updates"| node_web_client
node_operations -.->|"deploys"| node_api_app
node_operations -.->|"deploys"| node_worker

click node_web_client "https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/frontend/src/App.tsx"
click node_client_entry "https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/frontend/src/main.tsx"
click node_api_app "https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/main.py"
click node_api_router "https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/api/v1/router.py"
click node_auth_tenant "https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/api/v1/auth.py"
click node_jobs_api "https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/api/v1/jobs.py"
click node_applications_api "https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/api/v1/applications.py"
click node_workflow_services "https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/services/application.py"
click node_tenant_db "https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/db/session.py"
click node_resume_pipeline "https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/core/documents/parser.py"
click node_llm_client "https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/core/llm/client.py"
click node_document_storage "https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/core/storage/factory.py"
click node_job_discovery "https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/core/job_discovery/exa_search.py"
click node_dispatch "https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/services/dispatch.py"
click node_redis "https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/db/arq.py"
click node_worker "https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/workers/tasks.py"
click node_websocket "https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/api/websocket/endpoint.py"
click node_automation_runtime "https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/core/automation/runtime/apply.py"
click node_platform_registry "https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/core/automation/platforms/registry.py"
click node_browser_session "https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/core/automation/session_manager.py"
click node_operations "https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/docker-compose.yml"

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_web_client,node_client_entry toneBlue
class node_api_app,node_api_router,node_auth_tenant,node_jobs_api,node_applications_api,node_workflow_services,node_tenant_db,node_resume_pipeline,node_llm_client,node_document_storage,node_job_discovery toneAmber
class node_dispatch,node_redis,node_worker,node_websocket toneMint
class node_automation_runtime,node_platform_registry,node_browser_session toneRose
class node_operations toneNeutral
```

## Components

### Client

- [React workspace](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/frontend/src/App.tsx): Vite client · Job, resume, application, analytics, and settings views. · `frontend/src/App.tsx`
- [Client entry](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/frontend/src/main.tsx): React bootstrap · `frontend/src/main.tsx`

### API & orchestration

- [FastAPI app](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/main.py): API server · `backend/app/main.py`
- [v1 routes](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/api/v1/router.py): REST router · Jobs, resumes, applications, settings, analytics, and admin boundaries. · `backend/app/api/v1/router.py`
- [Auth & tenant scope](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/api/v1/auth.py): request dependencies · Enforces authorization and tenant-aware access. · `backend/app/api/v1/auth.py`
- [Jobs API](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/api/v1/jobs.py): route handlers · `backend/app/api/v1/jobs.py`
- [Applications API](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/api/v1/applications.py): route handlers · `backend/app/api/v1/applications.py`
- [Workflow services](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/services/application.py): business orchestration · Coordinates application, resume, and job-search workflows. · `backend/app/services/application.py`
- [Tenant database](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/db/session.py): async SQLAlchemy · Durable users, resumes, jobs, applications, sessions, and settings. · `backend/app/db/session.py`
- [Resume pipeline](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/core/documents/parser.py): document and ATS processing · Parses, renders, scores, optimizes, and tailors resumes. · `backend/app/core/documents/parser.py`
- [LLM providers](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/core/llm/client.py): provider client · Tailoring and cover-letter generation with usage tracking. · `backend/app/core/llm/client.py`
- [Document storage](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/core/storage/factory.py): local or S3 storage · `backend/app/core/storage/factory.py`
- [Job discovery](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/core/job_discovery/exa_search.py): semantic search · Uses Exa-backed job search. · `backend/app/core/job_discovery/exa_search.py`

### Async processing

- [Submission dispatch](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/services/dispatch.py): queue producer · Queues approved application runs. · `backend/app/services/dispatch.py`
- [Redis](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/db/arq.py): queue and cache · `backend/app/db/arq.py`
- [Application worker](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/workers/tasks.py): async task runner · Executes long-running submission tasks and emits progress. · `backend/app/workers/tasks.py`
- [Realtime updates](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/api/websocket/endpoint.py): WebSocket endpoint · Relays worker progress to the client. · `backend/app/api/websocket/endpoint.py`

### Automation

- [Browser application runtime](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/core/automation/runtime/apply.py): Playwright automation · Applies through managed browser sessions after intervention checks. · `backend/app/core/automation/runtime/apply.py`
- [Platform adapters](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/core/automation/platforms/registry.py): automation registry · Selects LinkedIn, Indeed, or Glassdoor implementations. · `backend/app/core/automation/platforms/registry.py`
- [Browser sessions](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/backend/app/core/automation/session_manager.py): session manager · `backend/app/core/automation/session_manager.py`

### Other components

- [Deployment & observability](https://github.com/rayyan9477/autoapply-ai-agentic-browser-automation-for-job-search/blob/main/docker-compose.yml): Docker and telemetry · Compose deploys API, client, worker, Redis, and proxy with logging, tracing, and metrics. · `docker-compose.yml`

## Connections

- Client entry → React workspace: boots
- React workspace → FastAPI app: REST and WebSocket
- FastAPI app → v1 routes: mounts
- v1 routes → Auth & tenant scope: applies
- Auth & tenant scope → Tenant database: scopes access
- v1 routes → Jobs API: routes
- v1 routes → Applications API: routes
- Jobs API → Workflow services: delegates
- Applications API → Workflow services: delegates
- Workflow services → Tenant database: persists state
- Workflow services → Resume pipeline: tailors resumes
- Resume pipeline → Document storage: stores documents
- Resume pipeline → LLM providers: generates content
- Workflow services → Job discovery: searches jobs
- Workflow services → Submission dispatch: queues approved apply
- Submission dispatch → Redis: enqueues
- Application worker → Redis: consumes
- Application worker → Tenant database: updates application state
- Application worker → Browser application runtime: runs submission
- Browser application runtime → Platform adapters: selects adapter
- Browser application runtime → Browser sessions: uses
- Application worker → Realtime updates: publishes progress
- Realtime updates → React workspace: pushes updates
- Deployment & observability → FastAPI app: deploys
- Deployment & observability → Application worker: deploys
