# vidhusanv17/pramaan-document-validation architecture

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

- Interactive diagram: https://gitdiagram.com/vidhusanv17/pramaan-document-validation
- Repository: https://github.com/vidhusanv17/pramaan-document-validation

## Overview

PRAMAAN is a human-in-the-loop AICTE application screening prototype. Institutions submit applications and supporting documents; the system extracts evidence, checks completeness and consistency, investigates possible tampering, and verifies issuers. It returns risk-ranked findings for officers to review rather than making approval decisions itself. The graph includes the documented UI, compliance and forensic capabilities; some module links are supported only by the source index, so unsampled behavior is not expanded beyond those references.

Main entry points: [`app/pipeline.py`](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/pipeline.py) (Validation and risk), [`app/api.py`](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/api.py) (Application API), [`app/db.py`](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/db.py) (Application database), [`app/seed.py`](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/seed.py) (Synthetic demo corpus)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Application intake"]
  node_webui["Web interface<br/>[app.jsx]"]
  node_application_pages["Application pages<br/>[pages.jsx]"]
  node_ui_components["Shared UI<br/>[ui.jsx]"]
  node_api["Application API<br/>[api.py]"]
end

subgraph group_analysis["Document analysis"]
  node_ocr["OCR and page evidence<br/>[ocr.py]"]
  node_classifier["Document classifier<br/>[classify.py]"]
  node_extractor["Field extraction<br/>[extract.py]"]
end

subgraph group_assurance["Compliance assurance"]
  node_forensics["Tamper analysis<br/>[forensics.py]"]
  node_pipeline["Validation and risk<br/>[pipeline.py]"]
  node_checklists["Checklist and norms<br/>[checklists.json]"]
  node_issuer_verification["Issuer verification<br/>[verify.py]"]
end

subgraph group_review["Officer review"]
  node_report_view["Findings report<br/>[report.jsx]"]
  node_review_actions["Finding review and decisions<br/>[api.py]"]
  node_audit["Hash-chained audit<br/>[audit.py]"]
end

subgraph group_platform["Data and services"]
  node_auth["Identity and roles<br/>[auth.py]"]
  node_mock_authority["Mock issuer registry<br/>[mock_authority.py]"]
  node_models["Domain records<br/>[models.py]"]
  node_database[("Application database<br/>[db.py]")]
  node_startup["Service startup<br/>[main.py]"]
  node_seed["Synthetic demo corpus<br/>[seed.py]"]
  node_docgen["Synthetic document generator<br/>[docgen.py]"]
end

node_institution(("Institution user"))
node_officer(("Review officer"))

node_institution -->|"submits applications"| node_webui
node_officer -->|"reviews findings"| node_webui
node_webui -.->|"presents workflow"| node_application_pages
node_webui -->|"shows findings"| node_report_view
node_application_pages -.->|"uses services"| node_api
node_report_view -.->|"loads reports"| node_api
node_api -->|"checks access"| node_auth
node_api -->|"validates application"| node_pipeline
node_api -->|"handles reviews"| node_review_actions
node_api -->|"records actions"| node_audit
node_pipeline -->|"reads pages"| node_ocr
node_pipeline -->|"classifies documents"| node_classifier
node_pipeline -->|"extracts fields"| node_extractor
node_pipeline -->|"checks tampering"| node_forensics
node_pipeline -->|"requests verification"| node_issuer_verification
node_pipeline -->|"checks requirements"| node_checklists
node_issuer_verification -->|"looks up issuer"| node_mock_authority
node_startup -->|"registers routes"| node_api
node_startup -->|"seeds demo data"| node_seed
node_seed -->|"generates documents"| node_docgen
node_seed -->|"validates seeded apps"| node_pipeline
node_seed -->|"seeds registry"| node_mock_authority
node_auth -->|"loads users"| node_database
node_api -->|"reads and writes"| node_database
node_pipeline -.->|"persists results"| node_database
node_mock_authority -->|"stores registry file"| node_database
node_audit -->|"creates audit records"| node_models
node_database -->|"maps records"| node_models
node_review_actions -->|"logs decisions"| node_audit

