# 71ashu/ai-course-advisor architecture

> Architecture diagram of the GitHub repository 71ashu/ai-course-advisor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/71ashu/ai-course-advisor
- Repository: https://github.com/71ashu/ai-course-advisor
- Video tour (about a minute): https://gitdiagram.com/71ashu/ai-course-advisor/video

## Overview

AI Course Advisor is a full-stack academic planning product. Students register or sign in, complete onboarding if needed, then use the advisor to get explainable course recommendations and inspect degree progress, profiles, prerequisite paths, and conversation history. The backend API coordinates recommendation scoring, prerequisite analysis, collaborative signals, grade prediction, and advisory text, with student and course state persisted in PostgreSQL. The graph emphasizes documented capabilities and sampled call relationships; several backend routes and UI panels are represented from the README and SOURCE INDEX rather than inspected source excerpts.

Main entry points: [`frontend/src/CourseAdvisor.jsx`](https://github.com/71ashu/ai-course-advisor/blob/main/frontend/src/CourseAdvisor.jsx) (Advisor shell), [`backend/app.py`](https://github.com/71ashu/ai-course-advisor/blob/main/backend/app.py) (Flask API), [`backend/models.py`](https://github.com/71ashu/ai-course-advisor/blob/main/backend/models.py) (Domain models), [`backend/services.py`](https://github.com/71ashu/ai-course-advisor/blob/main/backend/services.py) (Scoring and progress)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Student experience"]
  node_app_shell["App shell<br/>[App.jsx]"]
  node_auth_ui["Auth screens<br/>[AuthPage.jsx]"]
  node_course_ui["Advisor shell<br/>[CourseAdvisor.jsx]"]
  node_advisor_tab["Advisor chat<br/>[AdvisorTab.jsx]"]
  node_course_cards["Course cards<br/>[CourseCard.jsx]"]
  node_conversation_list["Conversation list"]
  node_onboarding_ui["Onboarding quiz<br/>[OnboardingQuiz.jsx]"]
  node_dashboard_ui["Dashboard<br/>[DashboardPanel.jsx]"]
  node_progress_ui["Progress panel<br/>[ProgressPanel.jsx]"]
  node_profile_ui["Profile panel<br/>[ProfilePanel.jsx]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["Backend API"]
  node_flask_api["Flask API<br/>[app.py]"]
  node_mailer["Email delivery<br/>[mailer.py]"]
end

subgraph group_recommend["Recommendation engine"]
  node_services["Scoring and progress<br/>[services.py]"]
  node_knowledge_graph["Prerequisite graph<br/>[knowledge_graph.py]"]
  node_collaborative["Collaborative filter<br/>[collaborative.py]"]
  node_grade_predictor["Grade prediction<br/>[grade_predictor.py]"]
  node_llm["Advisory messages<br/>[llm.py]"]
end

subgraph group_data["Academic data"]
  node_models["Domain models<br/>[models.py]"]
  node_postgres[("PostgreSQL")]
end

node_student(("Student"))

node_student -->|"uses"| node_app_shell
node_app_shell -->|"requests"| node_api_client
node_app_shell -->|"renders"| node_auth_ui
node_app_shell -->|"renders"| node_course_ui
node_course_ui -->|"requests"| node_api_client
node_course_ui -->|"renders"| node_advisor_tab
node_course_ui -->|"renders"| node_onboarding_ui
node_course_ui -->|"renders"| node_dashboard_ui
node_course_ui -->|"renders"| node_progress_ui
node_course_ui -->|"renders"| node_profile_ui
node_advisor_tab -->|"renders"| node_course_cards
node_advisor_tab -->|"renders"| node_conversation_list
node_advisor_tab -.->|"submits queries"| node_api_client
node_api_client -->|"HTTP requests"| node_flask_api
node_flask_api -->|"scores recommendations"| node_services
node_flask_api -->|"generates advice"| node_llm
node_flask_api -->|"serves graph paths"| node_knowledge_graph
node_flask_api -->|"sends reset email"| node_mailer
node_services -->|"checks prerequisites"| node_knowledge_graph
node_services -->|"scores peers"| node_collaborative
node_services -->|"predicts grades"| node_grade_predictor
node_services -->|"reads academic records"| node_models
node_knowledge_graph -->|"reads courses"| node_models
node_collaborative -->|"reads enrollments"| node_models
node_grade_predictor -->|"reads grade history"| node_models
node_flask_api -->|"reads and writes"| node_models
node_models -.->|"persists records"| node_postgres

click node_app_shell "https://github.com/71ashu/ai-course-advisor/blob/main/frontend/src/App.jsx"
click node_auth_ui "https://github.com/71ashu/ai-course-advisor/blob/main/frontend/src/components/auth/AuthPage.jsx"
click node_course_ui "https://github.com/71ashu/ai-course-advisor/blob/main/frontend/src/CourseAdvisor.jsx"
click node_advisor_tab "https://github.com/71ashu/ai-course-advisor/blob/main/frontend/src/components/course-advisor/AdvisorTab.jsx"
click node_course_cards "https://github.com/71ashu/ai-course-advisor/blob/main/frontend/src/components/course-advisor/CourseCard.jsx"
click node_conversation_list "https://github.com/71ashu/ai-course-advisor/blob/main/frontend/src/components/course-advisor/ConversationList.jsx"
click node_onboarding_ui "https://github.com/71ashu/ai-course-advisor/blob/main/frontend/src/components/course-advisor/OnboardingQuiz.jsx"
click node_dashboard_ui "https://github.com/71ashu/ai-course-advisor/blob/main/frontend/src/components/course-advisor/DashboardPanel.jsx"
click node_progress_ui "https://github.com/71ashu/ai-course-advisor/blob/main/frontend/src/components/course-advisor/ProgressPanel.jsx"
click node_profile_ui "https://github.com/71ashu/ai-course-advisor/blob/main/frontend/src/components/course-advisor/ProfilePanel.jsx"
click node_api_client "https://github.com/71ashu/ai-course-advisor/blob/main/frontend/src/api.js"
click node_flask_api "https://github.com/71ashu/ai-course-advisor/blob/main/backend/app.py"
click node_services "https://github.com/71ashu/ai-course-advisor/blob/main/backend/services.py"
click node_knowledge_graph "https://github.com/71ashu/ai-course-advisor/blob/main/backend/knowledge_graph.py"
click node_collaborative "https://github.com/71ashu/ai-course-advisor/blob/main/backend/collaborative.py"
click node_grade_predictor "https://github.com/71ashu/ai-course-advisor/blob/main/backend/grade_predictor.py"
click node_llm "https://github.com/71ashu/ai-course-advisor/blob/main/backend/llm.py"
click node_mailer "https://github.com/71ashu/ai-course-advisor/blob/main/backend/mailer.py"
click node_models "https://github.com/71ashu/ai-course-advisor/blob/main/backend/models.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_shell,node_auth_ui,node_course_ui,node_advisor_tab,node_course_cards,node_conversation_list,node_onboarding_ui,node_dashboard_ui,node_progress_ui,node_profile_ui,node_api_client toneBlue
class node_flask_api,node_mailer toneAmber
class node_services,node_knowledge_graph,node_collaborative,node_grade_predictor,node_llm toneMint
class node_models,node_postgres toneRose
class node_student toneIndigo
```

## Components

### Student experience

- [App shell](https://github.com/71ashu/ai-course-advisor/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Auth screens](https://github.com/71ashu/ai-course-advisor/blob/main/frontend/src/components/auth/AuthPage.jsx): `frontend/src/components/auth/AuthPage.jsx`
- [Advisor shell](https://github.com/71ashu/ai-course-advisor/blob/main/frontend/src/CourseAdvisor.jsx): `frontend/src/CourseAdvisor.jsx`
- [Advisor chat](https://github.com/71ashu/ai-course-advisor/blob/main/frontend/src/components/course-advisor/AdvisorTab.jsx): `frontend/src/components/course-advisor/AdvisorTab.jsx`
- [Course cards](https://github.com/71ashu/ai-course-advisor/blob/main/frontend/src/components/course-advisor/CourseCard.jsx): `frontend/src/components/course-advisor/CourseCard.jsx`
- [Conversation list](https://github.com/71ashu/ai-course-advisor/blob/main/frontend/src/components/course-advisor/ConversationList.jsx): `frontend/src/components/course-advisor/ConversationList.jsx`
- [Onboarding quiz](https://github.com/71ashu/ai-course-advisor/blob/main/frontend/src/components/course-advisor/OnboardingQuiz.jsx): `frontend/src/components/course-advisor/OnboardingQuiz.jsx`
- [Dashboard](https://github.com/71ashu/ai-course-advisor/blob/main/frontend/src/components/course-advisor/DashboardPanel.jsx): `frontend/src/components/course-advisor/DashboardPanel.jsx`
- [Progress panel](https://github.com/71ashu/ai-course-advisor/blob/main/frontend/src/components/course-advisor/ProgressPanel.jsx): `frontend/src/components/course-advisor/ProgressPanel.jsx`
- [Profile panel](https://github.com/71ashu/ai-course-advisor/blob/main/frontend/src/components/course-advisor/ProfilePanel.jsx): `frontend/src/components/course-advisor/ProfilePanel.jsx`
- [API client](https://github.com/71ashu/ai-course-advisor/blob/main/frontend/src/api.js): `frontend/src/api.js`

### Backend API

- [Flask API](https://github.com/71ashu/ai-course-advisor/blob/main/backend/app.py): `backend/app.py`
- [Email delivery](https://github.com/71ashu/ai-course-advisor/blob/main/backend/mailer.py): `backend/mailer.py`

### Recommendation engine

- [Scoring and progress](https://github.com/71ashu/ai-course-advisor/blob/main/backend/services.py): `backend/services.py`
- [Prerequisite graph](https://github.com/71ashu/ai-course-advisor/blob/main/backend/knowledge_graph.py): `backend/knowledge_graph.py`
- [Collaborative filter](https://github.com/71ashu/ai-course-advisor/blob/main/backend/collaborative.py): `backend/collaborative.py`
- [Grade prediction](https://github.com/71ashu/ai-course-advisor/blob/main/backend/grade_predictor.py): `backend/grade_predictor.py`
- [Advisory messages](https://github.com/71ashu/ai-course-advisor/blob/main/backend/llm.py): `backend/llm.py`

### Academic data

- [Domain models](https://github.com/71ashu/ai-course-advisor/blob/main/backend/models.py): `backend/models.py`
- **PostgreSQL**

### Other components

- **Student**

## Connections

- Student → App shell: uses (evidence: `README.md`)
- App shell → API client: requests (evidence: `frontend/src/App.jsx`)
- App shell → Auth screens: renders (evidence: `frontend/src/App.jsx`)
- App shell → Advisor shell: renders (evidence: `frontend/src/App.jsx`)
- Advisor shell → API client: requests (evidence: `frontend/src/CourseAdvisor.jsx`)
- Advisor shell → Advisor chat: renders (evidence: `frontend/src/CourseAdvisor.jsx`)
- Advisor shell → Onboarding quiz: renders (evidence: `frontend/src/CourseAdvisor.jsx`)
- Advisor shell → Dashboard: renders (evidence: `frontend/src/CourseAdvisor.jsx`)
- Advisor shell → Progress panel: renders (evidence: `frontend/src/CourseAdvisor.jsx`)
- Advisor shell → Profile panel: renders (evidence: `frontend/src/CourseAdvisor.jsx`)
- Advisor chat → Course cards: renders (evidence: `frontend/src/components/course-advisor/AdvisorTab.jsx`)
- Advisor chat → Conversation list: renders (evidence: `frontend/src/components/course-advisor/AdvisorTab.jsx`)
- Advisor chat → API client: submits queries
- API client → Flask API: HTTP requests (evidence: `README.md`)
- Flask API → Scoring and progress: scores recommendations (evidence: `backend/app.py`)
- Flask API → Advisory messages: generates advice (evidence: `backend/app.py`)
- Flask API → Prerequisite graph: serves graph paths (evidence: `backend/app.py`)
- Flask API → Email delivery: sends reset email (evidence: `backend/app.py`)
- Scoring and progress → Prerequisite graph: checks prerequisites (evidence: `backend/services.py`)
- Scoring and progress → Collaborative filter: scores peers (evidence: `backend/services.py`)
- Scoring and progress → Grade prediction: predicts grades (evidence: `backend/services.py`)
- Scoring and progress → Domain models: reads academic records (evidence: `backend/services.py`)
- Prerequisite graph → Domain models: reads courses (evidence: `backend/knowledge_graph.py`)
- Collaborative filter → Domain models: reads enrollments (evidence: `backend/collaborative.py`)
- Grade prediction → Domain models: reads grade history (evidence: `backend/grade_predictor.py`)
- Flask API → Domain models: reads and writes (evidence: `backend/app.py`)
- Domain models → PostgreSQL: persists records
