# gildaciolopes/autoapply architecture

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

- Interactive diagram: https://gitdiagram.com/gildaciolopes/autoapply
- Repository: https://github.com/gildaciolopes/autoapply

## Overview

AutoApply is a job-search and application-assistance product: it discovers and scores jobs, prepares tailored application materials and answers, then supports human review and submission. The API serves the web interface and a local MCP endpoint; background workers perform queued discovery, tailoring, application, profile-sync, mail, and overnight-run tasks. The tree and source index support these domain stages, but README content is absent and many worker and feature implementations were not excerpted. Edges are limited to relationships visible in excerpts or the source index.

Main entry points: [`apps/api/src/mcp/mcp.controller.ts`](https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/mcp/mcp.controller.ts) (MCP Endpoint), [`apps/api/src/apply/apply.service.ts`](https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/apply/apply.service.ts) (Application Service), [`apps/api/src/main.ts`](https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/main.ts) (HTTP API), [`apps/api/src/night/night.service.ts`](https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/night/night.service.ts) (Night Runs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User Interfaces"]
  node_web["Web Console"]
  node_webviews["Feature Views"]
end

subgraph group_api["API and Coordination"]
  node_api_entry["HTTP API<br/>[main.ts]"]
  node_jobs_api["Job API"]
  node_apply_api["Application API"]
  node_review_api["Review API"]
  node_night_api["Night API"]
  node_mcp_api["MCP Endpoint<br/>[mcp.controller.ts]"]
  node_mcp_tools["MCP Tools<br/>[server.ts]"]
  node_database[("Application Database<br/>[prisma.service.ts]")]
end

subgraph group_jobs["Job Discovery"]
  node_job_services["Job Services"]
  node_job_worker["Discovery and Scoring"]
  node_job_sources["Job Sources"]
end

subgraph group_application["Application Workflow"]
  node_apply_service["Application Service<br/>[apply.service.ts]"]
  node_review_service["Review Queue<br/>[review.service.ts]"]
  node_apply_worker["Application Execution<br/>[run.ts]"]
  node_apply_logic["Answer Logic<br/>[llm.ts]"]
  node_tailor["Resume Tailoring"]
  node_knowledge["Knowledge Base"]
  node_storage[("Resume Object Store<br/>[storage.service.ts]")]
end

subgraph group_automation["Background Automation"]
  node_night_service["Night Runs<br/>[night.service.ts]"]
  node_worker["Queue Workers<br/>[worker.module.ts]"]
  node_queues["Task Queues<br/>[queues.module.ts]"]
end

node_candidate(("Candidate"))
node_ats["Applicant Systems"]
node_telegram["Telegram"]

node_candidate -->|"uses"| node_web
node_web -->|"renders"| node_webviews
node_webviews -.->|"requests"| node_api_entry
node_api_entry -.->|"routes"| node_jobs_api
node_api_entry -.->|"routes"| node_apply_api
node_api_entry -.->|"routes"| node_review_api
node_api_entry -.->|"routes"| node_night_api
node_jobs_api -->|"dispatches"| node_job_services
node_job_services -->|"reads and writes"| node_database
node_job_services -.->|"enqueues work"| node_queues
node_job_worker -.->|"collects jobs"| node_job_sources
node_worker -->|"registers"| node_job_worker
node_worker -->|"registers"| node_apply_worker
node_apply_api -->|"dispatches"| node_apply_service
node_review_api -->|"dispatches"| node_review_service
node_review_service -->|"reapplies"| node_apply_service
node_review_service -->|"reads and writes"| node_database
node_apply_service -->|"prepares records"| node_database
node_apply_service -.->|"enqueues application"| node_queues
node_apply_worker -.->|"submits application"| node_ats
node_apply_worker -.->|"uses answers"| node_apply_logic
node_apply_service -.->|"uses artifacts"| node_storage
node_night_api -->|"dispatches"| node_night_service
node_night_service -->|"enqueues run"| node_queues
node_worker -->|"registers processor"| node_night_service
node_night_service -->|"sends report"| node_telegram
node_mcp_api -->|"builds server"| node_mcp_tools
node_mcp_api -->|"provides feed"| node_job_services
node_mcp_api -->|"provides apply"| node_apply_service
node_mcp_api -->|"provides review"| node_review_service
node_mcp_api -->|"provides runs"| node_night_service
node_candidate -.->|"connects locally"| node_mcp_api
node_tailor -.->|"uses profile data"| node_knowledge

click node_web "https://github.com/gildaciolopes/autoapply/tree/main/apps/web/src/app"
click node_webviews "https://github.com/gildaciolopes/autoapply/tree/main/apps/web/src/components"
click node_api_entry "https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/main.ts"
click node_jobs_api "https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/jobs/jobs.controllers.ts"
click node_apply_api "https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/apply/apply.controller.ts"
click node_review_api "https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/review/review.controller.ts"
click node_night_api "https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/night/night.controller.ts"
click node_mcp_api "https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/mcp/mcp.controller.ts"
click node_mcp_tools "https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/mcp/server.ts"
click node_job_services "https://github.com/gildaciolopes/autoapply/tree/main/apps/api/src/jobs"
click node_job_worker "https://github.com/gildaciolopes/autoapply/tree/main/apps/worker/src/jobs"
click node_job_sources "https://github.com/gildaciolopes/autoapply/tree/main/apps/worker/src/sources"
click node_apply_service "https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/apply/apply.service.ts"
click node_review_service "https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/review/review.service.ts"
click node_apply_worker "https://github.com/gildaciolopes/autoapply/blob/main/apps/worker/src/apply/run.ts"
click node_apply_logic "https://github.com/gildaciolopes/autoapply/blob/main/packages/apply/src/llm.ts"
click node_tailor "https://github.com/gildaciolopes/autoapply/tree/main/apps/worker/src/tailor"
click node_knowledge "https://github.com/gildaciolopes/autoapply/tree/main/apps/api/src/kb"
click node_storage "https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/kb/storage.service.ts"
click node_night_service "https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/night/night.service.ts"
click node_worker "https://github.com/gildaciolopes/autoapply/blob/main/apps/worker/src/worker.module.ts"
click node_queues "https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/queues/queues.module.ts"
click node_database "https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/prisma/prisma.service.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_web,node_webviews toneBlue
class node_api_entry,node_jobs_api,node_apply_api,node_review_api,node_night_api,node_mcp_api,node_mcp_tools,node_database toneAmber
class node_job_services,node_job_worker,node_job_sources toneMint
class node_apply_service,node_review_service,node_apply_worker,node_apply_logic,node_tailor,node_knowledge,node_storage toneRose
class node_night_service,node_worker,node_queues,node_candidate,node_ats,node_telegram toneIndigo
```

## Components

### User Interfaces

- [Web Console](https://github.com/gildaciolopes/autoapply/tree/main/apps/web/src/app): `apps/web/src/app`
- [Feature Views](https://github.com/gildaciolopes/autoapply/tree/main/apps/web/src/components): `apps/web/src/components`

### API and Coordination

- [HTTP API](https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/main.ts): `apps/api/src/main.ts`
- [Job API](https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/jobs/jobs.controllers.ts): `apps/api/src/jobs/jobs.controllers.ts`
- [Application API](https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/apply/apply.controller.ts): `apps/api/src/apply/apply.controller.ts`
- [Review API](https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/review/review.controller.ts): `apps/api/src/review/review.controller.ts`
- [Night API](https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/night/night.controller.ts): `apps/api/src/night/night.controller.ts`
- [MCP Endpoint](https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/mcp/mcp.controller.ts): `apps/api/src/mcp/mcp.controller.ts`
- [MCP Tools](https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/mcp/server.ts): `apps/api/src/mcp/server.ts`
- [Application Database](https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/prisma/prisma.service.ts): `apps/api/src/prisma/prisma.service.ts`

### Job Discovery

- [Job Services](https://github.com/gildaciolopes/autoapply/tree/main/apps/api/src/jobs): `apps/api/src/jobs`
- [Discovery and Scoring](https://github.com/gildaciolopes/autoapply/tree/main/apps/worker/src/jobs): `apps/worker/src/jobs`
- [Job Sources](https://github.com/gildaciolopes/autoapply/tree/main/apps/worker/src/sources): `apps/worker/src/sources`

### Application Workflow

- [Application Service](https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/apply/apply.service.ts): `apps/api/src/apply/apply.service.ts`
- [Review Queue](https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/review/review.service.ts): `apps/api/src/review/review.service.ts`
- [Application Execution](https://github.com/gildaciolopes/autoapply/blob/main/apps/worker/src/apply/run.ts): `apps/worker/src/apply/run.ts`
- [Answer Logic](https://github.com/gildaciolopes/autoapply/blob/main/packages/apply/src/llm.ts): `packages/apply/src/llm.ts`
- [Resume Tailoring](https://github.com/gildaciolopes/autoapply/tree/main/apps/worker/src/tailor): `apps/worker/src/tailor`
- [Knowledge Base](https://github.com/gildaciolopes/autoapply/tree/main/apps/api/src/kb): `apps/api/src/kb`
- [Resume Object Store](https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/kb/storage.service.ts): `apps/api/src/kb/storage.service.ts`

### Background Automation

- [Night Runs](https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/night/night.service.ts): `apps/api/src/night/night.service.ts`
- [Queue Workers](https://github.com/gildaciolopes/autoapply/blob/main/apps/worker/src/worker.module.ts): `apps/worker/src/worker.module.ts`
- [Task Queues](https://github.com/gildaciolopes/autoapply/blob/main/apps/api/src/queues/queues.module.ts): `apps/api/src/queues/queues.module.ts`

### Other components

- **Candidate**
- **Applicant Systems**
- **Telegram**

## Connections

- Candidate → Web Console: uses (evidence: `apps/web/src/app/page.tsx`)
- Web Console → Feature Views: renders (evidence: `apps/web/src/app/integracoes/page.tsx`)
- Feature Views → HTTP API: requests
- HTTP API → Job API: routes
- HTTP API → Application API: routes
- HTTP API → Review API: routes
- HTTP API → Night API: routes
- Job API → Job Services: dispatches (evidence: `apps/api/src/jobs/jobs.controllers.ts`)
- Job Services → Application Database: reads and writes (evidence: `apps/api/src/jobs/feed.service.ts`)
- Job Services → Task Queues: enqueues work
- Discovery and Scoring → Job Sources: collects jobs
- Queue Workers → Discovery and Scoring: registers (evidence: `apps/worker/src/worker.module.ts`)
- Queue Workers → Application Execution: registers (evidence: `apps/worker/src/worker.module.ts`)
- Application API → Application Service: dispatches (evidence: `apps/api/src/apply/apply.controller.ts`)
- Review API → Review Queue: dispatches (evidence: `apps/api/src/review/review.controller.ts`)
- Review Queue → Application Service: reapplies (evidence: `apps/api/src/review/review.service.ts`)
- Review Queue → Application Database: reads and writes (evidence: `apps/api/src/review/review.service.ts`)
- Application Service → Application Database: prepares records (evidence: `apps/api/src/apply/apply.service.ts`)
- Application Service → Task Queues: enqueues application
- Application Execution → Applicant Systems: submits application
- Application Execution → Answer Logic: uses answers
- Application Service → Resume Object Store: uses artifacts (evidence: `apps/api/src/apply/apply.service.ts`)
- Night API → Night Runs: dispatches (evidence: `apps/api/src/night/night.controller.ts`)
- Night Runs → Task Queues: enqueues run (evidence: `apps/api/src/night/night.service.ts`)
- Queue Workers → Night Runs: registers processor (evidence: `apps/worker/src/worker.module.ts`)
- Night Runs → Telegram: sends report (evidence: `apps/api/src/night/night.service.ts`)
- MCP Endpoint → MCP Tools: builds server (evidence: `apps/api/src/mcp/mcp.controller.ts`)
- MCP Endpoint → Job Services: provides feed (evidence: `apps/api/src/mcp/mcp.controller.ts`)
- MCP Endpoint → Application Service: provides apply (evidence: `apps/api/src/mcp/mcp.controller.ts`)
- MCP Endpoint → Review Queue: provides review (evidence: `apps/api/src/mcp/mcp.controller.ts`)
- MCP Endpoint → Night Runs: provides runs (evidence: `apps/api/src/mcp/mcp.controller.ts`)
- Candidate → MCP Endpoint: connects locally
- Resume Tailoring → Knowledge Base: uses profile data