click node_webui "https://github.com/vidhusanv17/pramaan-document-validation/blob/main/frontend/app.jsx"
click node_application_pages "https://github.com/vidhusanv17/pramaan-document-validation/blob/main/frontend/pages.jsx"
click node_report_view "https://github.com/vidhusanv17/pramaan-document-validation/blob/main/frontend/report.jsx"
click node_ui_components "https://github.com/vidhusanv17/pramaan-document-validation/blob/main/frontend/ui.jsx"
click node_api "https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/api.py"
click node_auth "https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/auth.py"
click node_ocr "https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/ocr.py"
click node_classifier "https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/classify.py"
click node_extractor "https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/extract.py"
click node_forensics "https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/forensics.py"
click node_pipeline "https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/pipeline.py"
click node_checklists "https://github.com/vidhusanv17/pramaan-document-validation/blob/main/rules/checklists.json"
click node_issuer_verification "https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/verify.py"
click node_mock_authority "https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/mock_authority.py"
click node_review_actions "https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/api.py"
click node_audit "https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/audit.py"
click node_models "https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/models.py"
click node_database "https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/db.py"
click node_startup "https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/main.py"
click node_seed "https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/seed.py"
click node_docgen "https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/docgen.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_webui,node_application_pages,node_ui_components,node_api,node_institution,node_officer toneBlue
class node_ocr,node_classifier,node_extractor toneAmber
class node_forensics,node_pipeline,node_checklists,node_issuer_verification toneMint
class node_report_view,node_review_actions,node_audit toneRose
class node_auth,node_mock_authority,node_models,node_database,node_startup,node_seed,node_docgen toneIndigo
```

## Components

### Application intake

- [Web interface](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/frontend/app.jsx): `frontend/app.jsx`
- [Application pages](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/frontend/pages.jsx): `frontend/pages.jsx`
- [Shared UI](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/frontend/ui.jsx): `frontend/ui.jsx`
- [Application API](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/api.py): `app/api.py`

### Document analysis

- [OCR and page evidence](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/ocr.py): `app/ocr.py`
- [Document classifier](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/classify.py): `app/classify.py`
- [Field extraction](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/extract.py): `app/extract.py`

### Compliance assurance

- [Tamper analysis](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/forensics.py): `app/forensics.py`
- [Validation and risk](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/pipeline.py): `app/pipeline.py`
- [Checklist and norms](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/rules/checklists.json): `rules/checklists.json`
- [Issuer verification](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/verify.py): `app/verify.py`

### Officer review

- [Findings report](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/frontend/report.jsx): `frontend/report.jsx`
- [Finding review and decisions](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/api.py): `app/api.py`
- [Hash-chained audit](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/audit.py): `app/audit.py`

### Data and services

- [Identity and roles](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/auth.py): `app/auth.py`
- [Mock issuer registry](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/mock_authority.py): `app/mock_authority.py`
- [Domain records](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/models.py): `app/models.py`
- [Application database](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/db.py): `app/db.py`
- [Service startup](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/main.py): `app/main.py`
- [Synthetic demo corpus](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/seed.py): `app/seed.py`
- [Synthetic document generator](https://github.com/vidhusanv17/pramaan-document-validation/blob/main/app/docgen.py): `app/docgen.py`

### Other components

- **Institution user**
- **Review officer**

## Connections

- Institution user → Web interface: submits applications (evidence: `README.md`)
- Review officer → Web interface: reviews findings (evidence: `README.md`)
- Web interface → Application pages: presents workflow
- Web interface → Findings report: shows findings (evidence: `README.md`)
- Application pages → Application API: uses services
- Findings report → Application API: loads reports
- Application API → Identity and roles: checks access (evidence: `app/api.py`)
- Application API → Validation and risk: validates application (evidence: `app/api.py`)
- Application API → Finding review and decisions: handles reviews (evidence: `README.md`)
- Application API → Hash-chained audit: records actions (evidence: `app/api.py`)
- Validation and risk → OCR and page evidence: reads pages (evidence: `app/pipeline.py`)
- Validation and risk → Document classifier: classifies documents (evidence: `app/pipeline.py`)
- Validation and risk → Field extraction: extracts fields (evidence: `app/pipeline.py`)
- Validation and risk → Tamper analysis: checks tampering (evidence: `app/pipeline.py`)
- Validation and risk → Issuer verification: requests verification (evidence: `app/pipeline.py`)
- Validation and risk → Checklist and norms: checks requirements (evidence: `README.md`)
- Issuer verification → Mock issuer registry: looks up issuer (evidence: `app/verify.py`)
- Service startup → Application API: registers routes (evidence: `app/main.py`)
- Service startup → Synthetic demo corpus: seeds demo data (evidence: `app/main.py`)
- Synthetic demo corpus → Synthetic document generator: generates documents (evidence: `app/seed.py`)
- Synthetic demo corpus → Validation and risk: validates seeded apps (evidence: `app/seed.py`)
- Synthetic demo corpus → Mock issuer registry: seeds registry (evidence: `app/seed.py`)
- Identity and roles → Application database: loads users (evidence: `app/auth.py`)
- Application API → Application database: reads and writes (evidence: `app/api.py`)
- Validation and risk → Application database: persists results (evidence: `app/pipeline.py`)
- Mock issuer registry → Application database: stores registry file (evidence: `app/mock_authority.py`)
- Hash-chained audit → Domain records: creates audit records (evidence: `app/audit.py`)
- Application database → Domain records: maps records (evidence: `app/models.py`)
- Finding review and decisions → Hash-chained audit: logs decisions (evidence: `README.md`)
