# subasri-oop/certificate-verification-system architecture

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

- Interactive diagram: https://gitdiagram.com/subasri-oop/certificate-verification-system
- Repository: https://github.com/subasri-oop/certificate-verification-system

## Overview

This is a certificate-authenticity service: users upload an image or PDF, the backend computes its SHA-256 fingerprint and screens it for tampering, then checks clean documents against a blockchain registry and returns a status. Trusted authorities can register certificate hashes through a separate store workflow. The graph reflects calls visible in the excerpts and capabilities documented in the README; some detector subchecks are combined because they share one implementation file, and the visual-PDF check’s invocation is not shown.

Main entry points: [`backend/tamper_detector.py`](https://github.com/subasri-oop/certificate-verification-system/blob/main/backend/tamper_detector.py) (Tamper detector), [`blockchain/contract_manager.py`](https://github.com/subasri-oop/certificate-verification-system/blob/main/blockchain/contract_manager.py) (Contract manager), [`frontend/app.js`](https://github.com/subasri-oop/certificate-verification-system/blob/main/frontend/app.js) (Upload API client), [`backend/main.py`](https://github.com/subasri-oop/certificate-verification-system/blob/main/backend/main.py) (Verify endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User interface"]
  node_webui["Upload and results UI<br/>[index.html]"]
  node_clientflow["Upload API client<br/>[app.js]"]
end

subgraph group_service["Verification service"]
  node_verifyapi["Verify endpoint<br/>[main.py]"]
  node_storeapi["Register endpoint<br/>[main.py]"]
end

subgraph group_detection["Document analysis"]
  node_hashing["SHA-256 hashing<br/>[tamper_detector.py]"]
  node_binaryscan["Binary signatures<br/>[tamper_detector.py]"]
  node_pdfscan["PDF inspection<br/>[tamper_detector.py]"]
  node_structure["Image structure check<br/>[tamper_detector.py]"]
  node_metadata["Metadata inspection<br/>[tamper_detector.py]"]
  node_ela["Error level analysis<br/>[tamper_detector.py]"]
  node_detector["Tamper detector<br/>[tamper_detector.py]"]
end

subgraph group_chain["Blockchain registry"]
  node_contractmanager["Contract manager"]
  node_contract["Certificate contract"]
  node_registry[("Blockchain registry")]
end

node_user(("Uploader / authority"))
node_ganache["Ganache node"]

node_user -->|"uploads document"| node_webui
node_webui -->|"provides interface"| node_clientflow
node_clientflow -->|"posts to verify"| node_verifyapi
node_clientflow -->|"posts to store"| node_storeapi
node_verifyapi -->|"checks document"| node_detector
node_storeapi -->|"computes hash"| node_hashing
node_verifyapi -->|"checks registry"| node_contractmanager
node_storeapi -->|"registers hash"| node_contractmanager
node_detector -->|"computes fingerprint"| node_hashing
node_detector -->|"scans signatures"| node_binaryscan
node_detector -->|"checks PDFs"| node_pdfscan
node_detector -->|"checks image structure"| node_structure
node_detector -.->|"inspects metadata"| node_metadata
node_detector -->|"runs ELA"| node_ela
node_pdfscan -->|"analyzes rendered pages"| node_ela
node_contractmanager -->|"loads and compiles"| node_contract
node_contractmanager -->|"reads and writes hashes"| node_registry
node_contractmanager -->|"connects via Web3"| node_ganache
node_contract -.->|"stores certificate hashes"| node_registry
node_verifyapi -->|"returns status"| node_clientflow
node_storeapi -->|"returns registration result"| node_clientflow

click node_webui "https://github.com/subasri-oop/certificate-verification-system/blob/main/frontend/index.html"
click node_clientflow "https://github.com/subasri-oop/certificate-verification-system/blob/main/frontend/app.js"
click node_verifyapi "https://github.com/subasri-oop/certificate-verification-system/blob/main/backend/main.py"
click node_storeapi "https://github.com/subasri-oop/certificate-verification-system/blob/main/backend/main.py"
click node_hashing "https://github.com/subasri-oop/certificate-verification-system/blob/main/backend/tamper_detector.py"
click node_binaryscan "https://github.com/subasri-oop/certificate-verification-system/blob/main/backend/tamper_detector.py"
click node_pdfscan "https://github.com/subasri-oop/certificate-verification-system/blob/main/backend/tamper_detector.py"
click node_structure "https://github.com/subasri-oop/certificate-verification-system/blob/main/backend/tamper_detector.py"
click node_metadata "https://github.com/subasri-oop/certificate-verification-system/blob/main/backend/tamper_detector.py"
click node_ela "https://github.com/subasri-oop/certificate-verification-system/blob/main/backend/tamper_detector.py"
click node_detector "https://github.com/subasri-oop/certificate-verification-system/blob/main/backend/tamper_detector.py"
click node_contractmanager "https://github.com/subasri-oop/certificate-verification-system/blob/main/blockchain/contract_manager.py"
click node_contract "https://github.com/subasri-oop/certificate-verification-system/blob/main/blockchain/CertificateStore.sol"

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_clientflow toneBlue
class node_verifyapi,node_storeapi toneAmber
class node_hashing,node_binaryscan,node_pdfscan,node_structure,node_metadata,node_ela,node_detector toneMint
class node_contractmanager,node_contract,node_registry toneRose
class node_user,node_ganache toneIndigo
```

## Components

### User interface

- [Upload and results UI](https://github.com/subasri-oop/certificate-verification-system/blob/main/frontend/index.html): `frontend/index.html`
- [Upload API client](https://github.com/subasri-oop/certificate-verification-system/blob/main/frontend/app.js): `frontend/app.js`

### Verification service

- [Verify endpoint](https://github.com/subasri-oop/certificate-verification-system/blob/main/backend/main.py): `backend/main.py`
- [Register endpoint](https://github.com/subasri-oop/certificate-verification-system/blob/main/backend/main.py): `backend/main.py`

### Document analysis

- [SHA-256 hashing](https://github.com/subasri-oop/certificate-verification-system/blob/main/backend/tamper_detector.py): `backend/tamper_detector.py`
- [Binary signatures](https://github.com/subasri-oop/certificate-verification-system/blob/main/backend/tamper_detector.py): `backend/tamper_detector.py`
- [PDF inspection](https://github.com/subasri-oop/certificate-verification-system/blob/main/backend/tamper_detector.py): `backend/tamper_detector.py`
- [Image structure check](https://github.com/subasri-oop/certificate-verification-system/blob/main/backend/tamper_detector.py): `backend/tamper_detector.py`
- [Metadata inspection](https://github.com/subasri-oop/certificate-verification-system/blob/main/backend/tamper_detector.py): `backend/tamper_detector.py`
- [Error level analysis](https://github.com/subasri-oop/certificate-verification-system/blob/main/backend/tamper_detector.py): `backend/tamper_detector.py`
- [Tamper detector](https://github.com/subasri-oop/certificate-verification-system/blob/main/backend/tamper_detector.py): `backend/tamper_detector.py`

### Blockchain registry

- [Contract manager](https://github.com/subasri-oop/certificate-verification-system/blob/main/blockchain/contract_manager.py): `blockchain/contract_manager.py`
- [Certificate contract](https://github.com/subasri-oop/certificate-verification-system/blob/main/blockchain/CertificateStore.sol): `blockchain/CertificateStore.sol`
- **Blockchain registry**

### Other components

- **Uploader / authority**
- **Ganache node**

## Connections

- Uploader / authority → Upload and results UI: uploads document (evidence: `README.md`)
- Upload and results UI → Upload API client: provides interface (evidence: `README.md`)
- Upload API client → Verify endpoint: posts to verify (evidence: `frontend/app.js`)
- Upload API client → Register endpoint: posts to store (evidence: `frontend/app.js`)
- Verify endpoint → Tamper detector: checks document (evidence: `backend/main.py`)
- Register endpoint → SHA-256 hashing: computes hash (evidence: `backend/main.py`)
- Verify endpoint → Contract manager: checks registry (evidence: `backend/main.py`)
- Register endpoint → Contract manager: registers hash (evidence: `backend/main.py`)
- Tamper detector → SHA-256 hashing: computes fingerprint (evidence: `backend/tamper_detector.py`)
- Tamper detector → Binary signatures: scans signatures (evidence: `backend/tamper_detector.py`)
- Tamper detector → PDF inspection: checks PDFs (evidence: `backend/tamper_detector.py`)
- Tamper detector → Image structure check: checks image structure (evidence: `backend/tamper_detector.py`)
- Tamper detector → Metadata inspection: inspects metadata (evidence: `backend/tamper_detector.py`)
- Tamper detector → Error level analysis: runs ELA (evidence: `backend/tamper_detector.py`)
- PDF inspection → Error level analysis: analyzes rendered pages (evidence: `backend/tamper_detector.py`)
- Contract manager → Certificate contract: loads and compiles (evidence: `blockchain/contract_manager.py`)
- Contract manager → Blockchain registry: reads and writes hashes (evidence: `blockchain/contract_manager.py`)
- Contract manager → Ganache node: connects via Web3 (evidence: `blockchain/contract_manager.py`)
- Certificate contract → Blockchain registry: stores certificate hashes
- Verify endpoint → Upload API client: returns status (evidence: `frontend/app.js`)
- Register endpoint → Upload API client: returns registration result (evidence: `frontend/app.js`)
