# adityasinghrajawat/autoreach-backend architecture

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

- Interactive diagram: https://gitdiagram.com/adityasinghrajawat/autoreach-backend
- Repository: https://github.com/adityasinghrajawat/autoreach-backend

## Overview

AutoReach is a Go backend for automating candidate job searches, exposed as an HTTP API and a background worker. Its main workflow ingests and polls job postings, embeds jobs and resumes, matches them, then supports contact enrichment, outreach, assisted applications, and dashboard reporting. The README documents these product stages; sampled code confirms job ingestion queues embedding work and the binary starts the worker. Several subsystem connections are documented but their implementation was not sampled, so those edges cite the README.

Main entry points: [`pkg/services/matchingManagement`](https://github.com/adityasinghrajawat/autoreach-backend/tree/main/pkg/services/matchingManagement) (Job matching), [`worker/server/start.go`](https://github.com/adityasinghrajawat/autoreach-backend/blob/main/worker/server/start.go) (Background worker), [`pkg/services/jobManagement/pollJobSource.go`](https://github.com/adityasinghrajawat/autoreach-backend/blob/main/pkg/services/jobManagement/pollJobSource.go) (Job polling), [`pkg/services/enrichmentManagement`](https://github.com/adityasinghrajawat/autoreach-backend/tree/main/pkg/services/enrichmentManagement) (Contact enrichment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and identity"]
  node_api["REST API<br/>[app.go]"]
  node_auth["Authentication"]
  node_handlers["Request handlers<br/>[handlers.go]"]
  node_services["Domain services<br/>[services.go]"]
end

subgraph group_jobs["Jobs and matching"]
  node_resume["Resume management"]
  node_job_ingestion["Job ingestion<br/>[ingestJobs.go]"]
  node_job_polling["Job polling<br/>[pollJobSource.go]"]
  node_embedding["Embeddings"]
  node_matching["Job matching"]
end

subgraph group_engagement["Candidate engagement"]
  node_enrichment["Contact enrichment"]
  node_outreach["Email and LinkedIn"]
  node_applications["Assisted applications"]
  node_dashboard["Dashboard reporting"]
end

subgraph group_runtime["Worker runtime"]
  node_worker["Background worker<br/>[start.go]"]
  node_task_queue["Task queue<br/>[server.go]"]
end

subgraph group_platform["Data and integrations"]
  node_repositories["Repositories"]
  node_application_repo["Application storage<br/>[application.go]"]
  node_postgres[("PostgreSQL<br/>[postgres.go]")]
end

node_candidate(("Candidate"))
node_job_sources(("Job sources"))
node_feed_clients(("Feed clients"))
node_external_providers["External providers"]

node_candidate -->|"uses"| node_api
node_job_sources -->|"provides postings"| node_job_polling
node_feed_clients -->|"ingests jobs"| node_api
node_api -->|"routes requests"| node_handlers
node_handlers -->|"calls"| node_services
node_services -->|"wires repositories"| node_repositories
node_candidate -->|"registers"| node_auth
node_candidate -->|"uploads resume"| node_resume
node_job_ingestion -->|"publishes embedding tasks"| node_task_queue
node_job_polling -->|"queues polling work"| node_task_queue
node_worker -->|"consumes tasks"| node_task_queue
node_worker -->|"polls sources"| node_job_polling
node_worker -->|"embeds postings and resumes"| node_embedding
node_embedding -->|"supports matching"| node_matching
node_resume -->|"provides candidate resumes"| node_matching
node_job_polling -->|"provides postings"| node_matching
node_matching -->|"feeds matched jobs"| node_enrichment
node_matching -->|"feeds assisted apply"| node_applications
node_matching -->|"reports matches"| node_dashboard
node_enrichment -->|"queries providers"| node_external_providers
node_enrichment -->|"supplies contacts"| node_outreach
node_outreach -->|"sends and checks mail"| node_external_providers
node_applications -->|"submits to ATS"| node_external_providers
node_repositories -->|"reads and writes"| node_postgres
node_application_repo -->|"persists applications"| node_postgres
node_worker -->|"prepares applications"| node_applications

click node_api "https://github.com/adityasinghrajawat/autoreach-backend/blob/main/cmd/autoreach/app.go"
click node_auth "https://github.com/adityasinghrajawat/autoreach-backend/tree/main/pkg/handlers/authManagement"
click node_resume "https://github.com/adityasinghrajawat/autoreach-backend/tree/main/pkg/services/candidateManagement"
click node_job_ingestion "https://github.com/adityasinghrajawat/autoreach-backend/blob/main/pkg/services/jobManagement/ingestJobs.go"
click node_job_polling "https://github.com/adityasinghrajawat/autoreach-backend/blob/main/pkg/services/jobManagement/pollJobSource.go"
click node_embedding "https://github.com/adityasinghrajawat/autoreach-backend/blob/main/pkg/integrations/ai/createEmbeddings.go"
click node_matching "https://github.com/adityasinghrajawat/autoreach-backend/tree/main/pkg/services/matchingManagement"
click node_enrichment "https://github.com/adityasinghrajawat/autoreach-backend/tree/main/pkg/services/enrichmentManagement"
click node_outreach "https://github.com/adityasinghrajawat/autoreach-backend/tree/main/pkg/services/outreachManagement"
click node_applications "https://github.com/adityasinghrajawat/autoreach-backend/tree/main/pkg/services/applicationManagement"
click node_dashboard "https://github.com/adityasinghrajawat/autoreach-backend/tree/main/pkg/services/dashboardManagement"
click node_handlers "https://github.com/adityasinghrajawat/autoreach-backend/blob/main/pkg/dependencies/handlers.go"
click node_services "https://github.com/adityasinghrajawat/autoreach-backend/blob/main/pkg/dependencies/services.go"
click node_worker "https://github.com/adityasinghrajawat/autoreach-backend/blob/main/worker/server/start.go"
click node_task_queue "https://github.com/adityasinghrajawat/autoreach-backend/blob/main/worker/providers/asynq/server.go"
click node_repositories "https://github.com/adityasinghrajawat/autoreach-backend/tree/main/pkg/repositories"
click node_application_repo "https://github.com/adityasinghrajawat/autoreach-backend/blob/main/pkg/repositories/applicationManagement/application.go"
click node_postgres "https://github.com/adityasinghrajawat/autoreach-backend/blob/main/pkg/db/postgres.go"

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_api,node_auth,node_handlers,node_services,node_feed_clients toneBlue
class node_resume,node_job_ingestion,node_job_polling,node_embedding,node_matching toneAmber
class node_enrichment,node_outreach,node_applications,node_dashboard toneMint
class node_worker,node_task_queue toneRose
class node_repositories,node_application_repo,node_postgres,node_candidate,node_job_sources,node_external_providers toneIndigo
```

## Components

### API and identity

- [REST API](https://github.com/adityasinghrajawat/autoreach-backend/blob/main/cmd/autoreach/app.go): `cmd/autoreach/app.go`
- [Authentication](https://github.com/adityasinghrajawat/autoreach-backend/tree/main/pkg/handlers/authManagement): `pkg/handlers/authManagement`
- [Request handlers](https://github.com/adityasinghrajawat/autoreach-backend/blob/main/pkg/dependencies/handlers.go): `pkg/dependencies/handlers.go`
- [Domain services](https://github.com/adityasinghrajawat/autoreach-backend/blob/main/pkg/dependencies/services.go): `pkg/dependencies/services.go`

### Jobs and matching

- [Resume management](https://github.com/adityasinghrajawat/autoreach-backend/tree/main/pkg/services/candidateManagement): `pkg/services/candidateManagement`
- [Job ingestion](https://github.com/adityasinghrajawat/autoreach-backend/blob/main/pkg/services/jobManagement/ingestJobs.go): `pkg/services/jobManagement/ingestJobs.go`
- [Job polling](https://github.com/adityasinghrajawat/autoreach-backend/blob/main/pkg/services/jobManagement/pollJobSource.go): `pkg/services/jobManagement/pollJobSource.go`
- [Embeddings](https://github.com/adityasinghrajawat/autoreach-backend/blob/main/pkg/integrations/ai/createEmbeddings.go): `pkg/integrations/ai/createEmbeddings.go`
- [Job matching](https://github.com/adityasinghrajawat/autoreach-backend/tree/main/pkg/services/matchingManagement): `pkg/services/matchingManagement`

### Candidate engagement

- [Contact enrichment](https://github.com/adityasinghrajawat/autoreach-backend/tree/main/pkg/services/enrichmentManagement): `pkg/services/enrichmentManagement`
- [Email and LinkedIn](https://github.com/adityasinghrajawat/autoreach-backend/tree/main/pkg/services/outreachManagement): `pkg/services/outreachManagement`
- [Assisted applications](https://github.com/adityasinghrajawat/autoreach-backend/tree/main/pkg/services/applicationManagement): `pkg/services/applicationManagement`
- [Dashboard reporting](https://github.com/adityasinghrajawat/autoreach-backend/tree/main/pkg/services/dashboardManagement): `pkg/services/dashboardManagement`

### Worker runtime

- [Background worker](https://github.com/adityasinghrajawat/autoreach-backend/blob/main/worker/server/start.go): `worker/server/start.go`
- [Task queue](https://github.com/adityasinghrajawat/autoreach-backend/blob/main/worker/providers/asynq/server.go): `worker/providers/asynq/server.go`

### Data and integrations

- [Repositories](https://github.com/adityasinghrajawat/autoreach-backend/tree/main/pkg/repositories): `pkg/repositories`
- [Application storage](https://github.com/adityasinghrajawat/autoreach-backend/blob/main/pkg/repositories/applicationManagement/application.go): `pkg/repositories/applicationManagement/application.go`
- [PostgreSQL](https://github.com/adityasinghrajawat/autoreach-backend/blob/main/pkg/db/postgres.go): `pkg/db/postgres.go`

### Other components

- **Candidate**
- **Job sources**
- **Feed clients**
- **External providers**

## Connections

- Candidate → REST API: uses
- Job sources → Job polling: provides postings
- Feed clients → REST API: ingests jobs
- REST API → Request handlers: routes requests (evidence: `cmd/autoreach/app.go`)
- Request handlers → Domain services: calls (evidence: `pkg/dependencies/handlers.go`)
- Domain services → Repositories: wires repositories (evidence: `pkg/dependencies/services.go`)
- Candidate → Authentication: registers
- Candidate → Resume management: uploads resume
- Job ingestion → Task queue: publishes embedding tasks (evidence: `pkg/services/jobManagement/ingestJobs.go`)
- Job polling → Task queue: queues polling work
- Background worker → Task queue: consumes tasks
- Background worker → Job polling: polls sources
- Background worker → Embeddings: embeds postings and resumes
- Embeddings → Job matching: supports matching
- Resume management → Job matching: provides candidate resumes
- Job polling → Job matching: provides postings
- Job matching → Contact enrichment: feeds matched jobs
- Job matching → Assisted applications: feeds assisted apply
- Job matching → Dashboard reporting: reports matches
- Contact enrichment → External providers: queries providers
- Contact enrichment → Email and LinkedIn: supplies contacts
- Email and LinkedIn → External providers: sends and checks mail
- Assisted applications → External providers: submits to ATS
- Repositories → PostgreSQL: reads and writes (evidence: `pkg/repositories/applicationManagement/application.go`)
- Application storage → PostgreSQL: persists applications (evidence: `pkg/repositories/applicationManagement/application.go`)
- Background worker → Assisted applications: prepares applications
