# amruth-98/credsure architecture

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

- Interactive diagram: https://gitdiagram.com/amruth-98/credsure
- Repository: https://github.com/amruth-98/credsure

## Overview

CredSure is a client-side academic credential verification demonstration. A user submits a certificate in the verification page; OCR extracts candidate details, the verification engine compares them with fictional demonstration records, and the app displays a result that can also be printed. The app also presents an explanatory pipeline, sample certificates, and sample records. The graph reflects the shown imports and documented behavior; the callback from verification back to app state is dashed because its invocation is outside the excerpt.

Main entry points: [`src/App.tsx`](https://github.com/amruth-98/credsure/blob/main/src/App.tsx) (App state and routing), [`src/components/VerifyPage.tsx`](https://github.com/amruth-98/credsure/blob/main/src/components/VerifyPage.tsx) (Certificate submission), [`src/components/HomePage.tsx`](https://github.com/amruth-98/credsure/blob/main/src/components/HomePage.tsx) (Home page), [`src/components/HowItWorksPage.tsx`](https://github.com/amruth-98/credsure/blob/main/src/components/HowItWorksPage.tsx) (How it works)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App and pages"]
  node_app["App state and routing<br/>[App.tsx]"]
  node_home["Home page<br/>[HomePage.tsx]"]
  node_how["How it works<br/>[HowItWorksPage.tsx]"]
  node_navbar["Navigation bar<br/>[Navbar.tsx]"]
  node_footer["Footer navigation<br/>[Footer.tsx]"]
  node_illustrations["Page illustrations<br/>[Illustrations.tsx]"]
  node_results["Verification results<br/>[ResultsPage.tsx]"]
  node_report["Printable report<br/>[PrintReport.tsx]"]
end

subgraph group_verification["Credential verification"]
  node_verify["Certificate submission<br/>[VerifyPage.tsx]"]
  node_ocr["OCR and field parsing<br/>[ocrService.ts]"]
  node_engine["Credential comparison"]
  node_types["Verification data types<br/>[types.ts]"]
end

subgraph group_reference["Demonstration data"]
  node_samples["Sample certificates"]
  node_records[("Demonstration records")]
end

node_user(("User"))
node_tesseract["Tesseract OCR"]

node_user -->|"uses"| node_app
node_app -->|"renders"| node_navbar
node_app -->|"renders"| node_footer
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_verify
node_app -->|"routes to"| node_how
node_app -->|"renders"| node_results
node_app -->|"renders"| node_report
node_home -->|"renders"| node_illustrations
node_how -->|"displays"| node_records
node_verify -->|"extracts and parses"| node_ocr
node_ocr -->|"recognizes text with"| node_tesseract
node_verify -->|"generates sample images"| node_samples
node_verify -->|"submits details to"| node_engine
node_engine -->|"looks up credentials"| node_records
node_verify -.->|"reports result"| node_app

click node_app "https://github.com/amruth-98/credsure/blob/main/src/App.tsx"
click node_home "https://github.com/amruth-98/credsure/blob/main/src/components/HomePage.tsx"
click node_how "https://github.com/amruth-98/credsure/blob/main/src/components/HowItWorksPage.tsx"
click node_navbar "https://github.com/amruth-98/credsure/blob/main/src/components/Navbar.tsx"
click node_footer "https://github.com/amruth-98/credsure/blob/main/src/components/Footer.tsx"
click node_illustrations "https://github.com/amruth-98/credsure/blob/main/src/components/Illustrations.tsx"
click node_verify "https://github.com/amruth-98/credsure/blob/main/src/components/VerifyPage.tsx"
click node_ocr "https://github.com/amruth-98/credsure/blob/main/src/utils/ocrService.ts"
click node_engine "https://github.com/amruth-98/credsure/blob/main/src/utils/verificationEngine.ts"
click node_results "https://github.com/amruth-98/credsure/blob/main/src/components/ResultsPage.tsx"
click node_report "https://github.com/amruth-98/credsure/blob/main/src/components/PrintReport.tsx"
click node_samples "https://github.com/amruth-98/credsure/blob/main/src/utils/sampleCertificates.ts"
click node_records "https://github.com/amruth-98/credsure/blob/main/src/data/demonstrationRecords.ts"
click node_types "https://github.com/amruth-98/credsure/blob/main/src/types.ts"

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_app,node_home,node_how,node_navbar,node_footer,node_illustrations,node_results,node_report,node_user toneBlue
class node_verify,node_ocr,node_engine,node_types toneAmber
class node_samples,node_records toneMint
class node_tesseract toneIndigo
```

## Components

### App and pages

- [App state and routing](https://github.com/amruth-98/credsure/blob/main/src/App.tsx): `src/App.tsx`
- [Home page](https://github.com/amruth-98/credsure/blob/main/src/components/HomePage.tsx): `src/components/HomePage.tsx`
- [How it works](https://github.com/amruth-98/credsure/blob/main/src/components/HowItWorksPage.tsx): `src/components/HowItWorksPage.tsx`
- [Navigation bar](https://github.com/amruth-98/credsure/blob/main/src/components/Navbar.tsx): `src/components/Navbar.tsx`
- [Footer navigation](https://github.com/amruth-98/credsure/blob/main/src/components/Footer.tsx): `src/components/Footer.tsx`
- [Page illustrations](https://github.com/amruth-98/credsure/blob/main/src/components/Illustrations.tsx): `src/components/Illustrations.tsx`
- [Verification results](https://github.com/amruth-98/credsure/blob/main/src/components/ResultsPage.tsx): `src/components/ResultsPage.tsx`
- [Printable report](https://github.com/amruth-98/credsure/blob/main/src/components/PrintReport.tsx): `src/components/PrintReport.tsx`

### Credential verification

- [Certificate submission](https://github.com/amruth-98/credsure/blob/main/src/components/VerifyPage.tsx): `src/components/VerifyPage.tsx`
- [OCR and field parsing](https://github.com/amruth-98/credsure/blob/main/src/utils/ocrService.ts): `src/utils/ocrService.ts`
- [Credential comparison](https://github.com/amruth-98/credsure/blob/main/src/utils/verificationEngine.ts): `src/utils/verificationEngine.ts`
- [Verification data types](https://github.com/amruth-98/credsure/blob/main/src/types.ts): `src/types.ts`

### Demonstration data

- [Sample certificates](https://github.com/amruth-98/credsure/blob/main/src/utils/sampleCertificates.ts): `src/utils/sampleCertificates.ts`
- [Demonstration records](https://github.com/amruth-98/credsure/blob/main/src/data/demonstrationRecords.ts): `src/data/demonstrationRecords.ts`

### Other components

- **User**
- **Tesseract OCR**

## Connections

- User → App state and routing: uses
- App state and routing → Navigation bar: renders (evidence: `src/App.tsx`)
- App state and routing → Footer navigation: renders (evidence: `src/App.tsx`)
- App state and routing → Home page: routes to (evidence: `src/App.tsx`)
- App state and routing → Certificate submission: routes to (evidence: `src/App.tsx`)
- App state and routing → How it works: routes to (evidence: `src/App.tsx`)
- App state and routing → Verification results: renders (evidence: `src/App.tsx`)
- App state and routing → Printable report: renders (evidence: `src/App.tsx`)
- Home page → Page illustrations: renders (evidence: `src/components/HomePage.tsx`)
- How it works → Demonstration records: displays (evidence: `src/components/HowItWorksPage.tsx`)
- Certificate submission → OCR and field parsing: extracts and parses (evidence: `src/components/VerifyPage.tsx`)
- OCR and field parsing → Tesseract OCR: recognizes text with (evidence: `src/utils/ocrService.ts`)
- Certificate submission → Sample certificates: generates sample images (evidence: `src/components/VerifyPage.tsx`)
- Certificate submission → Credential comparison: submits details to (evidence: `src/components/VerifyPage.tsx`)
- Credential comparison → Demonstration records: looks up credentials (evidence: `src/utils/verificationEngine.ts`)
- Certificate submission → App state and routing: reports result (evidence: `src/App.tsx`)
