# ganesh-4731/hackxlerate architecture

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

- Interactive diagram: https://gitdiagram.com/ganesh-4731/hackxlerate
- Repository: https://github.com/ganesh-4731/hackxlerate

## Overview

Campus Portal is a role-based academic-progress system. Students review academic records, engagement, risk and placement readiness, and can request faculty help; faculty monitor students and respond; administrators review institution-wide analytics and manage users, settings and segments. The React workspaces call a FastAPI API, which exposes role-specific routers over PostgreSQL-backed models and analytics services. The graph preserves README capabilities even where their implementation was not sampled; links involving unsampled router internals are omitted or marked unverified.

Main entry points: [`backend/app/main.py`](https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/main.py) (FastAPI application), [`backend/app/services/student_data.py`](https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/services/student_data.py) (Student data queries), [`frontend/src/api/client.ts`](https://github.com/ganesh-4731/hackxlerate/blob/main/frontend/src/api/client.ts) (API client), [`frontend/src/App.tsx`](https://github.com/ganesh-4731/hackxlerate/blob/main/frontend/src/App.tsx) (Role workspaces)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web portal"]
  node_app["Role workspaces<br/>[App.tsx]"]
  node_authui["Session state<br/>[AuthContext.tsx]"]
  node_http["API client<br/>[client.ts]"]
  node_ui["Shared UI<br/>[ui.tsx]"]
  node_studentui["Student workspace"]
  node_facultyui["Faculty workspace"]
  node_adminui["Admin workspace"]
  node_interventionui["Intervention plans"]
end

subgraph group_api["API and access"]
  node_apiapp["FastAPI application<br/>[main.py]"]
  node_security["Authentication and roles<br/>[security.py]"]
  node_authroutes["Login and session routes<br/>[auth.py]"]
  node_studentroutes["Student endpoints<br/>[student.py]"]
  node_facroutes["Faculty endpoints<br/>[faculty.py]"]
  node_adminroutes["Admin endpoints<br/>[admin.py]"]
  node_analyticsroutes["Analytics endpoints<br/>[analytics.py]"]
  node_supportroutes["Support endpoints<br/>[interventions.py]"]
end

subgraph group_academic["Academic records"]
  node_studentdata["Student data queries<br/>[student_data.py]"]
  node_results["GPA and results<br/>[results.py]"]
end

subgraph group_insights["Analytics and support"]
  node_risk["Academic risk rules<br/>[academic_risk.py]"]
  node_readiness["Placement readiness"]
  node_placementrisk["Placement risk<br/>[placement_risk.py]"]
  node_success["Success score<br/>[success_score.py]"]
  node_chat["Chat assistant<br/>[chat_assistant.py]"]
end

subgraph group_data["Persistence"]
  node_academicmodels["Academic records<br/>[academic.py]"]
  node_othermodels["Engagement and identity"]
  node_database[("Relational database<br/>[db.py]")]
end

node_actors(("Portal users"))

node_actors -->|"use workspaces"| node_app
node_app -->|"routes students"| node_studentui
node_app -->|"routes faculty"| node_facultyui
node_app -->|"routes admins"| node_adminui
node_app -.->|"provides session"| node_authui
node_authui -->|"requests auth"| node_http
node_studentui -.->|"requests data"| node_http
node_facultyui -.->|"requests data"| node_http
node_adminui -.->|"requests data"| node_http
node_interventionui -->|"updates plans"| node_http
node_studentui -->|"renders components"| node_ui
node_http -.->|"calls API"| node_apiapp
node_apiapp -->|"registers routes"| node_authroutes
node_apiapp -->|"registers routes"| node_studentroutes
node_apiapp -->|"registers routes"| node_facroutes
node_apiapp -->|"registers routes"| node_adminroutes
node_apiapp -->|"registers routes"| node_analyticsroutes
node_apiapp -->|"registers routes"| node_supportroutes
node_authroutes -->|"uses security"| node_security
node_facroutes -->|"queries student data"| node_studentdata
node_facroutes -->|"uses results"| node_results
node_studentdata -->|"queries records"| node_academicmodels
node_results -.->|"builds results"| node_academicmodels
node_risk -->|"uses student data"| node_studentdata
node_risk -->|"reads domain records"| node_othermodels
node_readiness -->|"reads student records"| node_othermodels
node_placementrisk -->|"uses readiness"| node_readiness
node_placementrisk -->|"uses student data"| node_studentdata
node_success -->|"uses student data"| node_studentdata
node_chat -->|"uses risk rules"| node_risk
node_chat -->|"uses readiness"| node_readiness
node_chat -->|"uses placement risk"| node_placementrisk
node_chat -->|"uses success score"| node_success
node_studentdata -.->|"reads records"| node_database
node_academicmodels -->|"maps tables"| node_database
node_othermodels -.->|"maps tables"| node_database

click node_app "https://github.com/ganesh-4731/hackxlerate/blob/main/frontend/src/App.tsx"
click node_authui "https://github.com/ganesh-4731/hackxlerate/blob/main/frontend/src/auth/AuthContext.tsx"
click node_http "https://github.com/ganesh-4731/hackxlerate/blob/main/frontend/src/api/client.ts"
click node_ui "https://github.com/ganesh-4731/hackxlerate/blob/main/frontend/src/components/ui.tsx"
click node_studentui "https://github.com/ganesh-4731/hackxlerate/tree/main/frontend/src/pages/student"
click node_facultyui "https://github.com/ganesh-4731/hackxlerate/tree/main/frontend/src/pages/faculty"
click node_adminui "https://github.com/ganesh-4731/hackxlerate/tree/main/frontend/src/pages/admin"
click node_interventionui "https://github.com/ganesh-4731/hackxlerate/blob/main/frontend/src/components/InterventionsManager.tsx"
click node_apiapp "https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/main.py"
click node_security "https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/core/security.py"
click node_authroutes "https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/routers/auth.py"
click node_studentroutes "https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/routers/student.py"
click node_facroutes "https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/routers/faculty.py"
click node_adminroutes "https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/routers/admin.py"
click node_analyticsroutes "https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/routers/analytics.py"
click node_supportroutes "https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/routers/interventions.py"
click node_studentdata "https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/services/student_data.py"
click node_results "https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/services/results.py"
click node_academicmodels "https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/models/academic.py"
click node_othermodels "https://github.com/ganesh-4731/hackxlerate/tree/main/backend/app/models"
click node_risk "https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/services/academic_risk.py"
click node_readiness "https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/services/placement_readiness.py"
click node_placementrisk "https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/services/placement_risk.py"
click node_success "https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/services/success_score.py"
click node_chat "https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/services/chat_assistant.py"
click node_database "https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/db.py"

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_authui,node_http,node_ui,node_studentui,node_facultyui,node_adminui,node_interventionui,node_actors toneBlue
class node_apiapp,node_security,node_authroutes,node_studentroutes,node_facroutes,node_adminroutes,node_analyticsroutes,node_supportroutes toneAmber
class node_studentdata,node_results toneMint
class node_risk,node_readiness,node_placementrisk,node_success,node_chat toneRose
class node_academicmodels,node_othermodels,node_database toneIndigo
```

## Components

### Web portal

- [Role workspaces](https://github.com/ganesh-4731/hackxlerate/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Session state](https://github.com/ganesh-4731/hackxlerate/blob/main/frontend/src/auth/AuthContext.tsx): `frontend/src/auth/AuthContext.tsx`
- [API client](https://github.com/ganesh-4731/hackxlerate/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Shared UI](https://github.com/ganesh-4731/hackxlerate/blob/main/frontend/src/components/ui.tsx): `frontend/src/components/ui.tsx`
- [Student workspace](https://github.com/ganesh-4731/hackxlerate/tree/main/frontend/src/pages/student): `frontend/src/pages/student`
- [Faculty workspace](https://github.com/ganesh-4731/hackxlerate/tree/main/frontend/src/pages/faculty): `frontend/src/pages/faculty`
- [Admin workspace](https://github.com/ganesh-4731/hackxlerate/tree/main/frontend/src/pages/admin): `frontend/src/pages/admin`
- [Intervention plans](https://github.com/ganesh-4731/hackxlerate/blob/main/frontend/src/components/InterventionsManager.tsx): `frontend/src/components/InterventionsManager.tsx`

### API and access

- [FastAPI application](https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication and roles](https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/core/security.py): `backend/app/core/security.py`
- [Login and session routes](https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [Student endpoints](https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/routers/student.py): `backend/app/routers/student.py`
- [Faculty endpoints](https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/routers/faculty.py): `backend/app/routers/faculty.py`
- [Admin endpoints](https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/routers/admin.py): `backend/app/routers/admin.py`
- [Analytics endpoints](https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/routers/analytics.py): `backend/app/routers/analytics.py`
- [Support endpoints](https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/routers/interventions.py): `backend/app/routers/interventions.py`

### Academic records

- [Student data queries](https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/services/student_data.py): `backend/app/services/student_data.py`
- [GPA and results](https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/services/results.py): `backend/app/services/results.py`

### Analytics and support

- [Academic risk rules](https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/services/academic_risk.py): `backend/app/services/academic_risk.py`
- [Placement readiness](https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/services/placement_readiness.py): `backend/app/services/placement_readiness.py`
- [Placement risk](https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/services/placement_risk.py): `backend/app/services/placement_risk.py`
- [Success score](https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/services/success_score.py): `backend/app/services/success_score.py`
- [Chat assistant](https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/services/chat_assistant.py): `backend/app/services/chat_assistant.py`

### Persistence

- [Academic records](https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/models/academic.py): `backend/app/models/academic.py`
- [Engagement and identity](https://github.com/ganesh-4731/hackxlerate/tree/main/backend/app/models): `backend/app/models`
- [Relational database](https://github.com/ganesh-4731/hackxlerate/blob/main/backend/app/db.py): `backend/app/db.py`

### Other components

- **Portal users**

## Connections

- Portal users → Role workspaces: use workspaces (evidence: `frontend/src/App.tsx`)
- Role workspaces → Student workspace: routes students (evidence: `frontend/src/App.tsx`)
- Role workspaces → Faculty workspace: routes faculty (evidence: `frontend/src/App.tsx`)
- Role workspaces → Admin workspace: routes admins (evidence: `frontend/src/App.tsx`)
- Role workspaces → Session state: provides session
- Session state → API client: requests auth (evidence: `frontend/src/auth/AuthContext.tsx`)
- Student workspace → API client: requests data (evidence: `frontend/src/pages/student/Dashboard.tsx`)
- Faculty workspace → API client: requests data (evidence: `frontend/src/pages/faculty/StudentDetail.tsx`)
- Admin workspace → API client: requests data (evidence: `frontend/src/pages/admin/Dashboard.tsx`)
- Intervention plans → API client: updates plans (evidence: `frontend/src/components/InterventionsManager.tsx`)
- Student workspace → Shared UI: renders components (evidence: `frontend/src/pages/student/Dashboard.tsx`)
- API client → FastAPI application: calls API
- FastAPI application → Login and session routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Student endpoints: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Faculty endpoints: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Admin endpoints: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Analytics endpoints: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Support endpoints: registers routes (evidence: `backend/app/main.py`)
- Login and session routes → Authentication and roles: uses security (evidence: `backend/app/routers/auth.py`)
- Faculty endpoints → Student data queries: queries student data (evidence: `backend/app/routers/faculty.py`)
- Faculty endpoints → GPA and results: uses results (evidence: `backend/app/routers/faculty.py`)
- Student data queries → Academic records: queries records (evidence: `backend/app/services/student_data.py`)
- GPA and results → Academic records: builds results
- Academic risk rules → Student data queries: uses student data (evidence: `backend/app/services/academic_risk.py`)
- Academic risk rules → Engagement and identity: reads domain records (evidence: `backend/app/services/academic_risk.py`)
- Placement readiness → Engagement and identity: reads student records (evidence: `backend/app/services/placement_readiness.py`)
- Placement risk → Placement readiness: uses readiness (evidence: `backend/app/services/placement_risk.py`)
- Placement risk → Student data queries: uses student data (evidence: `backend/app/services/placement_risk.py`)
- Success score → Student data queries: uses student data (evidence: `backend/app/services/success_score.py`)
- Chat assistant → Academic risk rules: uses risk rules (evidence: `backend/app/services/chat_assistant.py`)
- Chat assistant → Placement readiness: uses readiness (evidence: `backend/app/services/chat_assistant.py`)
- Chat assistant → Placement risk: uses placement risk (evidence: `backend/app/services/chat_assistant.py`)
- Chat assistant → Success score: uses success score (evidence: `backend/app/services/chat_assistant.py`)
- Student data queries → Relational database: reads records
- Academic records → Relational database: maps tables (evidence: `backend/app/models/academic.py`)
- Engagement and identity → Relational database: maps tables (evidence: `backend/app/models/academic.py`)
