# dakshmistri369/certify-ai architecture

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

- Interactive diagram: https://gitdiagram.com/dakshmistri369/certify-ai
- Repository: https://github.com/dakshmistri369/certify-ai

## Overview

CertifyAI turns uploaded or pasted student rosters into personalized certificate files. The main workflow is roster extraction and review, template/placeholder configuration, preview, bulk rendering, then PDF/PNG and ZIP download. Flask routes coordinate these stages and expose dashboard and verification features. Persistence supports certificate and batch history through MongoDB with local JSON fallback. The excerpts do not show every route or helper call, so uncertain wiring is omitted; documented capabilities are retained where their source paths are clear.

Main entry points: [`app.py`](https://github.com/dakshmistri369/certify-ai/blob/main/app.py) (Flask application), [`templates`](https://github.com/dakshmistri369/certify-ai/tree/main/templates) (Browser UI), [`utils/db.py`](https://github.com/dakshmistri369/certify-ai/blob/main/utils/db.py) (Persistence layer), [`static/js/main.js`](https://github.com/dakshmistri369/certify-ai/blob/main/static/js/main.js) (Coordinate editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_browser["Browser UI"]
  node_flask["Flask application<br/>[app.py]"]
end

subgraph group_design["Roster and design"]
  node_editor["Coordinate editor<br/>[main.js]"]
  node_roster["Roster upload or paste"]
  node_extract["Roster extraction<br/>[data_extractor.py]"]
  node_config["Template configuration<br/>[config.json]"]
end

subgraph group_generation["Certificate generation"]
  node_templates["Certificate templates"]
  node_renderer["Certificate renderer"]
  node_pdf["Combined PDF export<br/>[pdf_helper.py]"]
  node_zip["ZIP export<br/>[zip_helper.py]"]
  node_outputs[("Generated files")]
  node_preview["Live preview<br/>[preview.html]"]
end

subgraph group_records["History and verification"]
  node_db_layer["Persistence layer<br/>[db.py]"]
  node_local[("Local JSON records<br/>[db.py]")]
  node_mongo[("MongoDB Atlas")]
  node_dashboard["Admin dashboard<br/>[dashboard.html]"]
  node_verify["Certificate verification<br/>[verify.html]"]
end

node_operator(("Certificate operator"))

node_operator -->|"uses"| node_browser
node_browser -->|"submits requests"| node_flask
node_browser -->|"uploads or pastes"| node_roster
node_flask -->|"extracts roster"| node_extract
node_flask -->|"serves editor"| node_editor
node_editor -->|"saves settings"| node_flask
node_flask -->|"reads and writes"| node_config
node_flask -->|"resolves template"| node_templates
node_flask -->|"renders certificates"| node_renderer
node_flask -->|"serves preview"| node_preview
node_flask -->|"merges PDFs"| node_pdf
node_flask -->|"archives batch"| node_zip
node_renderer -->|"writes files"| node_outputs
node_pdf -->|"writes PDF"| node_outputs
node_zip -->|"writes archive"| node_outputs
node_flask -->|"records and queries"| node_db_layer
node_db_layer -->|"reads and writes"| node_local
node_db_layer -.->|"persists when connected"| node_mongo
node_flask -->|"serves dashboard"| node_dashboard
node_flask -->|"serves verification"| node_verify
node_dashboard -->|"requests history"| node_flask
node_verify -->|"checks credential"| node_flask
node_flask -->|"serves downloads"| node_outputs

click node_browser "https://github.com/dakshmistri369/certify-ai/tree/main/templates"
click node_flask "https://github.com/dakshmistri369/certify-ai/blob/main/app.py"
click node_editor "https://github.com/dakshmistri369/certify-ai/blob/main/static/js/main.js"
click node_extract "https://github.com/dakshmistri369/certify-ai/blob/main/utils/data_extractor.py"
click node_config "https://github.com/dakshmistri369/certify-ai/blob/main/config.json"
click node_templates "https://github.com/dakshmistri369/certify-ai/tree/main/static/sample_templates"
click node_renderer "https://github.com/dakshmistri369/certify-ai/blob/main/utils/certificate_maker.py"
click node_pdf "https://github.com/dakshmistri369/certify-ai/blob/main/utils/pdf_helper.py"
click node_zip "https://github.com/dakshmistri369/certify-ai/blob/main/utils/zip_helper.py"
click node_db_layer "https://github.com/dakshmistri369/certify-ai/blob/main/utils/db.py"
click node_local "https://github.com/dakshmistri369/certify-ai/blob/main/utils/db.py"
click node_dashboard "https://github.com/dakshmistri369/certify-ai/blob/main/templates/dashboard.html"
click node_verify "https://github.com/dakshmistri369/certify-ai/blob/main/templates/verify.html"
click node_preview "https://github.com/dakshmistri369/certify-ai/blob/main/templates/preview.html"

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_browser,node_flask toneBlue
class node_editor,node_roster,node_extract,node_config toneAmber
class node_templates,node_renderer,node_pdf,node_zip,node_outputs,node_preview toneMint
class node_db_layer,node_local,node_mongo,node_dashboard,node_verify toneRose
class node_operator toneIndigo
```

## Components

### Web experience

- [Browser UI](https://github.com/dakshmistri369/certify-ai/tree/main/templates): `templates`
- [Flask application](https://github.com/dakshmistri369/certify-ai/blob/main/app.py): `app.py`

### Roster and design

- [Coordinate editor](https://github.com/dakshmistri369/certify-ai/blob/main/static/js/main.js): `static/js/main.js`
- **Roster upload or paste**
- [Roster extraction](https://github.com/dakshmistri369/certify-ai/blob/main/utils/data_extractor.py): `utils/data_extractor.py`
- [Template configuration](https://github.com/dakshmistri369/certify-ai/blob/main/config.json): `config.json`

### Certificate generation

- [Certificate templates](https://github.com/dakshmistri369/certify-ai/tree/main/static/sample_templates): `static/sample_templates`
- [Certificate renderer](https://github.com/dakshmistri369/certify-ai/blob/main/utils/certificate_maker.py): `utils/certificate_maker.py`
- [Combined PDF export](https://github.com/dakshmistri369/certify-ai/blob/main/utils/pdf_helper.py): `utils/pdf_helper.py`
- [ZIP export](https://github.com/dakshmistri369/certify-ai/blob/main/utils/zip_helper.py): `utils/zip_helper.py`
- **Generated files**
- [Live preview](https://github.com/dakshmistri369/certify-ai/blob/main/templates/preview.html): `templates/preview.html`

### History and verification

- [Persistence layer](https://github.com/dakshmistri369/certify-ai/blob/main/utils/db.py): `utils/db.py`
- [Local JSON records](https://github.com/dakshmistri369/certify-ai/blob/main/utils/db.py): `utils/db.py`
- **MongoDB Atlas**
- [Admin dashboard](https://github.com/dakshmistri369/certify-ai/blob/main/templates/dashboard.html): `templates/dashboard.html`
- [Certificate verification](https://github.com/dakshmistri369/certify-ai/blob/main/templates/verify.html): `templates/verify.html`

### Other components

- **Certificate operator**

## Connections

- Certificate operator → Browser UI: uses
- Browser UI → Flask application: submits requests
- Browser UI → Roster upload or paste: uploads or pastes
- Flask application → Roster extraction: extracts roster
- Flask application → Coordinate editor: serves editor
- Coordinate editor → Flask application: saves settings
- Flask application → Template configuration: reads and writes
- Flask application → Certificate templates: resolves template
- Flask application → Certificate renderer: renders certificates
- Flask application → Live preview: serves preview
- Flask application → Combined PDF export: merges PDFs
- Flask application → ZIP export: archives batch
- Certificate renderer → Generated files: writes files
- Combined PDF export → Generated files: writes PDF
- ZIP export → Generated files: writes archive
- Flask application → Persistence layer: records and queries
- Persistence layer → Local JSON records: reads and writes
- Persistence layer → MongoDB Atlas: persists when connected
- Flask application → Admin dashboard: serves dashboard
- Flask application → Certificate verification: serves verification
- Admin dashboard → Flask application: requests history
- Certificate verification → Flask application: checks credential
- Flask application → Generated files: serves downloads
