# nakulbhandare/onerole architecture

> Architecture diagram of the GitHub repository nakulbhandare/onerole, 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/nakulbhandare/onerole
- Repository: https://github.com/nakulbhandare/onerole
- Video tour (about a minute): https://gitdiagram.com/nakulbhandare/onerole/video

## Overview

OneRole is a job-discovery and application-workflow platform with a browser UI, Go API, MongoDB persistence, and durable workers. The user-facing path runs from browsing discovered jobs and managing a profile to queuing an application and tracking its status; the README distinguishes queued intent from verified employer receipt. The graph also preserves authentication, source synchronization, and submission execution. Relationships use the README and shown excerpts; unsampled implementation details are omitted or shown only where documented.

Main entry points: [`oneRole_UI/src/App.jsx`](https://github.com/nakulbhandare/onerole/blob/master/oneRole_UI/src/App.jsx) (Browser application), [`main.go`](https://github.com/nakulbhandare/onerole/blob/master/main.go) (HTTP API), [`worker/source_sync.go`](https://github.com/nakulbhandare/onerole/blob/master/worker/source_sync.go) (Source synchronization), [`service/application.go`](https://github.com/nakulbhandare/onerole/blob/master/service/application.go) (Application workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Browser experience"]
  node_ui["Browser application<br/>[App.jsx]"]
  node_ui_state["UI state and API client<br/>[AppContext.jsx]"]
  node_catalog_view["Catalog and filters<br/>[JobCatalogGrid.jsx]"]
  node_auto_apply_view["Application controls<br/>[AutoApplyView.jsx]"]
  node_tracker["Application tracker"]
end

subgraph group_api["API and identity"]
  node_api_server["HTTP API<br/>[main.go]"]
  node_auth["Authentication<br/>[auth.go]"]
  node_catalog_api["Catalog and profile APIs<br/>[catalog.go]"]
  node_application_api["Application API<br/>[application.go]"]
end

subgraph group_discovery["Job discovery"]
  node_source_worker["Source synchronization<br/>[source_sync.go]"]
  node_job_connectors["Read-only job connectors"]
  node_job_catalog["Job catalog storage<br/>[discovery.go]"]
end

subgraph group_workflow["Application workflow"]
  node_mongo[("MongoDB<br/>[db.go]")]
  node_application_store["Application persistence<br/>[applications.go]"]
  node_application_service["Application workflow<br/>[application.go]"]
  node_auto_apply["Preparation and auto-apply"]
  node_submission_engine["Deterministic submission"]
  node_submission_worker["ATS submission worker<br/>[worker_daemon.js]"]
  node_ats_submit_modules["Browser submitters"]
  node_events["Durable event queue<br/>[jetstream.go]"]
  node_worker_runtime["Worker runtime<br/>[runtime.go]"]
end

node_user(("Job seeker"))
node_ats_services["NATS JetStream"]

node_user -->|"uses"| node_ui
node_ui -->|"uses"| node_ui_state
node_ui -->|"renders"| node_catalog_view
node_ui -->|"renders"| node_auto_apply_view
node_ui -->|"renders"| node_tracker
node_ui_state -->|"calls API"| node_api_server
node_api_server -->|"routes requests"| node_auth
node_api_server -->|"routes requests"| node_catalog_api
node_api_server -->|"routes requests"| node_application_api
node_application_api -->|"calls"| node_application_service
node_application_service -.->|"persists workflow"| node_application_store
node_application_store -->|"reads and writes"| node_mongo
node_api_server -->|"starts worker"| node_worker_runtime
node_worker_runtime -.->|"runs sync"| node_source_worker
node_source_worker -->|"fetches jobs"| node_job_connectors
node_source_worker -.->|"stores jobs"| node_job_catalog
node_application_service -.->|"queues tasks"| node_events
node_worker_runtime -.->|"consumes tasks"| node_events
node_auto_apply -.->|"dispatches submission"| node_submission_worker
node_auto_apply -->|"publishes tasks"| node_ats_services
node_submission_worker -.->|"consumes tasks"| node_ats_services
node_submission_worker -->|"dispatches to"| node_ats_submit_modules
node_submission_engine -->|"records checkpoints"| node_mongo

click node_ui "https://github.com/nakulbhandare/onerole/blob/master/oneRole_UI/src/App.jsx"
click node_ui_state "https://github.com/nakulbhandare/onerole/blob/master/oneRole_UI/src/context/AppContext.jsx"
click node_catalog_view "https://github.com/nakulbhandare/onerole/blob/master/oneRole_UI/src/components/dashboard/JobCatalogGrid.jsx"
click node_auto_apply_view "https://github.com/nakulbhandare/onerole/blob/master/oneRole_UI/src/components/autoApply/AutoApplyView.jsx"
click node_tracker "https://github.com/nakulbhandare/onerole/blob/master/oneRole_UI/src/components/tracker/ApplicationTracker.jsx"
click node_api_server "https://github.com/nakulbhandare/onerole/blob/master/main.go"
click node_auth "https://github.com/nakulbhandare/onerole/blob/master/controller/auth.go"
click node_catalog_api "https://github.com/nakulbhandare/onerole/blob/master/controller/catalog.go"
click node_application_api "https://github.com/nakulbhandare/onerole/blob/master/controller/application.go"
click node_mongo "https://github.com/nakulbhandare/onerole/blob/master/db/db.go"
click node_application_store "https://github.com/nakulbhandare/onerole/blob/master/repository/applications.go"
click node_application_service "https://github.com/nakulbhandare/onerole/blob/master/service/application.go"
click node_auto_apply "https://github.com/nakulbhandare/onerole/blob/master/service/auto_apply_engine.go"
click node_submission_engine "https://github.com/nakulbhandare/onerole/blob/master/service/deterministic_submission_engine.go"
click node_submission_worker "https://github.com/nakulbhandare/onerole/blob/master/connectors/ats_submit/worker_daemon.js"
click node_ats_submit_modules "https://github.com/nakulbhandare/onerole/tree/master/connectors/ats_submit"
click node_events "https://github.com/nakulbhandare/onerole/blob/master/queue/jetstream.go"
click node_worker_runtime "https://github.com/nakulbhandare/onerole/blob/master/worker/runtime.go"
click node_source_worker "https://github.com/nakulbhandare/onerole/blob/master/worker/source_sync.go"
click node_job_connectors "https://github.com/nakulbhandare/onerole/tree/master/connectors/job_sources"
click node_job_catalog "https://github.com/nakulbhandare/onerole/blob/master/repository/discovery.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_ui,node_ui_state,node_catalog_view,node_auto_apply_view,node_tracker toneBlue
class node_api_server,node_auth,node_catalog_api,node_application_api toneAmber
class node_source_worker,node_job_connectors,node_job_catalog toneMint
class node_mongo,node_application_store,node_application_service,node_auto_apply,node_submission_engine,node_submission_worker,node_ats_submit_modules,node_events,node_worker_runtime toneRose
class node_user,node_ats_services toneIndigo
```

## Components

### Browser experience

- [Browser application](https://github.com/nakulbhandare/onerole/blob/master/oneRole_UI/src/App.jsx): `oneRole_UI/src/App.jsx`
- [UI state and API client](https://github.com/nakulbhandare/onerole/blob/master/oneRole_UI/src/context/AppContext.jsx): `oneRole_UI/src/context/AppContext.jsx`
- [Catalog and filters](https://github.com/nakulbhandare/onerole/blob/master/oneRole_UI/src/components/dashboard/JobCatalogGrid.jsx): `oneRole_UI/src/components/dashboard/JobCatalogGrid.jsx`
- [Application controls](https://github.com/nakulbhandare/onerole/blob/master/oneRole_UI/src/components/autoApply/AutoApplyView.jsx): `oneRole_UI/src/components/autoApply/AutoApplyView.jsx`
- [Application tracker](https://github.com/nakulbhandare/onerole/blob/master/oneRole_UI/src/components/tracker/ApplicationTracker.jsx): `oneRole_UI/src/components/tracker/ApplicationTracker.jsx`

### API and identity

- [HTTP API](https://github.com/nakulbhandare/onerole/blob/master/main.go): `main.go`
- [Authentication](https://github.com/nakulbhandare/onerole/blob/master/controller/auth.go): `controller/auth.go`
- [Catalog and profile APIs](https://github.com/nakulbhandare/onerole/blob/master/controller/catalog.go): `controller/catalog.go`
- [Application API](https://github.com/nakulbhandare/onerole/blob/master/controller/application.go): `controller/application.go`

### Job discovery

- [Source synchronization](https://github.com/nakulbhandare/onerole/blob/master/worker/source_sync.go): `worker/source_sync.go`
- [Read-only job connectors](https://github.com/nakulbhandare/onerole/tree/master/connectors/job_sources): `connectors/job_sources`
- [Job catalog storage](https://github.com/nakulbhandare/onerole/blob/master/repository/discovery.go): `repository/discovery.go`

### Application workflow

- [MongoDB](https://github.com/nakulbhandare/onerole/blob/master/db/db.go): `db/db.go`
- [Application persistence](https://github.com/nakulbhandare/onerole/blob/master/repository/applications.go): `repository/applications.go`
- [Application workflow](https://github.com/nakulbhandare/onerole/blob/master/service/application.go): `service/application.go`
- [Preparation and auto-apply](https://github.com/nakulbhandare/onerole/blob/master/service/auto_apply_engine.go): `service/auto_apply_engine.go`
- [Deterministic submission](https://github.com/nakulbhandare/onerole/blob/master/service/deterministic_submission_engine.go): `service/deterministic_submission_engine.go`
- [ATS submission worker](https://github.com/nakulbhandare/onerole/blob/master/connectors/ats_submit/worker_daemon.js): `connectors/ats_submit/worker_daemon.js`
- [Browser submitters](https://github.com/nakulbhandare/onerole/tree/master/connectors/ats_submit): `connectors/ats_submit`
- [Durable event queue](https://github.com/nakulbhandare/onerole/blob/master/queue/jetstream.go): `queue/jetstream.go`
- [Worker runtime](https://github.com/nakulbhandare/onerole/blob/master/worker/runtime.go): `worker/runtime.go`

### Other components

- **Job seeker**
- **NATS JetStream**

## Connections

- Job seeker → Browser application: uses
- Browser application → UI state and API client: uses (evidence: `oneRole_UI/src/App.jsx`)
- Browser application → Catalog and filters: renders (evidence: `oneRole_UI/src/App.jsx`)
- Browser application → Application controls: renders (evidence: `oneRole_UI/src/App.jsx`)
- Browser application → Application tracker: renders (evidence: `oneRole_UI/src/App.jsx`)
- UI state and API client → HTTP API: calls API
- HTTP API → Authentication: routes requests (evidence: `main.go`)
- HTTP API → Catalog and profile APIs: routes requests (evidence: `main.go`)
- HTTP API → Application API: routes requests (evidence: `main.go`)
- Application API → Application workflow: calls (evidence: `controller/application.go`)
- Application workflow → Application persistence: persists workflow
- Application persistence → MongoDB: reads and writes (evidence: `repository/applications.go`)
- HTTP API → Worker runtime: starts worker (evidence: `main.go`)
- Worker runtime → Source synchronization: runs sync
- Source synchronization → Read-only job connectors: fetches jobs
- Source synchronization → Job catalog storage: stores jobs
- Application workflow → Durable event queue: queues tasks
- Worker runtime → Durable event queue: consumes tasks
- Preparation and auto-apply → ATS submission worker: dispatches submission
- Preparation and auto-apply → NATS JetStream: publishes tasks (evidence: `service/auto_apply_engine.go`)
- ATS submission worker → NATS JetStream: consumes tasks
- ATS submission worker → Browser submitters: dispatches to (evidence: `connectors/ats_submit/worker_daemon.js`)
- Deterministic submission → MongoDB: records checkpoints (evidence: `service/deterministic_submission_engine.go`)
