# salsabeelquraan/smart-qa architecture

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

- Interactive diagram: https://gitdiagram.com/salsabeelquraan/smart-qa
- Repository: https://github.com/salsabeelquraan/smart-qa

## Overview

Smart QA is a bilingual academic-governance platform for professors and students. The main workflow runs from browser pages through the REST API to PostgreSQL and back: professors manage course data and inspect quality, workload, exams, lectures, risk, and recommendations; students manage courses, grades, exams, and study plans. Server-side analysis services support those workflows, while authentication and optional AI and email integrations provide platform capabilities. The graph uses README-described connections and source-index references; unsampled page and route internals are not inferred.

Main entry points: [`server/routes/professor.js`](https://github.com/salsabeelquraan/smart-qa/blob/main/server/routes/professor.js) (Professor API), [`server/app.js`](https://github.com/salsabeelquraan/smart-qa/blob/main/server/app.js) (Express application), [`public/js/api.js`](https://github.com/salsabeelquraan/smart-qa/blob/main/public/js/api.js) (API client), [`server/routes/student.js`](https://github.com/salsabeelquraan/smart-qa/blob/main/server/routes/student.js) (Student API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser experience"]
  node_api_client["API client<br/>[api.js]"]
  node_prof_courses["Course management"]
  node_prof_analysis["Professor analysis pages"]
  node_student_pages["Student pages"]
end

subgraph group_platform["API platform"]
  node_express["Express application<br/>[app.js]"]
  node_auth["Authentication<br/>[auth.js]"]
  node_auth_middleware["Auth middleware<br/>[auth.js]"]
  node_prof_routes["Professor API<br/>[professor.js]"]
  node_student_routes["Student API<br/>[student.js]"]
  node_i18n_route["Translation API<br/>[i18n.js]"]
  node_mailer["Email delivery<br/>[mailer.js]"]
end

subgraph group_professor["Professor workflows"]
  node_course_load["Course workload and grades<br/>[courseLoad.js]"]
  node_lecture["Lecture analysis<br/>[lectureAnalyzer.js]"]
  node_exam_quality["Exam analysis<br/>[examQuality.js]"]
  node_insights["Course insights<br/>[courseInsights.js]"]
  node_risk["Risk prediction<br/>[riskPrediction.js]"]
  node_recommendations["Recommendations<br/>[recommender.js]"]
  node_ai_review["AI review<br/>[aiReview.js]"]
end

subgraph group_student["Student workflows"]
  node_student_badges["Achievements<br/>[badges.js]"]
end

node_browser(("Browser user"))
node_postgres[("PostgreSQL")]
node_smtp["SMTP service"]

node_browser -->|"uses"| node_api_client
node_api_client -->|"REST requests"| node_express
node_express -->|"mounts"| node_auth
node_express -->|"mounts"| node_prof_routes
node_express -->|"mounts"| node_student_routes
node_express -->|"mounts"| node_i18n_route
node_express -->|"guards routes"| node_auth_middleware
node_auth -->|"uses"| node_auth_middleware
node_prof_routes -->|"uses"| node_course_load
node_prof_routes -->|"uses"| node_lecture
node_prof_routes -->|"uses"| node_exam_quality
node_prof_routes -->|"uses"| node_insights
node_prof_routes -->|"uses"| node_risk
node_prof_routes -->|"uses"| node_recommendations
node_prof_routes -->|"uses"| node_ai_review
node_student_routes -->|"refreshes"| node_student_badges
node_prof_routes -->|"reads and writes"| node_postgres
node_student_routes -->|"reads and writes"| node_postgres
node_auth_middleware -->|"checks revocation"| node_postgres
node_prof_analysis -.->|"requests data"| node_api_client
node_prof_courses -.->|"requests data"| node_api_client
node_student_pages -.->|"requests data"| node_api_client
node_express -->|"uses"| node_mailer
node_auth -->|"sends account email"| node_mailer
node_mailer -.->|"sends mail"| node_smtp
node_prof_routes -.->|"sends notifications"| node_mailer
node_express -->|"health check"| node_postgres
node_i18n_route -->|"uses cache"| node_postgres
node_prof_routes -.->|"serves analysis data"| node_prof_analysis
node_student_routes -.->|"serves student data"| node_student_pages
node_ai_review -.->|"calls Claude API"| node_browser

click node_api_client "https://github.com/salsabeelquraan/smart-qa/blob/main/public/js/api.js"
click node_prof_courses "https://github.com/salsabeelquraan/smart-qa/blob/main/public/js/pages/professor-courses.js"
click node_prof_analysis "https://github.com/salsabeelquraan/smart-qa/tree/main/public/js/pages"
click node_student_pages "https://github.com/salsabeelquraan/smart-qa/tree/main/public/js/pages"
click node_express "https://github.com/salsabeelquraan/smart-qa/blob/main/server/app.js"
click node_auth "https://github.com/salsabeelquraan/smart-qa/blob/main/server/routes/auth.js"
click node_auth_middleware "https://github.com/salsabeelquraan/smart-qa/blob/main/server/middleware/auth.js"
click node_prof_routes "https://github.com/salsabeelquraan/smart-qa/blob/main/server/routes/professor.js"
click node_student_routes "https://github.com/salsabeelquraan/smart-qa/blob/main/server/routes/student.js"
click node_i18n_route "https://github.com/salsabeelquraan/smart-qa/blob/main/server/routes/i18n.js"
click node_course_load "https://github.com/salsabeelquraan/smart-qa/blob/main/server/services/courseLoad.js"
click node_lecture "https://github.com/salsabeelquraan/smart-qa/blob/main/server/services/lectureAnalyzer.js"
click node_exam_quality "https://github.com/salsabeelquraan/smart-qa/blob/main/server/services/examQuality.js"
click node_insights "https://github.com/salsabeelquraan/smart-qa/blob/main/server/services/courseInsights.js"
click node_risk "https://github.com/salsabeelquraan/smart-qa/blob/main/server/services/riskPrediction.js"
click node_recommendations "https://github.com/salsabeelquraan/smart-qa/blob/main/server/services/recommender.js"
click node_ai_review "https://github.com/salsabeelquraan/smart-qa/blob/main/server/services/aiReview.js"
click node_student_badges "https://github.com/salsabeelquraan/smart-qa/blob/main/server/services/badges.js"
click node_mailer "https://github.com/salsabeelquraan/smart-qa/blob/main/server/services/mailer.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_api_client,node_prof_courses,node_prof_analysis,node_student_pages,node_browser toneBlue
class node_express,node_auth,node_auth_middleware,node_prof_routes,node_student_routes,node_i18n_route,node_mailer,node_postgres toneAmber
class node_course_load,node_lecture,node_exam_quality,node_insights,node_risk,node_recommendations,node_ai_review toneMint
class node_student_badges toneRose
class node_smtp toneIndigo
```

## Components

### Browser experience

- [API client](https://github.com/salsabeelquraan/smart-qa/blob/main/public/js/api.js): `public/js/api.js`
- [Course management](https://github.com/salsabeelquraan/smart-qa/blob/main/public/js/pages/professor-courses.js): `public/js/pages/professor-courses.js`
- [Professor analysis pages](https://github.com/salsabeelquraan/smart-qa/tree/main/public/js/pages): `public/js/pages`
- [Student pages](https://github.com/salsabeelquraan/smart-qa/tree/main/public/js/pages): `public/js/pages`

### API platform

- [Express application](https://github.com/salsabeelquraan/smart-qa/blob/main/server/app.js): `server/app.js`
- [Authentication](https://github.com/salsabeelquraan/smart-qa/blob/main/server/routes/auth.js): `server/routes/auth.js`
- [Auth middleware](https://github.com/salsabeelquraan/smart-qa/blob/main/server/middleware/auth.js): `server/middleware/auth.js`
- [Professor API](https://github.com/salsabeelquraan/smart-qa/blob/main/server/routes/professor.js): `server/routes/professor.js`
- [Student API](https://github.com/salsabeelquraan/smart-qa/blob/main/server/routes/student.js): `server/routes/student.js`
- [Translation API](https://github.com/salsabeelquraan/smart-qa/blob/main/server/routes/i18n.js): `server/routes/i18n.js`
- [Email delivery](https://github.com/salsabeelquraan/smart-qa/blob/main/server/services/mailer.js): `server/services/mailer.js`

### Professor workflows

- [Course workload and grades](https://github.com/salsabeelquraan/smart-qa/blob/main/server/services/courseLoad.js): `server/services/courseLoad.js`
- [Lecture analysis](https://github.com/salsabeelquraan/smart-qa/blob/main/server/services/lectureAnalyzer.js): `server/services/lectureAnalyzer.js`
- [Exam analysis](https://github.com/salsabeelquraan/smart-qa/blob/main/server/services/examQuality.js): `server/services/examQuality.js`
- [Course insights](https://github.com/salsabeelquraan/smart-qa/blob/main/server/services/courseInsights.js): `server/services/courseInsights.js`
- [Risk prediction](https://github.com/salsabeelquraan/smart-qa/blob/main/server/services/riskPrediction.js): `server/services/riskPrediction.js`
- [Recommendations](https://github.com/salsabeelquraan/smart-qa/blob/main/server/services/recommender.js): `server/services/recommender.js`
- [AI review](https://github.com/salsabeelquraan/smart-qa/blob/main/server/services/aiReview.js): `server/services/aiReview.js`

### Student workflows

- [Achievements](https://github.com/salsabeelquraan/smart-qa/blob/main/server/services/badges.js): `server/services/badges.js`

### Other components

- **Browser user**
- **PostgreSQL**
- **SMTP service**

## Connections

- Browser user → API client: uses
- API client → Express application: REST requests
- Express application → Authentication: mounts (evidence: `server/app.js`)
- Express application → Professor API: mounts (evidence: `server/app.js`)
- Express application → Student API: mounts (evidence: `server/app.js`)
- Express application → Translation API: mounts (evidence: `server/app.js`)
- Express application → Auth middleware: guards routes (evidence: `server/app.js`)
- Authentication → Auth middleware: uses (evidence: `server/routes/auth.js`)
- Professor API → Course workload and grades: uses (evidence: `server/routes/professor.js`)
- Professor API → Lecture analysis: uses (evidence: `server/routes/professor.js`)
- Professor API → Exam analysis: uses (evidence: `server/routes/professor.js`)
- Professor API → Course insights: uses (evidence: `server/routes/professor.js`)
- Professor API → Risk prediction: uses (evidence: `server/routes/professor.js`)
- Professor API → Recommendations: uses (evidence: `server/routes/professor.js`)
- Professor API → AI review: uses (evidence: `server/routes/professor.js`)
- Student API → Achievements: refreshes (evidence: `server/routes/student.js`)
- Professor API → PostgreSQL: reads and writes (evidence: `server/routes/professor.js`)
- Student API → PostgreSQL: reads and writes (evidence: `server/routes/student.js`)
- Auth middleware → PostgreSQL: checks revocation (evidence: `server/middleware/auth.js`)
- Professor analysis pages → API client: requests data
- Course management → API client: requests data
- Student pages → API client: requests data
- Express application → Email delivery: uses (evidence: `server/app.js`)
- Authentication → Email delivery: sends account email (evidence: `server/routes/auth.js`)
- Email delivery → SMTP service: sends mail
- Professor API → Email delivery: sends notifications (evidence: `server/routes/professor.js`)
- Express application → PostgreSQL: health check (evidence: `server/app.js`)
- Translation API → PostgreSQL: uses cache (evidence: `server/routes/i18n.js`)
- Professor API → Professor analysis pages: serves analysis data
- Student API → Student pages: serves student data
- AI review → Browser user: calls Claude API (evidence: `server/services/aiReview.js`)
