# dangerrohit84/certihub architecture

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

- Interactive diagram: https://gitdiagram.com/dangerrohit84/certihub
- Repository: https://github.com/dangerrohit84/certihub

## Overview

CertiHub turns uploaded credentials into verified, searchable career assets. The primary flow is certificate upload, asset storage and AI/OCR extraction, then credential persistence for portfolios and institutional analytics. The repository also has career guidance, sharing and role-based institution, HOD, mentor, and organization workflows. The graph combines documented product capabilities with relationships visible in sampled source and the SOURCE INDEX; unsampled page behavior and some frontend-to-backend calls are not asserted.

Main entry points: [`server/routes/api.js`](https://github.com/dangerrohit84/certihub/blob/main/server/routes/api.js) (API routes), [`server/controllers/certController.js`](https://github.com/dangerrohit84/certihub/blob/main/server/controllers/certController.js) (Credential analysis), [`server/controllers/institutionController.js`](https://github.com/dangerrohit84/certihub/blob/main/server/controllers/institutionController.js) (Institution issuance), [`server/controllers/organizationController.js`](https://github.com/dangerrohit84/certihub/blob/main/server/controllers/organizationController.js) (Smart batch issuance)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_webapp["Web application<br/>[App.jsx]"]
  node_credential_ui["Credential workspace<br/>[Dashboard.jsx]"]
  node_portfolio["Public portfolio<br/>[Portfolio.jsx]"]
  node_career_ui["Career advisor<br/>[CareerAdvisor.jsx]"]
  node_verify_ui["Credential verification<br/>[Verify.jsx]"]
end

subgraph group_credential["Credential processing"]
  node_cert["Credential analysis<br/>[certController.js]"]
  node_ai["AI extraction<br/>[aiService.js]"]
  node_asset_storage[("Certificate assets<br/>[cloudinary.js]")]
end

subgraph group_governance["Institutional workflows"]
  node_institution["Institution issuance"]
  node_organization["Smart batch issuance"]
  node_hod["HOD management<br/>[hodController.js]"]
  node_mentor["Mentor verification"]
  node_admin["Platform analytics<br/>[adminController.js]"]
end

subgraph group_intelligence["Career intelligence"]
  node_career["Career services"]
end

subgraph group_platform["Platform services"]
  node_firebase_client["Firebase client<br/>[firebase.js]"]
  node_api["API routes<br/>[api.js]"]
  node_auth["Token and role auth<br/>[auth.js]"]
  node_credential_store[("Credential records")]
end

node_professional(("Professional"))
node_groq{{"Groq AI"}}
node_cloudinary{{"Cloudinary"}}
node_firebase[("Firebase Auth and Firestore")]

node_professional -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_credential_ui
node_professional -->|"uploads certificate"| node_credential_ui
node_credential_ui -->|"uses"| node_firebase_client
node_webapp -.->|"requests services"| node_api
node_api -->|"protects routes"| node_auth
node_api -->|"routes analysis"| node_cert
node_api -->|"routes career requests"| node_career
node_api -->|"routes issuance"| node_institution
node_api -->|"routes batch issuance"| node_organization
node_api -->|"routes HOD requests"| node_hod
node_api -->|"routes mentor requests"| node_mentor
node_api -->|"routes analytics"| node_admin
node_cert -->|"analyzes document"| node_ai
node_ai -->|"requests inference"| node_groq
node_cert -->|"uploads and deletes"| node_asset_storage
node_cert -->|"persists credentials"| node_credential_store
node_institution -->|"processes documents"| node_cert
node_institution -->|"uploads assets"| node_asset_storage
node_institution -->|"writes issuance records"| node_credential_store
node_organization -->|"processes documents"| node_cert
node_organization -->|"uploads assets"| node_asset_storage
node_organization -->|"writes issuance records"| node_credential_store
node_hod -->|"creates and links users"| node_firebase
node_mentor -.->|"reads and verifies records"| node_firebase
node_admin -->|"reads analytics data"| node_firebase
node_career -->|"requests advice and chat"| node_groq
node_career -->|"reads shared credential"| node_firebase
node_career_ui -.->|"requests guidance"| node_career
node_credential_ui -.->|"publishes credentials"| node_portfolio
node_professional -->|"checks credential"| node_verify_ui
node_firebase_client -->|"authenticates and accesses data"| node_firebase

click node_webapp "https://github.com/dangerrohit84/certihub/blob/main/frontend/src/App.jsx"
click node_credential_ui "https://github.com/dangerrohit84/certihub/blob/main/frontend/src/pages/Dashboard.jsx"
click node_portfolio "https://github.com/dangerrohit84/certihub/blob/main/frontend/src/pages/Portfolio.jsx"
click node_career_ui "https://github.com/dangerrohit84/certihub/blob/main/frontend/src/pages/CareerAdvisor.jsx"
click node_verify_ui "https://github.com/dangerrohit84/certihub/blob/main/frontend/src/pages/Verify.jsx"
click node_firebase_client "https://github.com/dangerrohit84/certihub/blob/main/frontend/src/firebase/firebase.js"
click node_api "https://github.com/dangerrohit84/certihub/blob/main/server/routes/api.js"
click node_auth "https://github.com/dangerrohit84/certihub/blob/main/server/middleware/auth.js"
click node_cert "https://github.com/dangerrohit84/certihub/blob/main/server/controllers/certController.js"
click node_ai "https://github.com/dangerrohit84/certihub/blob/main/server/utils/aiService.js"
click node_asset_storage "https://github.com/dangerrohit84/certihub/blob/main/server/utils/cloudinary.js"
click node_institution "https://github.com/dangerrohit84/certihub/blob/main/server/controllers/institutionController.js"
click node_organization "https://github.com/dangerrohit84/certihub/blob/main/server/controllers/organizationController.js"
click node_hod "https://github.com/dangerrohit84/certihub/blob/main/server/controllers/hodController.js"
click node_mentor "https://github.com/dangerrohit84/certihub/blob/main/server/controllers/mentorController.js"
click node_admin "https://github.com/dangerrohit84/certihub/blob/main/server/controllers/adminController.js"
click node_career "https://github.com/dangerrohit84/certihub/blob/main/server/controllers/careerController.js"

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_webapp,node_credential_ui,node_portfolio,node_career_ui,node_verify_ui toneBlue
class node_cert,node_ai,node_asset_storage,node_firebase toneAmber
class node_institution,node_organization,node_hod,node_mentor,node_admin toneMint
class node_career toneRose
class node_firebase_client,node_api,node_auth,node_credential_store,node_professional,node_groq,node_cloudinary toneIndigo
```

## Components

### User experience

- [Web application](https://github.com/dangerrohit84/certihub/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Credential workspace](https://github.com/dangerrohit84/certihub/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Public portfolio](https://github.com/dangerrohit84/certihub/blob/main/frontend/src/pages/Portfolio.jsx): `frontend/src/pages/Portfolio.jsx`
- [Career advisor](https://github.com/dangerrohit84/certihub/blob/main/frontend/src/pages/CareerAdvisor.jsx): `frontend/src/pages/CareerAdvisor.jsx`
- [Credential verification](https://github.com/dangerrohit84/certihub/blob/main/frontend/src/pages/Verify.jsx): `frontend/src/pages/Verify.jsx`

### Credential processing

- [Credential analysis](https://github.com/dangerrohit84/certihub/blob/main/server/controllers/certController.js): `server/controllers/certController.js`
- [AI extraction](https://github.com/dangerrohit84/certihub/blob/main/server/utils/aiService.js): `server/utils/aiService.js`
- [Certificate assets](https://github.com/dangerrohit84/certihub/blob/main/server/utils/cloudinary.js): `server/utils/cloudinary.js`

### Institutional workflows

- [Institution issuance](https://github.com/dangerrohit84/certihub/blob/main/server/controllers/institutionController.js): `server/controllers/institutionController.js`
- [Smart batch issuance](https://github.com/dangerrohit84/certihub/blob/main/server/controllers/organizationController.js): `server/controllers/organizationController.js`
- [HOD management](https://github.com/dangerrohit84/certihub/blob/main/server/controllers/hodController.js): `server/controllers/hodController.js`
- [Mentor verification](https://github.com/dangerrohit84/certihub/blob/main/server/controllers/mentorController.js): `server/controllers/mentorController.js`
- [Platform analytics](https://github.com/dangerrohit84/certihub/blob/main/server/controllers/adminController.js): `server/controllers/adminController.js`

### Career intelligence

- [Career services](https://github.com/dangerrohit84/certihub/blob/main/server/controllers/careerController.js): `server/controllers/careerController.js`

### Platform services

- [Firebase client](https://github.com/dangerrohit84/certihub/blob/main/frontend/src/firebase/firebase.js): `frontend/src/firebase/firebase.js`
- [API routes](https://github.com/dangerrohit84/certihub/blob/main/server/routes/api.js): `server/routes/api.js`
- [Token and role auth](https://github.com/dangerrohit84/certihub/blob/main/server/middleware/auth.js): `server/middleware/auth.js`
- **Credential records**

### Other components

- **Professional**
- **Groq AI**
- **Cloudinary**
- **Firebase Auth and Firestore**

## Connections

- Professional → Web application: uses (evidence: `README.md`)
- Web application → Credential workspace: routes to (evidence: `README.md`)
- Professional → Credential workspace: uploads certificate (evidence: `README.md`)
- Credential workspace → Firebase client: uses (evidence: `frontend/src/pages/Dashboard.jsx`)
- Web application → API routes: requests services
- API routes → Token and role auth: protects routes (evidence: `server/routes/api.js`)
- API routes → Credential analysis: routes analysis (evidence: `server/routes/api.js`)
- API routes → Career services: routes career requests (evidence: `server/routes/api.js`)
- API routes → Institution issuance: routes issuance (evidence: `server/routes/api.js`)
- API routes → Smart batch issuance: routes batch issuance (evidence: `server/routes/api.js`)
- API routes → HOD management: routes HOD requests (evidence: `server/routes/api.js`)
- API routes → Mentor verification: routes mentor requests (evidence: `server/routes/api.js`)
- API routes → Platform analytics: routes analytics (evidence: `server/routes/api.js`)
- Credential analysis → AI extraction: analyzes document (evidence: `server/controllers/certController.js`)
- AI extraction → Groq AI: requests inference (evidence: `server/utils/aiService.js`)
- Credential analysis → Certificate assets: uploads and deletes (evidence: `server/controllers/certController.js`)
- Credential analysis → Credential records: persists credentials (evidence: `README.md`)
- Institution issuance → Credential analysis: processes documents (evidence: `server/controllers/institutionController.js`)
- Institution issuance → Certificate assets: uploads assets (evidence: `server/controllers/institutionController.js`)
- Institution issuance → Credential records: writes issuance records (evidence: `server/controllers/institutionController.js`)
- Smart batch issuance → Credential analysis: processes documents (evidence: `server/controllers/organizationController.js`)
- Smart batch issuance → Certificate assets: uploads assets (evidence: `server/controllers/organizationController.js`)
- Smart batch issuance → Credential records: writes issuance records (evidence: `server/controllers/organizationController.js`)
- HOD management → Firebase Auth and Firestore: creates and links users (evidence: `server/controllers/hodController.js`)
- Mentor verification → Firebase Auth and Firestore: reads and verifies records
- Platform analytics → Firebase Auth and Firestore: reads analytics data (evidence: `server/controllers/adminController.js`)
- Career services → Groq AI: requests advice and chat (evidence: `server/controllers/careerController.js`)
- Career services → Firebase Auth and Firestore: reads shared credential (evidence: `server/controllers/careerController.js`)
- Career advisor → Career services: requests guidance
- Credential workspace → Public portfolio: publishes credentials
- Professional → Credential verification: checks credential (evidence: `README.md`)
- Firebase client → Firebase Auth and Firestore: authenticates and accesses data (evidence: `frontend/src/firebase/firebase.js`)
