# diguinholns/project-news-dashboard architecture

> Architecture diagram of the GitHub repository diguinholns/project-news-dashboard, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/diguinholns/project-news-dashboard
- Repository: https://github.com/diguinholns/project-news-dashboard

## Overview

Project News takes a news-article URL, processes it asynchronously into an AI-rewritten article, and publishes it to WordPress; the dashboard submits and monitors jobs. The graph preserves the documented extraction, generation, queueing, publishing, plugin, and theme stages, plus job tracking and dashboard workflows. Arrows are limited to README relationships and source-index or excerpt evidence; some WordPress and dashboard internals are represented by their exact enclosing directories because their implementation was not sampled.

Main entry points: [`api/src/worker/services/process-generation-job.service.ts`](https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/worker/services/process-generation-job.service.ts) (Job processor), [`dashboard/src/modules/api/services/apiService.ts`](https://github.com/diguinholns/project-news-dashboard/blob/main/dashboard/src/modules/api/services/apiService.ts) (API client), [`api/src/posts/services/generate-post.service.ts`](https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/posts/services/generate-post.service.ts) (Job submission), [`api/src/jobs/services`](https://github.com/diguinholns/project-news-dashboard/tree/main/api/src/jobs/services) (Job queries and retry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and worker"]
  node_generate_controller["Generate endpoint"]
  node_generate_service["Job submission"]
  node_jobs_controller["Job endpoints<br/>[jobs.controller.ts]"]
  node_job_services["Job queries and retry"]
  node_job_repository[("Job persistence")]
  node_queue["Generation queue"]
  node_worker["Job processor"]
  node_extractor["Article extraction"]
  node_generator["AI generation"]
  node_gemini["Gemini provider<br/>[gemini.provider.ts]"]
  node_payload["Post payload mapping"]
  node_wp_client["WordPress client"]
end

subgraph group_dashboard["Dashboard"]
  node_generate_ui["Generate form<br/>[index.tsx]"]
  node_job_ui["Job views"]
  node_dashboard_api["API client<br/>[apiService.ts]"]
  node_proxy["API proxy<br/>[route.ts]"]
end

subgraph group_wordpress["WordPress publishing"]
  node_posts_controller["Webhook endpoint"]
  node_signature["Signature verification"]
  node_publisher["Post publishing<br/>[PostPublisher.php]"]
  node_featured_image["Featured image<br/>[FeaturedImage.php]"]
end

subgraph group_theme["WordPress theme"]
  node_theme_views["Article presentation"]
end

node_user(("Operator"))
node_source_site(("Source news site"))
node_wp(("WordPress"))

node_user -->|"submits URL"| node_generate_ui
node_generate_ui -->|"requests generation"| node_dashboard_api
node_dashboard_api -.->|"routes API calls"| node_proxy
node_dashboard_api -->|"calls API"| node_generate_controller
node_generate_controller -->|"submits job"| node_generate_service
node_generate_service -->|"creates job"| node_job_repository
node_generate_service -->|"enqueues job"| node_queue
node_queue -->|"dispatches job"| node_worker
node_worker -->|"updates status"| node_job_repository
node_worker -->|"extracts article"| node_extractor
node_extractor -->|"fetches page"| node_source_site
node_worker -->|"generates rewrite"| node_generator
node_generator -->|"uses provider"| node_gemini
node_worker -->|"maps article"| node_payload
node_worker -->|"publishes payload"| node_wp_client
node_wp_client -->|"sends signed webhook"| node_wp
node_wp -->|"receives webhook"| node_posts_controller
node_posts_controller -->|"verifies request"| node_signature
node_posts_controller -->|"publishes post"| node_publisher
node_publisher -->|"attaches image"| node_featured_image
node_wp -->|"renders article"| node_theme_views
node_user -->|"monitors jobs"| node_job_ui
node_job_ui -.->|"requests job data"| node_dashboard_api
node_dashboard_api -->|"calls API"| node_jobs_controller
node_jobs_controller -->|"gets lists retries"| node_job_services
node_job_services -->|"reads job state"| node_job_repository
node_job_services -->|"requeues retry"| node_queue

click node_generate_ui "https://github.com/diguinholns/project-news-dashboard/blob/main/dashboard/src/modules/generate/pages/Generate/components/Form/index.tsx"
click node_job_ui "https://github.com/diguinholns/project-news-dashboard/tree/main/dashboard/src/modules/jobs/pages"
click node_dashboard_api "https://github.com/diguinholns/project-news-dashboard/blob/main/dashboard/src/modules/api/services/apiService.ts"
click node_proxy "https://github.com/diguinholns/project-news-dashboard/blob/main/dashboard/src/app/api/proxy/%5Bservice%5D/%5B...path%5D/route.ts"
click node_generate_controller "https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/posts/controllers/generate-post.controller.ts"
click node_generate_service "https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/posts/services/generate-post.service.ts"
click node_jobs_controller "https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/jobs/controllers/jobs.controller.ts"
click node_job_services "https://github.com/diguinholns/project-news-dashboard/tree/main/api/src/jobs/services"
click node_job_repository "https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/jobs/interfaces/generation-job-repository.interface.ts"
click node_queue "https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/queue/providers/bullmq-generation.queue.ts"
click node_worker "https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/worker/services/process-generation-job.service.ts"
click node_extractor "https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/extraction/services/article-extractor.service.ts"
click node_generator "https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/generation/services/article-generator.service.ts"
click node_gemini "https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/generation/providers/gemini.provider.ts"
click node_payload "https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/publishing/mappers/wordpress-payload.mapper.ts"
click node_wp_client "https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/publishing/providers/wordpress-http.client.ts"
click node_posts_controller "https://github.com/diguinholns/project-news-dashboard/blob/main/wordpress/plugins/project-news-receiver/src/Http/PostsController.php"
click node_signature "https://github.com/diguinholns/project-news-dashboard/blob/main/wordpress/plugins/project-news-receiver/src/Http/SignatureVerifier.php"
click node_publisher "https://github.com/diguinholns/project-news-dashboard/blob/main/wordpress/plugins/project-news-receiver/src/Posts/PostPublisher.php"
click node_featured_image "https://github.com/diguinholns/project-news-dashboard/blob/main/wordpress/plugins/project-news-receiver/src/Posts/FeaturedImage.php"
click node_theme_views "https://github.com/diguinholns/project-news-dashboard/tree/main/wordpress/themes/project-news/template-parts"

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_generate_controller,node_generate_service,node_jobs_controller,node_job_services,node_job_repository,node_queue,node_worker,node_extractor,node_generator,node_gemini,node_payload,node_wp_client toneBlue
class node_generate_ui,node_job_ui,node_dashboard_api,node_proxy toneAmber
class node_posts_controller,node_signature,node_publisher,node_featured_image toneMint
class node_theme_views toneRose
class node_user,node_source_site,node_wp toneIndigo
```

## Components

### API and worker

- [Generate endpoint](https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/posts/controllers/generate-post.controller.ts): `api/src/posts/controllers/generate-post.controller.ts`
- [Job submission](https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/posts/services/generate-post.service.ts): `api/src/posts/services/generate-post.service.ts`
- [Job endpoints](https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/jobs/controllers/jobs.controller.ts): `api/src/jobs/controllers/jobs.controller.ts`
- [Job queries and retry](https://github.com/diguinholns/project-news-dashboard/tree/main/api/src/jobs/services): `api/src/jobs/services`
- [Job persistence](https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/jobs/interfaces/generation-job-repository.interface.ts): `api/src/jobs/interfaces/generation-job-repository.interface.ts`
- [Generation queue](https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/queue/providers/bullmq-generation.queue.ts): `api/src/queue/providers/bullmq-generation.queue.ts`
- [Job processor](https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/worker/services/process-generation-job.service.ts): `api/src/worker/services/process-generation-job.service.ts`
- [Article extraction](https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/extraction/services/article-extractor.service.ts): `api/src/extraction/services/article-extractor.service.ts`
- [AI generation](https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/generation/services/article-generator.service.ts): `api/src/generation/services/article-generator.service.ts`
- [Gemini provider](https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/generation/providers/gemini.provider.ts): `api/src/generation/providers/gemini.provider.ts`
- [Post payload mapping](https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/publishing/mappers/wordpress-payload.mapper.ts): `api/src/publishing/mappers/wordpress-payload.mapper.ts`
- [WordPress client](https://github.com/diguinholns/project-news-dashboard/blob/main/api/src/publishing/providers/wordpress-http.client.ts): `api/src/publishing/providers/wordpress-http.client.ts`

### Dashboard

- [Generate form](https://github.com/diguinholns/project-news-dashboard/blob/main/dashboard/src/modules/generate/pages/Generate/components/Form/index.tsx): `dashboard/src/modules/generate/pages/Generate/components/Form/index.tsx`
- [Job views](https://github.com/diguinholns/project-news-dashboard/tree/main/dashboard/src/modules/jobs/pages): `dashboard/src/modules/jobs/pages`
- [API client](https://github.com/diguinholns/project-news-dashboard/blob/main/dashboard/src/modules/api/services/apiService.ts): `dashboard/src/modules/api/services/apiService.ts`
- [API proxy](https://github.com/diguinholns/project-news-dashboard/blob/main/dashboard/src/app/api/proxy/%5Bservice%5D/%5B...path%5D/route.ts): `dashboard/src/app/api/proxy/[service]/[...path]/route.ts`

### WordPress publishing

- [Webhook endpoint](https://github.com/diguinholns/project-news-dashboard/blob/main/wordpress/plugins/project-news-receiver/src/Http/PostsController.php): `wordpress/plugins/project-news-receiver/src/Http/PostsController.php`
- [Signature verification](https://github.com/diguinholns/project-news-dashboard/blob/main/wordpress/plugins/project-news-receiver/src/Http/SignatureVerifier.php): `wordpress/plugins/project-news-receiver/src/Http/SignatureVerifier.php`
- [Post publishing](https://github.com/diguinholns/project-news-dashboard/blob/main/wordpress/plugins/project-news-receiver/src/Posts/PostPublisher.php): `wordpress/plugins/project-news-receiver/src/Posts/PostPublisher.php`
- [Featured image](https://github.com/diguinholns/project-news-dashboard/blob/main/wordpress/plugins/project-news-receiver/src/Posts/FeaturedImage.php): `wordpress/plugins/project-news-receiver/src/Posts/FeaturedImage.php`

### WordPress theme

- [Article presentation](https://github.com/diguinholns/project-news-dashboard/tree/main/wordpress/themes/project-news/template-parts): `wordpress/themes/project-news/template-parts`

### Other components

- **Operator**
- **Source news site**
- **WordPress**

## Connections

- Operator → Generate form: submits URL
- Generate form → API client: requests generation
- API client → API proxy: routes API calls
- API client → Generate endpoint: calls API
- Generate endpoint → Job submission: submits job (evidence: `api/src/posts/controllers/generate-post.controller.ts`)
- Job submission → Job persistence: creates job (evidence: `api/src/posts/services/generate-post.service.ts`)
- Job submission → Generation queue: enqueues job (evidence: `api/src/posts/services/generate-post.service.ts`)
- Generation queue → Job processor: dispatches job
- Job processor → Job persistence: updates status (evidence: `api/src/worker/services/process-generation-job.service.ts`)
- Job processor → Article extraction: extracts article (evidence: `api/src/worker/services/process-generation-job.service.ts`)
- Article extraction → Source news site: fetches page
- Job processor → AI generation: generates rewrite (evidence: `api/src/worker/services/process-generation-job.service.ts`)
- AI generation → Gemini provider: uses provider (evidence: `api/src/generation/services/article-generator.service.ts`)
- Job processor → Post payload mapping: maps article (evidence: `api/src/worker/services/process-generation-job.service.ts`)
- Job processor → WordPress client: publishes payload (evidence: `api/src/worker/services/process-generation-job.service.ts`)
- WordPress client → WordPress: sends signed webhook
- WordPress → Webhook endpoint: receives webhook
- Webhook endpoint → Signature verification: verifies request (evidence: `wordpress/plugins/project-news-receiver/src/Http/PostsController.php`)
- Webhook endpoint → Post publishing: publishes post (evidence: `wordpress/plugins/project-news-receiver/src/Http/PostsController.php`)
- Post publishing → Featured image: attaches image (evidence: `wordpress/plugins/project-news-receiver/src/Posts/PostPublisher.php`)
- WordPress → Article presentation: renders article
- Operator → Job views: monitors jobs
- Job views → API client: requests job data
- API client → Job endpoints: calls API
- Job endpoints → Job queries and retry: gets lists retries (evidence: `api/src/jobs/controllers/jobs.controller.ts`)
- Job queries and retry → Job persistence: reads job state (evidence: `api/src/jobs/services/retry-job.service.ts`)
- Job queries and retry → Generation queue: requeues retry (evidence: `api/src/jobs/services/retry-job.service.ts`)
