# ananyasinha7/bulk_certificate_generator architecture

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

- Interactive diagram: https://gitdiagram.com/ananyasinha7/bulk_certificate_generator
- Repository: https://github.com/ananyasinha7/bulk_certificate_generator

## Overview

Bulk Certificate Generator accepts recipient batches, validates each recipient independently, renders a PDF for each valid item, tracks job and certificate status, and serves individual PDFs or a ZIP. The principal flow runs from the web UI or API through job creation, background processing, rendering, and stored results. The UI also provides CSV checks, wording presets and previews; job views expose progress, filtering, downloads and failed-row export. Connections for unsampled route modules follow the SOURCE INDEX or README; optional processing links are marked unverified where the excerpts do not show the call.

Main entry points: [`app/main.py`](https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/main.py) (App setup), [`app/static/js/api.js`](https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/static/js/api.js) (API client), [`app/services/processor.py`](https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/services/processor.py) (Batch processor), [`app/static/js/views/new-job.js`](https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/static/js/views/new-job.js) (New job view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_new_job["New job view<br/>[new-job.js]"]
  node_csv["CSV parsing<br/>[csv.js]"]
  node_job_views["Job views<br/>[job.js]"]
  node_jobs_view["Jobs list<br/>[jobs.js]"]
  node_ui_router["UI router<br/>[main.js]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["HTTP API"]
  node_job_api["Job endpoints<br/>[jobs.py]"]
  node_certificate_api["Certificate downloads<br/>[certificates.py]"]
  node_preview_api["Preview endpoint<br/>[previews.py]"]
  node_limits_api["Limits endpoint<br/>[limits.py]"]
  node_app_setup["App setup<br/>[main.py]"]
  node_dependencies["Request dependencies<br/>[deps.py]"]
  node_error_handlers["Error handling<br/>[errors.py]"]
end

subgraph group_workflow["Job workflow"]
  node_job_service["Job service<br/>[jobs.py]"]
  node_processor["Batch processor<br/>[processor.py]"]
end

subgraph group_rendering["PDF generation"]
  node_renderer["PDF renderer<br/>[renderer.py]"]
end

subgraph group_state["Persistence and results"]
  node_storage["File storage<br/>[storage.py]"]
  node_job_records[("Job records<br/>[models.py]")]
  node_db_engine["Database engine<br/>[db.py]"]
end

node_user(("User"))

node_user -->|"enters recipients"| node_new_job
node_user -->|"reviews results"| node_jobs_view
node_ui_router -->|"routes to"| node_new_job
node_ui_router -->|"routes to"| node_jobs_view
node_ui_router -->|"routes to"| node_job_views
node_new_job -->|"parses rows"| node_csv
node_job_views -->|"exports rows"| node_csv
node_new_job -->|"requests jobs and previews"| node_api_client
node_jobs_view -->|"requests job lists"| node_api_client
node_job_views -->|"requests job results"| node_api_client
node_api_client -->|"calls job routes"| node_job_api
node_api_client -->|"calls preview route"| node_preview_api
node_api_client -->|"calls limits route"| node_limits_api
node_app_setup -->|"registers router"| node_job_api
node_app_setup -->|"registers router"| node_certificate_api
node_app_setup -->|"registers router"| node_preview_api
node_app_setup -->|"registers router"| node_limits_api
node_app_setup -->|"creates engine"| node_db_engine
node_app_setup -->|"configures processing"| node_processor
node_app_setup -->|"configures renderer"| node_renderer
node_app_setup -->|"configures storage"| node_storage
node_app_setup -->|"registers handlers"| node_error_handlers
node_job_api -->|"delegates job operations"| node_job_service
node_certificate_api -->|"looks up certificates"| node_job_service
node_preview_api -->|"renders preview"| node_renderer
node_job_api -.->|"triggers background work"| node_processor
node_job_service -->|"creates and queries records"| node_job_records
node_processor -->|"claims and updates items"| node_job_records
node_processor -->|"renders batch items"| node_renderer
node_processor -->|"saves generated PDFs"| node_storage
node_db_engine -->|"initializes schema"| node_job_records
node_app_setup -.->|"provides app services"| node_dependencies

click node_new_job "https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/static/js/views/new-job.js"
click node_csv "https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/static/js/csv.js"
click node_job_views "https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/static/js/views/job.js"
click node_jobs_view "https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/static/js/views/jobs.js"
click node_ui_router "https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/static/js/main.js"
click node_api_client "https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/static/js/api.js"
click node_job_api "https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/api/jobs.py"
click node_certificate_api "https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/api/certificates.py"
click node_preview_api "https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/api/previews.py"
click node_limits_api "https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/api/limits.py"
click node_app_setup "https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/main.py"
click node_job_service "https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/services/jobs.py"
click node_processor "https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/services/processor.py"
click node_renderer "https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/services/renderer.py"
click node_storage "https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/services/storage.py"
click node_job_records "https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/models.py"
click node_db_engine "https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/db.py"
click node_dependencies "https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/deps.py"
click node_error_handlers "https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/errors.py"

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_new_job,node_csv,node_job_views,node_jobs_view,node_ui_router,node_api_client,node_user toneBlue
class node_job_api,node_certificate_api,node_preview_api,node_limits_api,node_app_setup,node_dependencies,node_error_handlers toneAmber
class node_job_service,node_processor toneMint
class node_renderer toneRose
class node_storage,node_job_records,node_db_engine toneIndigo
```

## Components

### Web interface

- [New job view](https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/static/js/views/new-job.js): `app/static/js/views/new-job.js`
- [CSV parsing](https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/static/js/csv.js): `app/static/js/csv.js`
- [Job views](https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/static/js/views/job.js): `app/static/js/views/job.js`
- [Jobs list](https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/static/js/views/jobs.js): `app/static/js/views/jobs.js`
- [UI router](https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/static/js/main.js): `app/static/js/main.js`
- [API client](https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/static/js/api.js): `app/static/js/api.js`

### HTTP API

- [Job endpoints](https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/api/jobs.py): `app/api/jobs.py`
- [Certificate downloads](https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/api/certificates.py): `app/api/certificates.py`
- [Preview endpoint](https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/api/previews.py): `app/api/previews.py`
- [Limits endpoint](https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/api/limits.py): `app/api/limits.py`
- [App setup](https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/main.py): `app/main.py`
- [Request dependencies](https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/deps.py): `app/deps.py`
- [Error handling](https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/errors.py): `app/errors.py`

### Job workflow

- [Job service](https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/services/jobs.py): `app/services/jobs.py`
- [Batch processor](https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/services/processor.py): `app/services/processor.py`

### PDF generation

- [PDF renderer](https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/services/renderer.py): `app/services/renderer.py`

### Persistence and results

- [File storage](https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/services/storage.py): `app/services/storage.py`
- [Job records](https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/models.py): `app/models.py`
- [Database engine](https://github.com/ananyasinha7/bulk_certificate_generator/blob/main/app/db.py): `app/db.py`

### Other components

- **User**

## Connections

- User → New job view: enters recipients (evidence: `README.md`)
- User → Jobs list: reviews results (evidence: `README.md`)
- UI router → New job view: routes to (evidence: `app/static/js/main.js`)
- UI router → Jobs list: routes to (evidence: `app/static/js/main.js`)
- UI router → Job views: routes to (evidence: `app/static/js/main.js`)
- New job view → CSV parsing: parses rows (evidence: `app/static/js/views/new-job.js`)
- Job views → CSV parsing: exports rows (evidence: `app/static/js/views/job.js`)
- New job view → API client: requests jobs and previews (evidence: `app/static/js/views/new-job.js`)
- Jobs list → API client: requests job lists (evidence: `app/static/js/views/jobs.js`)
- Job views → API client: requests job results (evidence: `app/static/js/views/job.js`)
- API client → Job endpoints: calls job routes (evidence: `app/static/js/api.js`)
- API client → Preview endpoint: calls preview route (evidence: `app/static/js/api.js`)
- API client → Limits endpoint: calls limits route (evidence: `app/static/js/api.js`)
- App setup → Job endpoints: registers router (evidence: `app/main.py`)
- App setup → Certificate downloads: registers router (evidence: `app/main.py`)
- App setup → Preview endpoint: registers router (evidence: `app/main.py`)
- App setup → Limits endpoint: registers router (evidence: `app/main.py`)
- App setup → Database engine: creates engine (evidence: `app/main.py`)
- App setup → Batch processor: configures processing (evidence: `app/main.py`)
- App setup → PDF renderer: configures renderer (evidence: `app/main.py`)
- App setup → File storage: configures storage (evidence: `app/main.py`)
- App setup → Error handling: registers handlers (evidence: `app/main.py`)
- Job endpoints → Job service: delegates job operations (evidence: `app/api/jobs.py`)
- Certificate downloads → Job service: looks up certificates (evidence: `app/api/certificates.py`)
- Preview endpoint → PDF renderer: renders preview (evidence: `app/api/previews.py`)
- Job endpoints → Batch processor: triggers background work (evidence: `README.md`)
- Job service → Job records: creates and queries records (evidence: `app/services/jobs.py`)
- Batch processor → Job records: claims and updates items (evidence: `app/services/processor.py`)
- Batch processor → PDF renderer: renders batch items (evidence: `app/services/processor.py`)
- Batch processor → File storage: saves generated PDFs (evidence: `app/services/processor.py`)
- Database engine → Job records: initializes schema (evidence: `app/models.py`)
- App setup → Request dependencies: provides app services
