# jhnbndxt/electron-hub architecture

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

- Interactive diagram: https://gitdiagram.com/jhnbndxt/electron-hub
- Repository: https://github.com/jhnbndxt/electron-hub

## Overview

This is a student enrollment and school-administration portal, with student assessment and elective recommendations alongside application review, records, and payment administration. The principal workflow shown is a student submitting an enrollment application, which the enrollment service validates and persists through Supabase; administrators review applications through a separate service. Assessment scoring and the server-side AI/chat capabilities form additional product branches. The README is empty, and several page implementations were not sampled, so those capabilities and relationships are included only where the source index or excerpts support them.

Main entry points: [`src/supabase.js`](https://github.com/jhnbndxt/electron-hub/blob/main/src/supabase.js) (Supabase client), [`src/services/assessmentScoringService.js`](https://github.com/jhnbndxt/electron-hub/blob/main/src/services/assessmentScoringService.js) (Assessment scoring), [`api/assessment-ai.js`](https://github.com/jhnbndxt/electron-hub/blob/main/api/assessment-ai.js) (Assessment AI), [`server.js`](https://github.com/jhnbndxt/electron-hub/blob/main/server.js) (API server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Portal experience"]
  node_app["App routing<br/>[App.tsx]"]
  node_auth["Auth context<br/>[AuthContext.tsx]"]
end

subgraph group_enrollment["Enrollment operations"]
  node_enrollment_form["Enrollment form<br/>[EnrollmentForm.tsx]"]
  node_application_review["Application review"]
  node_enrollment_service["Enrollment service"]
  node_admin_service["Admin service<br/>[adminService.js]"]
  node_document_validation["Document validation"]
end

subgraph group_assessment["Assessment and guidance"]
  node_assessment_scoring["Assessment scoring"]
  node_electives["Elective catalog<br/>[electives.js]"]
  node_weight_profiles["Weight profiles"]
  node_recommendation_scoring["Recommendation scoring"]
  node_prerequisites["Elective prerequisites"]
end

subgraph group_backend["Backend services"]
  node_assessment_ai["Assessment AI<br/>[assessment-ai.js]"]
  node_chat_route["Chatbot route<br/>[chatbot.js]"]
  node_chat_knowledge["Chatbot knowledge"]
  node_ai_models["AI models<br/>[ai-models.js]"]
  node_server["API server<br/>[server.js]"]
  node_notifications["Notification service"]
  node_supabase_client["Supabase client<br/>[supabase.js]"]
end

node_student(("Student"))
node_staff(("School staff"))
node_supabase[("Supabase")]

node_student -->|"uses portal"| node_app
node_staff -->|"uses portal"| node_app
node_app -->|"provides auth"| node_auth
node_enrollment_form -->|"submits enrollment"| node_enrollment_service
node_enrollment_form -->|"uses validation"| node_document_validation
node_enrollment_service -->|"validates files"| node_document_validation
node_enrollment_service -->|"reads and writes"| node_supabase_client
node_auth -->|"uses client"| node_supabase_client
node_application_review -->|"reviews applications"| node_admin_service
node_admin_service -->|"reads and writes"| node_supabase_client
node_admin_service -->|"triggers notifications"| node_notifications
node_notifications -->|"stores notifications"| node_supabase_client
node_supabase_client -->|"connects to"| node_supabase
node_assessment_scoring -->|"uses client"| node_supabase_client
node_assessment_scoring -->|"scores electives"| node_electives
node_assessment_scoring -->|"uses profiles"| node_weight_profiles
node_assessment_scoring -->|"checks prerequisites"| node_prerequisites
node_assessment_scoring -->|"delegates scoring"| node_recommendation_scoring
node_recommendation_scoring -->|"loads profiles"| node_weight_profiles
node_server -->|"registers route"| node_chat_route
node_server -->|"routes requests"| node_assessment_ai
node_server -->|"uses models"| node_ai_models
node_chat_route -->|"uses knowledge"| node_chat_knowledge
node_chat_route -->|"uses models"| node_ai_models
node_assessment_ai -->|"uses catalog"| node_electives
node_assessment_ai -->|"checks prerequisites"| node_prerequisites
node_assessment_ai -->|"uses scoring"| node_recommendation_scoring
node_assessment_ai -->|"uses models"| node_ai_models

click node_app "https://github.com/jhnbndxt/electron-hub/blob/main/src/app/App.tsx"
click node_auth "https://github.com/jhnbndxt/electron-hub/blob/main/src/app/context/AuthContext.tsx"
click node_enrollment_form "https://github.com/jhnbndxt/electron-hub/blob/main/src/app/pages/EnrollmentForm.tsx"
click node_application_review "https://github.com/jhnbndxt/electron-hub/blob/main/src/app/pages/admin/ApplicationReviewPage.tsx"
click node_enrollment_service "https://github.com/jhnbndxt/electron-hub/blob/main/src/services/enrollmentService.js"
click node_admin_service "https://github.com/jhnbndxt/electron-hub/blob/main/src/services/adminService.js"
click node_document_validation "https://github.com/jhnbndxt/electron-hub/blob/main/src/utils/documentValidation.ts"
click node_assessment_scoring "https://github.com/jhnbndxt/electron-hub/blob/main/src/services/assessmentScoringService.js"
click node_electives "https://github.com/jhnbndxt/electron-hub/blob/main/src/data/electives.js"
click node_weight_profiles "https://github.com/jhnbndxt/electron-hub/blob/main/src/data/electiveWeightProfiles.js"
click node_recommendation_scoring "https://github.com/jhnbndxt/electron-hub/blob/main/src/utils/electiveRecommendationScoring.js"
click node_prerequisites "https://github.com/jhnbndxt/electron-hub/blob/main/src/utils/electivePrerequisites.js"
click node_assessment_ai "https://github.com/jhnbndxt/electron-hub/blob/main/api/assessment-ai.js"
click node_chat_route "https://github.com/jhnbndxt/electron-hub/blob/main/server/routes/chatbot.js"
click node_chat_knowledge "https://github.com/jhnbndxt/electron-hub/blob/main/src/data/chatbotKnowledge.js"
click node_ai_models "https://github.com/jhnbndxt/electron-hub/blob/main/api/ai-models.js"
click node_server "https://github.com/jhnbndxt/electron-hub/blob/main/server.js"
click node_notifications "https://github.com/jhnbndxt/electron-hub/blob/main/src/services/notificationService.js"
click node_supabase_client "https://github.com/jhnbndxt/electron-hub/blob/main/src/supabase.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_app,node_auth toneBlue
class node_enrollment_form,node_application_review,node_enrollment_service,node_admin_service,node_document_validation,node_supabase toneAmber
class node_assessment_scoring,node_electives,node_weight_profiles,node_recommendation_scoring,node_prerequisites toneMint
class node_assessment_ai,node_chat_route,node_chat_knowledge,node_ai_models,node_server,node_notifications,node_supabase_client toneRose
class node_student,node_staff toneIndigo
```

## Components

### Portal experience

- [App routing](https://github.com/jhnbndxt/electron-hub/blob/main/src/app/App.tsx): `src/app/App.tsx`
- [Auth context](https://github.com/jhnbndxt/electron-hub/blob/main/src/app/context/AuthContext.tsx): `src/app/context/AuthContext.tsx`

### Enrollment operations

- [Enrollment form](https://github.com/jhnbndxt/electron-hub/blob/main/src/app/pages/EnrollmentForm.tsx): `src/app/pages/EnrollmentForm.tsx`
- [Application review](https://github.com/jhnbndxt/electron-hub/blob/main/src/app/pages/admin/ApplicationReviewPage.tsx): `src/app/pages/admin/ApplicationReviewPage.tsx`
- [Enrollment service](https://github.com/jhnbndxt/electron-hub/blob/main/src/services/enrollmentService.js): `src/services/enrollmentService.js`
- [Admin service](https://github.com/jhnbndxt/electron-hub/blob/main/src/services/adminService.js): `src/services/adminService.js`
- [Document validation](https://github.com/jhnbndxt/electron-hub/blob/main/src/utils/documentValidation.ts): `src/utils/documentValidation.ts`

### Assessment and guidance

- [Assessment scoring](https://github.com/jhnbndxt/electron-hub/blob/main/src/services/assessmentScoringService.js): `src/services/assessmentScoringService.js`
- [Elective catalog](https://github.com/jhnbndxt/electron-hub/blob/main/src/data/electives.js): `src/data/electives.js`
- [Weight profiles](https://github.com/jhnbndxt/electron-hub/blob/main/src/data/electiveWeightProfiles.js): `src/data/electiveWeightProfiles.js`
- [Recommendation scoring](https://github.com/jhnbndxt/electron-hub/blob/main/src/utils/electiveRecommendationScoring.js): `src/utils/electiveRecommendationScoring.js`
- [Elective prerequisites](https://github.com/jhnbndxt/electron-hub/blob/main/src/utils/electivePrerequisites.js): `src/utils/electivePrerequisites.js`

### Backend services

- [Assessment AI](https://github.com/jhnbndxt/electron-hub/blob/main/api/assessment-ai.js): `api/assessment-ai.js`
- [Chatbot route](https://github.com/jhnbndxt/electron-hub/blob/main/server/routes/chatbot.js): `server/routes/chatbot.js`
- [Chatbot knowledge](https://github.com/jhnbndxt/electron-hub/blob/main/src/data/chatbotKnowledge.js): `src/data/chatbotKnowledge.js`
- [AI models](https://github.com/jhnbndxt/electron-hub/blob/main/api/ai-models.js): `api/ai-models.js`
- [API server](https://github.com/jhnbndxt/electron-hub/blob/main/server.js): `server.js`
- [Notification service](https://github.com/jhnbndxt/electron-hub/blob/main/src/services/notificationService.js): `src/services/notificationService.js`
- [Supabase client](https://github.com/jhnbndxt/electron-hub/blob/main/src/supabase.js): `src/supabase.js`

### Other components

- **Student**
- **School staff**
- **Supabase**

## Connections

- Student → App routing: uses portal
- School staff → App routing: uses portal
- App routing → Auth context: provides auth (evidence: `src/app/App.tsx`)
- Enrollment form → Enrollment service: submits enrollment (evidence: `src/app/pages/EnrollmentForm.tsx`)
- Enrollment form → Document validation: uses validation (evidence: `src/app/pages/EnrollmentForm.tsx`)
- Enrollment service → Document validation: validates files (evidence: `src/services/enrollmentService.js`)
- Enrollment service → Supabase client: reads and writes (evidence: `src/services/enrollmentService.js`)
- Auth context → Supabase client: uses client (evidence: `src/app/context/AuthContext.tsx`)
- Application review → Admin service: reviews applications (evidence: `src/app/pages/admin/ApplicationReviewPage.tsx`)
- Admin service → Supabase client: reads and writes (evidence: `src/services/adminService.js`)
- Admin service → Notification service: triggers notifications (evidence: `src/services/adminService.js`)
- Notification service → Supabase client: stores notifications (evidence: `src/services/notificationService.js`)
- Supabase client → Supabase: connects to (evidence: `src/supabase.js`)
- Assessment scoring → Supabase client: uses client (evidence: `src/services/assessmentScoringService.js`)
- Assessment scoring → Elective catalog: scores electives (evidence: `src/services/assessmentScoringService.js`)
- Assessment scoring → Weight profiles: uses profiles (evidence: `src/services/assessmentScoringService.js`)
- Assessment scoring → Elective prerequisites: checks prerequisites (evidence: `src/services/assessmentScoringService.js`)
- Assessment scoring → Recommendation scoring: delegates scoring (evidence: `src/services/assessmentScoringService.js`)
- Recommendation scoring → Weight profiles: loads profiles (evidence: `src/utils/electiveRecommendationScoring.js`)
- API server → Chatbot route: registers route (evidence: `server.js`)
- API server → Assessment AI: routes requests (evidence: `server.js`)
- API server → AI models: uses models (evidence: `server.js`)
- Chatbot route → Chatbot knowledge: uses knowledge (evidence: `server/routes/chatbot.js`)
- Chatbot route → AI models: uses models (evidence: `server/routes/chatbot.js`)
- Assessment AI → Elective catalog: uses catalog (evidence: `api/assessment-ai.js`)
- Assessment AI → Elective prerequisites: checks prerequisites (evidence: `api/assessment-ai.js`)
- Assessment AI → Recommendation scoring: uses scoring (evidence: `api/assessment-ai.js`)
- Assessment AI → AI models: uses models (evidence: `api/assessment-ai.js`)
