# kadamyogiraj/project1 architecture

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

- Interactive diagram: https://gitdiagram.com/kadamyogiraj/project1
- Repository: https://github.com/kadamyogiraj/project1

## Overview

CertChain is a React certificate lifecycle application: administrators connect a wallet, register students, and issue certificates; students access certificates, while anyone can check authenticity, including from QR codes. The blockchain context wraps the ethers-based service, and a separate app context caches certificate details in local storage. The README documents the portal capabilities; some page and admin-component wiring is unsampled, so those links reflect documented responsibilities rather than inspected calls.

Main entry points: [`src/pages/AdminPortal.tsx`](https://github.com/kadamyogiraj/project1/blob/main/src/pages/AdminPortal.tsx) (Admin portal), [`src/App.tsx`](https://github.com/kadamyogiraj/project1/blob/main/src/App.tsx) (App router), [`src/lib/blockchain.ts`](https://github.com/kadamyogiraj/project1/blob/main/src/lib/blockchain.ts) (Blockchain service), [`src/pages/VerifyCertificate.tsx`](https://github.com/kadamyogiraj/project1/blob/main/src/pages/VerifyCertificate.tsx) (Certificate verification)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Portals and verification"]
  node_app["App router<br/>[App.tsx]"]
  node_home["Home page<br/>[Index.tsx]"]
  node_student_portal["Student portal<br/>[StudentPortal.tsx]"]
  node_verify["Certificate verification"]
end

subgraph group_issuance["Administration and issuance"]
  node_admin_portal["Admin portal<br/>[AdminPortal.tsx]"]
  node_register["Register students"]
  node_issue["Issue certificates"]
  node_records["View records<br/>[ViewAllRecords.tsx]"]
  node_analytics["Analytics dashboard"]
  node_preview["Certificate preview"]
end

subgraph group_blockchain["Blockchain integration"]
  node_chain_context["Wallet and contract context"]
  node_chain_service["Blockchain service<br/>[blockchain.ts]"]
end

subgraph group_state["Application state"]
  node_app_context["Certificate cache<br/>[AppContext.tsx]"]
  node_local_storage[("Browser local storage")]
end

node_admin(("Administrator"))
node_student(("Student"))
node_public(("Verifier"))
node_wallet["MetaMask wallet"]
node_ethereum{{"Ethereum / Ganache"}}

node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_admin_portal
node_app -->|"routes to"| node_student_portal
node_app -->|"routes to"| node_verify
node_admin -->|"uses"| node_admin_portal
node_student -->|"uses"| node_student_portal
node_public -->|"submits certificate"| node_verify
node_home -->|"links to"| node_verify
node_admin_portal -->|"provides registration"| node_register
node_admin_portal -->|"provides issuance"| node_issue
node_admin_portal -->|"provides records"| node_records
node_admin_portal -->|"provides analytics"| node_analytics
node_issue -->|"previews certificate"| node_preview
node_chain_context -->|"calls"| node_chain_service
node_chain_service -->|"requests wallet access"| node_wallet
node_chain_service -->|"reads and writes"| node_ethereum
node_app_context -->|"reads and writes"| node_local_storage

click node_app "https://github.com/kadamyogiraj/project1/blob/main/src/App.tsx"
click node_home "https://github.com/kadamyogiraj/project1/blob/main/src/pages/Index.tsx"
click node_student_portal "https://github.com/kadamyogiraj/project1/blob/main/src/pages/StudentPortal.tsx"
click node_verify "https://github.com/kadamyogiraj/project1/blob/main/src/pages/VerifyCertificate.tsx"
click node_admin_portal "https://github.com/kadamyogiraj/project1/blob/main/src/pages/AdminPortal.tsx"
click node_register "https://github.com/kadamyogiraj/project1/blob/main/src/components/admin/RegisterStudent.tsx"
click node_issue "https://github.com/kadamyogiraj/project1/blob/main/src/components/admin/IssueCertificate.tsx"
click node_records "https://github.com/kadamyogiraj/project1/blob/main/src/components/admin/ViewAllRecords.tsx"
click node_analytics "https://github.com/kadamyogiraj/project1/blob/main/src/components/admin/AnalyticsDashboard.tsx"
click node_preview "https://github.com/kadamyogiraj/project1/blob/main/src/components/admin/CertificatePreview.tsx"
click node_chain_context "https://github.com/kadamyogiraj/project1/blob/main/src/contexts/BlockchainContext.tsx"
click node_chain_service "https://github.com/kadamyogiraj/project1/blob/main/src/lib/blockchain.ts"
click node_app_context "https://github.com/kadamyogiraj/project1/blob/main/src/contexts/AppContext.tsx"

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_student_portal,node_verify toneBlue
class node_admin_portal,node_register,node_issue,node_records,node_analytics,node_preview toneAmber
class node_chain_context,node_chain_service toneMint
class node_app_context,node_local_storage toneRose
class node_admin,node_student,node_public,node_wallet,node_ethereum toneIndigo
```

## Components

### Portals and verification

- [App router](https://github.com/kadamyogiraj/project1/blob/main/src/App.tsx): `src/App.tsx`
- [Home page](https://github.com/kadamyogiraj/project1/blob/main/src/pages/Index.tsx): `src/pages/Index.tsx`
- [Student portal](https://github.com/kadamyogiraj/project1/blob/main/src/pages/StudentPortal.tsx): `src/pages/StudentPortal.tsx`
- [Certificate verification](https://github.com/kadamyogiraj/project1/blob/main/src/pages/VerifyCertificate.tsx): `src/pages/VerifyCertificate.tsx`

### Administration and issuance

- [Admin portal](https://github.com/kadamyogiraj/project1/blob/main/src/pages/AdminPortal.tsx): `src/pages/AdminPortal.tsx`
- [Register students](https://github.com/kadamyogiraj/project1/blob/main/src/components/admin/RegisterStudent.tsx): `src/components/admin/RegisterStudent.tsx`
- [Issue certificates](https://github.com/kadamyogiraj/project1/blob/main/src/components/admin/IssueCertificate.tsx): `src/components/admin/IssueCertificate.tsx`
- [View records](https://github.com/kadamyogiraj/project1/blob/main/src/components/admin/ViewAllRecords.tsx): `src/components/admin/ViewAllRecords.tsx`
- [Analytics dashboard](https://github.com/kadamyogiraj/project1/blob/main/src/components/admin/AnalyticsDashboard.tsx): `src/components/admin/AnalyticsDashboard.tsx`
- [Certificate preview](https://github.com/kadamyogiraj/project1/blob/main/src/components/admin/CertificatePreview.tsx): `src/components/admin/CertificatePreview.tsx`

### Blockchain integration

- [Wallet and contract context](https://github.com/kadamyogiraj/project1/blob/main/src/contexts/BlockchainContext.tsx): `src/contexts/BlockchainContext.tsx`
- [Blockchain service](https://github.com/kadamyogiraj/project1/blob/main/src/lib/blockchain.ts): `src/lib/blockchain.ts`

### Application state

- [Certificate cache](https://github.com/kadamyogiraj/project1/blob/main/src/contexts/AppContext.tsx): `src/contexts/AppContext.tsx`
- **Browser local storage**

### Other components

- **Administrator**
- **Student**
- **Verifier**
- **MetaMask wallet**
- **Ethereum / Ganache**

## Connections

- App router → Home page: routes to
- App router → Admin portal: routes to
- App router → Student portal: routes to
- App router → Certificate verification: routes to
- Administrator → Admin portal: uses
- Student → Student portal: uses
- Verifier → Certificate verification: submits certificate
- Home page → Certificate verification: links to
- Admin portal → Register students: provides registration
- Admin portal → Issue certificates: provides issuance
- Admin portal → View records: provides records
- Admin portal → Analytics dashboard: provides analytics
- Issue certificates → Certificate preview: previews certificate
- Wallet and contract context → Blockchain service: calls
- Blockchain service → MetaMask wallet: requests wallet access
- Blockchain service → Ethereum / Ganache: reads and writes
- Certificate cache → Browser local storage: reads and writes
