# aadhyarao04/internhub architecture

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

- Interactive diagram: https://gitdiagram.com/aadhyarao04/internhub
- Repository: https://github.com/aadhyarao04/internhub

## Overview

InternHub is a role-based internship and career platform: students discover opportunities, apply, and use career-preparation tools; companies publish internships and manage applicants; administrators oversee platform activity. The client routes these experiences through an API service to a server organized around feature routes, controllers, and domain services. AI capabilities include career guidance, knowledge-grounded answers, recommendations, interview simulation, and roadmaps. The graph reflects sampled imports and calls; unsampled features are represented by their existing directories, and the client-to-server HTTP relationship is shown as unverified.

Main entry points: [`client/src/services/api.js`](https://github.com/aadhyarao04/internhub/blob/main/client/src/services/api.js) (HTTP client), [`client/src/App.jsx`](https://github.com/aadhyarao04/internhub/blob/main/client/src/App.jsx) (Role-based routes), [`server/src/app.js`](https://github.com/aadhyarao04/internhub/blob/main/server/src/app.js) (API application), [`server/src/ai/rag/ragService.js`](https://github.com/aadhyarao04/internhub/blob/main/server/src/ai/rag/ragService.js) (Knowledge-grounded answers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_routing["Role-based routes<br/>[App.jsx]"]
  node_auth_ui["Sign-in and session<br/>[AuthContext.jsx]"]
  node_student_ui["Student workspace"]
  node_company_ui["Company workspace"]
  node_public_ui["Opportunity discovery"]
  node_admin_ui["Administration"]
  node_api_client["HTTP client<br/>[api.js]"]
end

subgraph group_api["API layer"]
  node_server_app["API application<br/>[app.js]"]
  node_student_routes["Student endpoints<br/>[student.routes.js]"]
  node_company_routes["Company endpoints<br/>[company.routes.js]"]
  node_feature_routes["Other feature endpoints"]
end

subgraph group_domain["Marketplace operations"]
  node_application_controller["Application handlers"]
  node_application_service["Application lifecycle"]
  node_market_services["Marketplace services"]
end

subgraph group_career["Career intelligence"]
  node_ai_controller["AI request handlers<br/>[ai.controller.js]"]
  node_career_tools["Career AI capabilities"]
  node_recommendations["Internship matching"]
  node_rag["Knowledge-grounded answers<br/>[ragService.js]"]
  node_embeddings["Embedding generation"]
end

subgraph group_data["Persistence and services"]
  node_mongo[("MongoDB models")]
  node_notifications["Notification service"]
  node_knowledge_docs[("Knowledge documents")]
end

node_people(("Students, companies, admins"))
node_gemini["Google embedding API"]

node_people -->|"use platform"| node_routing
node_routing -->|"routes to"| node_public_ui
node_routing -->|"routes to"| node_student_ui
node_routing -->|"routes to"| node_company_ui
node_routing -->|"routes to"| node_admin_ui
node_people -->|"authenticate"| node_auth_ui
node_auth_ui -->|"calls"| node_api_client
node_student_ui -.->|"calls"| node_api_client
node_company_ui -.->|"calls"| node_api_client
node_public_ui -.->|"calls"| node_api_client
node_admin_ui -.->|"calls"| node_api_client
node_api_client -.->|"sends API requests"| node_server_app
node_server_app -->|"mounts"| node_student_routes
node_server_app -->|"mounts"| node_company_routes
node_server_app -->|"mounts"| node_feature_routes
node_student_routes -->|"dispatches applications"| node_application_controller
node_company_routes -->|"dispatches applications"| node_application_controller
node_application_controller -->|"delegates to"| node_application_service
node_application_service -->|"creates notifications"| node_notifications
node_application_service -->|"uses domain models"| node_mongo
node_student_routes -->|"dispatches profile actions"| node_market_services
node_ai_controller -->|"dispatches AI tasks"| node_career_tools
node_ai_controller -->|"requests matches"| node_recommendations
node_ai_controller -->|"requests answers"| node_rag
node_recommendations -->|"reads student and internship data"| node_mongo
node_rag -->|"reads documents"| node_knowledge_docs
node_rag -->|"generates and compares vectors"| node_embeddings
node_rag -->|"uses text generation"| node_career_tools
node_embeddings -.->|"requests embeddings"| node_gemini

click node_routing "https://github.com/aadhyarao04/internhub/blob/main/client/src/App.jsx"
click node_auth_ui "https://github.com/aadhyarao04/internhub/blob/main/client/src/context/AuthContext.jsx"
click node_student_ui "https://github.com/aadhyarao04/internhub/tree/main/client/src/pages/student"
click node_company_ui "https://github.com/aadhyarao04/internhub/tree/main/client/src/pages/company"
click node_public_ui "https://github.com/aadhyarao04/internhub/tree/main/client/src/pages/public"
click node_admin_ui "https://github.com/aadhyarao04/internhub/tree/main/client/src/pages/admin"
click node_api_client "https://github.com/aadhyarao04/internhub/blob/main/client/src/services/api.js"
click node_server_app "https://github.com/aadhyarao04/internhub/blob/main/server/src/app.js"
click node_student_routes "https://github.com/aadhyarao04/internhub/blob/main/server/src/routes/student.routes.js"
click node_company_routes "https://github.com/aadhyarao04/internhub/blob/main/server/src/routes/company.routes.js"
click node_feature_routes "https://github.com/aadhyarao04/internhub/tree/main/server/src/routes"
click node_application_controller "https://github.com/aadhyarao04/internhub/blob/main/server/src/controllers/application.controller.js"
click node_application_service "https://github.com/aadhyarao04/internhub/blob/main/server/src/services/application.service.js"
click node_market_services "https://github.com/aadhyarao04/internhub/tree/main/server/src/services"
click node_ai_controller "https://github.com/aadhyarao04/internhub/blob/main/server/src/controllers/ai.controller.js"
click node_career_tools "https://github.com/aadhyarao04/internhub/tree/main/server/src/ai"
click node_recommendations "https://github.com/aadhyarao04/internhub/blob/main/server/src/ai/services/recommendationEngine.js"
click node_rag "https://github.com/aadhyarao04/internhub/blob/main/server/src/ai/rag/ragService.js"
click node_embeddings "https://github.com/aadhyarao04/internhub/blob/main/server/src/ai/embeddings/embeddingService.js"
click node_mongo "https://github.com/aadhyarao04/internhub/tree/main/server/src/models"
click node_notifications "https://github.com/aadhyarao04/internhub/blob/main/server/src/services/notification.service.js"
click node_knowledge_docs "https://github.com/aadhyarao04/internhub/blob/main/server/src/models/KnowledgeDocument.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_routing,node_auth_ui,node_student_ui,node_company_ui,node_public_ui,node_admin_ui,node_api_client toneBlue
class node_server_app,node_student_routes,node_company_routes,node_feature_routes toneAmber
class node_application_controller,node_application_service,node_market_services,node_gemini toneMint
class node_ai_controller,node_career_tools,node_recommendations,node_rag,node_embeddings toneRose
class node_mongo,node_notifications,node_knowledge_docs,node_people toneIndigo
```

## Components

### Web client

- [Role-based routes](https://github.com/aadhyarao04/internhub/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Sign-in and session](https://github.com/aadhyarao04/internhub/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [Student workspace](https://github.com/aadhyarao04/internhub/tree/main/client/src/pages/student): `client/src/pages/student`
- [Company workspace](https://github.com/aadhyarao04/internhub/tree/main/client/src/pages/company): `client/src/pages/company`
- [Opportunity discovery](https://github.com/aadhyarao04/internhub/tree/main/client/src/pages/public): `client/src/pages/public`
- [Administration](https://github.com/aadhyarao04/internhub/tree/main/client/src/pages/admin): `client/src/pages/admin`
- [HTTP client](https://github.com/aadhyarao04/internhub/blob/main/client/src/services/api.js): `client/src/services/api.js`

### API layer

- [API application](https://github.com/aadhyarao04/internhub/blob/main/server/src/app.js): `server/src/app.js`
- [Student endpoints](https://github.com/aadhyarao04/internhub/blob/main/server/src/routes/student.routes.js): `server/src/routes/student.routes.js`
- [Company endpoints](https://github.com/aadhyarao04/internhub/blob/main/server/src/routes/company.routes.js): `server/src/routes/company.routes.js`
- [Other feature endpoints](https://github.com/aadhyarao04/internhub/tree/main/server/src/routes): `server/src/routes`

### Marketplace operations

- [Application handlers](https://github.com/aadhyarao04/internhub/blob/main/server/src/controllers/application.controller.js): `server/src/controllers/application.controller.js`
- [Application lifecycle](https://github.com/aadhyarao04/internhub/blob/main/server/src/services/application.service.js): `server/src/services/application.service.js`
- [Marketplace services](https://github.com/aadhyarao04/internhub/tree/main/server/src/services): `server/src/services`

### Career intelligence

- [AI request handlers](https://github.com/aadhyarao04/internhub/blob/main/server/src/controllers/ai.controller.js): `server/src/controllers/ai.controller.js`
- [Career AI capabilities](https://github.com/aadhyarao04/internhub/tree/main/server/src/ai): `server/src/ai`
- [Internship matching](https://github.com/aadhyarao04/internhub/blob/main/server/src/ai/services/recommendationEngine.js): `server/src/ai/services/recommendationEngine.js`
- [Knowledge-grounded answers](https://github.com/aadhyarao04/internhub/blob/main/server/src/ai/rag/ragService.js): `server/src/ai/rag/ragService.js`
- [Embedding generation](https://github.com/aadhyarao04/internhub/blob/main/server/src/ai/embeddings/embeddingService.js): `server/src/ai/embeddings/embeddingService.js`

### Persistence and services

- [MongoDB models](https://github.com/aadhyarao04/internhub/tree/main/server/src/models): `server/src/models`
- [Notification service](https://github.com/aadhyarao04/internhub/blob/main/server/src/services/notification.service.js): `server/src/services/notification.service.js`
- [Knowledge documents](https://github.com/aadhyarao04/internhub/blob/main/server/src/models/KnowledgeDocument.js): `server/src/models/KnowledgeDocument.js`

### Other components

- **Students, companies, admins**
- **Google embedding API**

## Connections

- Students, companies, admins → Role-based routes: use platform
- Role-based routes → Opportunity discovery: routes to (evidence: `client/src/App.jsx`)
- Role-based routes → Student workspace: routes to (evidence: `client/src/App.jsx`)
- Role-based routes → Company workspace: routes to (evidence: `client/src/App.jsx`)
- Role-based routes → Administration: routes to (evidence: `client/src/App.jsx`)
- Students, companies, admins → Sign-in and session: authenticate
- Sign-in and session → HTTP client: calls (evidence: `client/src/context/AuthContext.jsx`)
- Student workspace → HTTP client: calls
- Company workspace → HTTP client: calls
- Opportunity discovery → HTTP client: calls
- Administration → HTTP client: calls
- HTTP client → API application: sends API requests
- API application → Student endpoints: mounts (evidence: `server/src/app.js`)
- API application → Company endpoints: mounts (evidence: `server/src/app.js`)
- API application → Other feature endpoints: mounts (evidence: `server/src/app.js`)
- Student endpoints → Application handlers: dispatches applications (evidence: `server/src/routes/student.routes.js`)
- Company endpoints → Application handlers: dispatches applications (evidence: `server/src/routes/company.routes.js`)
- Application handlers → Application lifecycle: delegates to (evidence: `server/src/controllers/application.controller.js`)
- Application lifecycle → Notification service: creates notifications (evidence: `server/src/services/application.service.js`)
- Application lifecycle → MongoDB models: uses domain models (evidence: `server/src/services/application.service.js`)
- Student endpoints → Marketplace services: dispatches profile actions (evidence: `server/src/routes/student.routes.js`)
- AI request handlers → Career AI capabilities: dispatches AI tasks (evidence: `server/src/controllers/ai.controller.js`)
- AI request handlers → Internship matching: requests matches (evidence: `server/src/controllers/ai.controller.js`)
- AI request handlers → Knowledge-grounded answers: requests answers (evidence: `server/src/controllers/ai.controller.js`)
- Internship matching → MongoDB models: reads student and internship data (evidence: `server/src/ai/services/recommendationEngine.js`)
- Knowledge-grounded answers → Knowledge documents: reads documents (evidence: `server/src/ai/rag/ragService.js`)
- Knowledge-grounded answers → Embedding generation: generates and compares vectors (evidence: `server/src/ai/rag/ragService.js`)
- Knowledge-grounded answers → Career AI capabilities: uses text generation (evidence: `server/src/ai/rag/ragService.js`)
- Embedding generation → Google embedding API: requests embeddings (evidence: `server/src/ai/embeddings/embeddingService.js`)
