# vijayk-d/newmodularproduct architecture

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

- Interactive diagram: https://gitdiagram.com/vijayk-d/newmodularproduct
- Repository: https://github.com/vijayk-d/newmodularproduct

## Overview

NewModularProduct is local job-application software. Its main user workflow is to prepare a role-specific application from saved evidence, review and tailor its materials, then manage recruiter outreach drafts and contacts. The README documents those capabilities and the layered source layout; the excerpts and source index support several outreach and persistence connections. Other feature links are left dashed where implementation wiring was not shown.

Main entry points: [`src/application/save-application-review.js`](https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/save-application-review.js) (Application review), [`src/application/prepare-application.js`](https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/prepare-application.js) (Prepare application), [`src/infrastructure/outreach/sqlite-outreach-repository.js`](https://github.com/vijayk-d/newmodularproduct/blob/master/src/infrastructure/outreach/sqlite-outreach-repository.js) (Outreach persistence), [`src/application/gmail-send-service.js`](https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/gmail-send-service.js) (Gmail draft and send)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Application preparation"]
  node_web["Local web interface"]
  node_prep["Prepare application"]
  node_jobimport["Job advert import"]
  node_cv["CV tailoring<br/>[cv-tailoring.js]"]
  node_cvpolicy["CV matching rules"]
  node_letter["Cover letter generation"]
end

subgraph group_review["Review and evidence"]
  node_reviewflow["Application review"]
  node_evidence["Evidence ranking<br/>[rank-evidence.js]"]
  node_questions["Application questions"]
  node_insights["Application insights"]
end

subgraph group_outreach["Outreach and email"]
  node_outreachcompose["Compose outreach letter"]
  node_snapshot["Message snapshot"]
  node_editor["Queue message editor"]
  node_queue["Outreach queue"]
  node_gmail["Gmail draft and send"]
  node_sendledger["Send state ledger"]
end

subgraph group_platform["Storage and integrations"]
  node_reviewstore[("Review persistence")]
  node_outreachrepo[("Outreach persistence")]
  node_draftworker["Gmail draft worker"]
  node_linktracker["Click tracking<br/>[worker.js]"]
  node_perplexity["Perplexity research"]
end

node_user(("Applicant"))
node_externalgmail(("Gmail"))

node_user -->|"uses locally"| node_web
node_web -.->|"prepares applications"| node_prep
node_prep -.->|"tailors CV"| node_cv
node_prep -.->|"creates letter"| node_letter
node_jobimport -.->|"supplies advert"| node_prep
node_cv -.->|"applies policy"| node_cvpolicy
node_prep -.->|"produces materials"| node_reviewflow
node_reviewflow -.->|"uses evidence"| node_evidence
node_reviewflow -.->|"supports questions"| node_questions
node_reviewflow -->|"persists review"| node_reviewstore
node_reviewflow -.->|"starts outreach"| node_outreachcompose
node_outreachcompose -->|"prepares snapshot"| node_snapshot
node_editor -->|"validates edits"| node_snapshot
node_queue -.->|"stores queue"| node_outreachrepo
node_outreachrepo -->|"creates ledger"| node_sendledger
node_outreachrepo -->|"uses edit version"| node_editor
node_gmail -.->|"requests preparation"| node_draftworker
node_gmail -.->|"checks send state"| node_sendledger
node_draftworker -.->|"creates drafts"| node_externalgmail
node_linktracker -.->|"records link clicks"| node_externalgmail
node_perplexity -.->|"queries research API"| node_externalgmail
node_reviewstore -.->|"supports insights"| node_insights

click node_web "https://github.com/vijayk-d/newmodularproduct/tree/master/src/interfaces/http"
click node_prep "https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/prepare-application.js"
click node_jobimport "https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/web-advert-import.js"
click node_cv "https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/cv-tailoring.js"
click node_cvpolicy "https://github.com/vijayk-d/newmodularproduct/blob/master/src/domain/cv/cv-tailoring-policy.js"
click node_letter "https://github.com/vijayk-d/newmodularproduct/blob/master/src/domain/cover-letter/generate-cover-letter.js"
click node_reviewflow "https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/save-application-review.js"
click node_evidence "https://github.com/vijayk-d/newmodularproduct/blob/master/src/domain/evidence/rank-evidence.js"
click node_questions "https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/application-questions.js"
click node_reviewstore "https://github.com/vijayk-d/newmodularproduct/blob/master/src/infrastructure/applications/sqlite-review-store.js"
click node_outreachcompose "https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/compose-outreach-letter.js"
click node_snapshot "https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/outreach-message-snapshot.js"
click node_editor "https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/queue-message-editor.js"
click node_queue "https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/outreach-queue-service.js"
click node_outreachrepo "https://github.com/vijayk-d/newmodularproduct/blob/master/src/infrastructure/outreach/sqlite-outreach-repository.js"
click node_gmail "https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/gmail-send-service.js"
click node_draftworker "https://github.com/vijayk-d/newmodularproduct/blob/master/python-worker/gmail_draft_worker.py"
click node_sendledger "https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/gmail-send-ledger.js"
click node_linktracker "https://github.com/vijayk-d/newmodularproduct/blob/master/tools/link-tracker/src/worker.js"
click node_perplexity "https://github.com/vijayk-d/newmodularproduct/blob/master/src/infrastructure/perplexity-client.js"
click node_insights "https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/insights-snapshot.js"

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_prep,node_jobimport,node_cv,node_cvpolicy,node_letter toneBlue
class node_reviewflow,node_evidence,node_questions,node_insights toneAmber
class node_outreachcompose,node_snapshot,node_editor,node_queue,node_gmail,node_sendledger toneMint
class node_reviewstore,node_outreachrepo,node_draftworker,node_linktracker,node_perplexity toneRose
class node_user,node_externalgmail toneIndigo
```

## Components

### Application preparation

- [Local web interface](https://github.com/vijayk-d/newmodularproduct/tree/master/src/interfaces/http): `src/interfaces/http`
- [Prepare application](https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/prepare-application.js): `src/application/prepare-application.js`
- [Job advert import](https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/web-advert-import.js): `src/application/web-advert-import.js`
- [CV tailoring](https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/cv-tailoring.js): `src/application/cv-tailoring.js`
- [CV matching rules](https://github.com/vijayk-d/newmodularproduct/blob/master/src/domain/cv/cv-tailoring-policy.js): `src/domain/cv/cv-tailoring-policy.js`
- [Cover letter generation](https://github.com/vijayk-d/newmodularproduct/blob/master/src/domain/cover-letter/generate-cover-letter.js): `src/domain/cover-letter/generate-cover-letter.js`

### Review and evidence

- [Application review](https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/save-application-review.js): `src/application/save-application-review.js`
- [Evidence ranking](https://github.com/vijayk-d/newmodularproduct/blob/master/src/domain/evidence/rank-evidence.js): `src/domain/evidence/rank-evidence.js`
- [Application questions](https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/application-questions.js): `src/application/application-questions.js`
- [Application insights](https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/insights-snapshot.js): `src/application/insights-snapshot.js`

### Outreach and email

- [Compose outreach letter](https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/compose-outreach-letter.js): `src/application/compose-outreach-letter.js`
- [Message snapshot](https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/outreach-message-snapshot.js): `src/application/outreach-message-snapshot.js`
- [Queue message editor](https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/queue-message-editor.js): `src/application/queue-message-editor.js`
- [Outreach queue](https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/outreach-queue-service.js): `src/application/outreach-queue-service.js`
- [Gmail draft and send](https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/gmail-send-service.js): `src/application/gmail-send-service.js`
- [Send state ledger](https://github.com/vijayk-d/newmodularproduct/blob/master/src/application/gmail-send-ledger.js): `src/application/gmail-send-ledger.js`

### Storage and integrations

- [Review persistence](https://github.com/vijayk-d/newmodularproduct/blob/master/src/infrastructure/applications/sqlite-review-store.js): `src/infrastructure/applications/sqlite-review-store.js`
- [Outreach persistence](https://github.com/vijayk-d/newmodularproduct/blob/master/src/infrastructure/outreach/sqlite-outreach-repository.js): `src/infrastructure/outreach/sqlite-outreach-repository.js`
- [Gmail draft worker](https://github.com/vijayk-d/newmodularproduct/blob/master/python-worker/gmail_draft_worker.py): `python-worker/gmail_draft_worker.py`
- [Click tracking](https://github.com/vijayk-d/newmodularproduct/blob/master/tools/link-tracker/src/worker.js): `tools/link-tracker/src/worker.js`
- [Perplexity research](https://github.com/vijayk-d/newmodularproduct/blob/master/src/infrastructure/perplexity-client.js): `src/infrastructure/perplexity-client.js`

### Other components

- **Applicant**
- **Gmail**

## Connections

- Applicant → Local web interface: uses locally
- Local web interface → Prepare application: prepares applications
- Prepare application → CV tailoring: tailors CV
- Prepare application → Cover letter generation: creates letter
- Job advert import → Prepare application: supplies advert
- CV tailoring → CV matching rules: applies policy
- Prepare application → Application review: produces materials
- Application review → Evidence ranking: uses evidence
- Application review → Application questions: supports questions
- Application review → Review persistence: persists review (evidence: `src/infrastructure/applications/sqlite-review-store.js`)
- Application review → Compose outreach letter: starts outreach
- Compose outreach letter → Message snapshot: prepares snapshot (evidence: `src/application/compose-outreach-letter.js`)
- Queue message editor → Message snapshot: validates edits (evidence: `src/application/queue-message-editor.js`)
- Outreach queue → Outreach persistence: stores queue
- Outreach persistence → Send state ledger: creates ledger (evidence: `src/infrastructure/outreach/sqlite-outreach-repository.js`)
- Outreach persistence → Queue message editor: uses edit version (evidence: `src/infrastructure/outreach/sqlite-outreach-repository.js`)
- Gmail draft and send → Gmail draft worker: requests preparation
- Gmail draft and send → Send state ledger: checks send state
- Gmail draft worker → Gmail: creates drafts
- Click tracking → Gmail: records link clicks
- Perplexity research → Gmail: queries research API
- Review persistence → Application insights: supports insights
