# prembarot/globalpath-ai architecture

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

- Interactive diagram: https://gitdiagram.com/prembarot/globalpath-ai
- Repository: https://github.com/prembarot/globalpath-ai

## Overview

GlobalPath AI helps students and professionals explore study, work, visa, and settlement options. The main journey is account or guest entry, profile-based country and university recommendations, then admission estimates; separate views cover jobs, scholarships, visas, citizenship, live data, and saved reports. Streamlit is the primary documented interface, with a FastAPI/web interface reusing the same engine. The README documents live-provider enrichment and CSV fallback; some page and router implementations were not sampled, so those branches are represented at their supported module paths.

Main entry points: [`views/__init__.py`](https://github.com/prembarot/globalpath-ai/blob/main/views/__init__.py) (Feature pages), [`core/data_loader.py`](https://github.com/prembarot/globalpath-ai/blob/main/core/data_loader.py) (Dataset access), [`api/main.py`](https://github.com/prembarot/globalpath-ai/blob/main/api/main.py) (REST API), [`views/study_abroad.py`](https://github.com/prembarot/globalpath-ai/blob/main/views/study_abroad.py) (Study planning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_streamlit["Streamlit entry<br/>[app.py]"]
  node_page_views["Feature pages<br/>[__init__.py]"]
  node_rest_api["REST API<br/>[main.py]"]
  node_web_client["Web client<br/>[app.js]"]
  node_chat_page["Chat page<br/>[chatbot_view.py]"]
end

subgraph group_guidance["Planning and guidance"]
  node_study["Study planning<br/>[study_abroad.py]"]
  node_jobs["Career planning<br/>[jobs.py]"]
  node_scholarships["Scholarships<br/>[scholarships.py]"]
  node_visa_pr["Visa and settlement<br/>[visa.py]"]
  node_dashboard["Dashboard and live data<br/>[dashboard.py]"]
end

subgraph group_data["Data services"]
  node_data_loader["Dataset access<br/>[data_loader.py]"]
  node_recommendations["Rule recommenders<br/>[recommendation.py]"]
  node_providers["Live providers<br/>[__init__.py]"]
  node_http_cache["HTTP and cache<br/>[http.py]"]
  node_csv_data["Bundled CSV data"]
  node_live_services["External live data<br/>external service"]
end

subgraph group_intelligence["ML and chatbot"]
  node_ml_models["ML prediction<br/>[predictor.py]"]
  node_ml_explanations["Prediction explanations<br/>[explain.py]"]
  node_rag["Dataset retrieval<br/>[rag.py]"]
  node_chatbot["RAG chatbot<br/>[chatbot.py]"]
end

subgraph group_accounts["Accounts and saved data"]
  node_auth_view["Sign-in page<br/>[auth_view.py]"]
  node_auth_logic["Account authentication<br/>[auth.py]"]
  node_database[("SQLite accounts and saves<br/>[database.py]")]
  node_saved_view["Saved recommendations and reports<br/>[saved.py]"]
  node_pdf["PDF export<br/>[pdf_report.py]"]
  node_api_auth["API authentication<br/>[auth.py]"]
  node_api_saved["Saved API<br/>[saved.py]"]
end

node_student(("Student or professional"))

node_student -->|"opens app"| node_streamlit
node_streamlit -->|"shows auth gate"| node_auth_view
node_streamlit -->|"routes pages"| node_page_views
node_page_views -.->|"includes"| node_study
node_page_views -.->|"includes"| node_jobs
node_page_views -.->|"includes"| node_scholarships
node_page_views -.->|"includes"| node_dashboard
node_page_views -.->|"includes"| node_chat_page
node_auth_view -->|"uses"| node_auth_logic
node_auth_logic -->|"reads and writes"| node_database
node_study -->|"requests matches"| node_recommendations
node_jobs -->|"requests matches"| node_recommendations
node_study -->|"estimates admission"| node_ml_models
node_jobs -->|"predicts salary and sponsorship"| node_ml_models
node_jobs -->|"requests explanations"| node_ml_explanations
node_study -->|"requests explanations"| node_ml_explanations
node_ml_explanations -->|"loads model"| node_ml_models
node_recommendations -->|"loads datasets"| node_data_loader
node_data_loader -->|"enriches datasets"| node_providers
node_data_loader -->|"loads fallback"| node_csv_data
node_providers -->|"fetches with cache"| node_http_cache
node_http_cache -.->|"requests live data"| node_live_services
node_dashboard -->|"loads metrics and live data"| node_data_loader
node_chat_page -.->|"submits questions"| node_chatbot
node_chatbot -->|"retrieves context"| node_rag
node_rag -->|"indexes datasets"| node_data_loader
node_student -->|"uses API"| node_rest_api
node_rest_api -->|"registers router"| node_api_auth
node_rest_api -->|"registers router"| node_api_saved
node_rest_api -.->|"serves shared data"| node_data_loader
node_api_auth -->|"delegates authentication"| node_auth_logic
node_api_saved -->|"reads and writes"| node_database
node_saved_view -->|"loads and deletes saves"| node_database
node_saved_view -->|"exports report"| node_pdf

click node_streamlit "https://github.com/prembarot/globalpath-ai/blob/main/app.py"
click node_page_views "https://github.com/prembarot/globalpath-ai/blob/main/views/__init__.py"
click node_rest_api "https://github.com/prembarot/globalpath-ai/blob/main/api/main.py"
click node_web_client "https://github.com/prembarot/globalpath-ai/blob/main/frontend/static/app.js"
click node_study "https://github.com/prembarot/globalpath-ai/blob/main/views/study_abroad.py"
click node_jobs "https://github.com/prembarot/globalpath-ai/blob/main/views/jobs.py"
click node_scholarships "https://github.com/prembarot/globalpath-ai/blob/main/views/scholarships.py"
click node_visa_pr "https://github.com/prembarot/globalpath-ai/blob/main/core/visa.py"
click node_dashboard "https://github.com/prembarot/globalpath-ai/blob/main/views/dashboard.py"
click node_data_loader "https://github.com/prembarot/globalpath-ai/blob/main/core/data_loader.py"
click node_recommendations "https://github.com/prembarot/globalpath-ai/blob/main/core/recommendation.py"
click node_providers "https://github.com/prembarot/globalpath-ai/blob/main/core/providers/__init__.py"
click node_http_cache "https://github.com/prembarot/globalpath-ai/blob/main/core/providers/http.py"
click node_ml_models "https://github.com/prembarot/globalpath-ai/blob/main/ml/predictor.py"
click node_ml_explanations "https://github.com/prembarot/globalpath-ai/blob/main/ml/explain.py"
click node_chat_page "https://github.com/prembarot/globalpath-ai/blob/main/views/chatbot_view.py"
click node_rag "https://github.com/prembarot/globalpath-ai/blob/main/chatbot/rag.py"
click node_chatbot "https://github.com/prembarot/globalpath-ai/blob/main/chatbot/chatbot.py"
click node_auth_view "https://github.com/prembarot/globalpath-ai/blob/main/views/auth_view.py"
click node_auth_logic "https://github.com/prembarot/globalpath-ai/blob/main/auth/auth.py"
click node_database "https://github.com/prembarot/globalpath-ai/blob/main/db/database.py"
click node_saved_view "https://github.com/prembarot/globalpath-ai/blob/main/views/saved.py"
click node_pdf "https://github.com/prembarot/globalpath-ai/blob/main/utils/pdf_report.py"
click node_api_auth "https://github.com/prembarot/globalpath-ai/blob/main/api/routers/auth.py"
click node_api_saved "https://github.com/prembarot/globalpath-ai/blob/main/api/routers/saved.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_streamlit,node_page_views,node_rest_api,node_web_client,node_chat_page toneBlue
class node_study,node_jobs,node_scholarships,node_visa_pr,node_dashboard toneAmber
class node_data_loader,node_recommendations,node_providers,node_http_cache,node_csv_data,node_live_services toneMint
class node_ml_models,node_ml_explanations,node_rag,node_chatbot toneRose
class node_auth_view,node_auth_logic,node_database,node_saved_view,node_pdf,node_api_auth,node_api_saved,node_student toneIndigo
```

## Components

### User interfaces

- [Streamlit entry](https://github.com/prembarot/globalpath-ai/blob/main/app.py): `app.py`
- [Feature pages](https://github.com/prembarot/globalpath-ai/blob/main/views/__init__.py): `views/__init__.py`
- [REST API](https://github.com/prembarot/globalpath-ai/blob/main/api/main.py): `api/main.py`
- [Web client](https://github.com/prembarot/globalpath-ai/blob/main/frontend/static/app.js): `frontend/static/app.js`
- [Chat page](https://github.com/prembarot/globalpath-ai/blob/main/views/chatbot_view.py): `views/chatbot_view.py`

### Planning and guidance

- [Study planning](https://github.com/prembarot/globalpath-ai/blob/main/views/study_abroad.py): `views/study_abroad.py`
- [Career planning](https://github.com/prembarot/globalpath-ai/blob/main/views/jobs.py): `views/jobs.py`
- [Scholarships](https://github.com/prembarot/globalpath-ai/blob/main/views/scholarships.py): `views/scholarships.py`
- [Visa and settlement](https://github.com/prembarot/globalpath-ai/blob/main/core/visa.py): `core/visa.py`
- [Dashboard and live data](https://github.com/prembarot/globalpath-ai/blob/main/views/dashboard.py): `views/dashboard.py`

### Data services

- [Dataset access](https://github.com/prembarot/globalpath-ai/blob/main/core/data_loader.py): `core/data_loader.py`
- [Rule recommenders](https://github.com/prembarot/globalpath-ai/blob/main/core/recommendation.py): `core/recommendation.py`
- [Live providers](https://github.com/prembarot/globalpath-ai/blob/main/core/providers/__init__.py): `core/providers/__init__.py`
- [HTTP and cache](https://github.com/prembarot/globalpath-ai/blob/main/core/providers/http.py): `core/providers/http.py`
- **Bundled CSV data**
- **External live data**: external service

### ML and chatbot

- [ML prediction](https://github.com/prembarot/globalpath-ai/blob/main/ml/predictor.py): `ml/predictor.py`
- [Prediction explanations](https://github.com/prembarot/globalpath-ai/blob/main/ml/explain.py): `ml/explain.py`
- [Dataset retrieval](https://github.com/prembarot/globalpath-ai/blob/main/chatbot/rag.py): `chatbot/rag.py`
- [RAG chatbot](https://github.com/prembarot/globalpath-ai/blob/main/chatbot/chatbot.py): `chatbot/chatbot.py`

### Accounts and saved data

- [Sign-in page](https://github.com/prembarot/globalpath-ai/blob/main/views/auth_view.py): `views/auth_view.py`
- [Account authentication](https://github.com/prembarot/globalpath-ai/blob/main/auth/auth.py): `auth/auth.py`
- [SQLite accounts and saves](https://github.com/prembarot/globalpath-ai/blob/main/db/database.py): `db/database.py`
- [Saved recommendations and reports](https://github.com/prembarot/globalpath-ai/blob/main/views/saved.py): `views/saved.py`
- [PDF export](https://github.com/prembarot/globalpath-ai/blob/main/utils/pdf_report.py): `utils/pdf_report.py`
- [API authentication](https://github.com/prembarot/globalpath-ai/blob/main/api/routers/auth.py): `api/routers/auth.py`
- [Saved API](https://github.com/prembarot/globalpath-ai/blob/main/api/routers/saved.py): `api/routers/saved.py`

### Other components

- **Student or professional**

## Connections

- Student or professional → Streamlit entry: opens app
- Streamlit entry → Sign-in page: shows auth gate (evidence: `app.py`)
- Streamlit entry → Feature pages: routes pages (evidence: `app.py`)
- Feature pages → Study planning: includes
- Feature pages → Career planning: includes
- Feature pages → Scholarships: includes
- Feature pages → Dashboard and live data: includes
- Feature pages → Chat page: includes
- Sign-in page → Account authentication: uses (evidence: `views/auth_view.py`)
- Account authentication → SQLite accounts and saves: reads and writes (evidence: `auth/auth.py`)
- Study planning → Rule recommenders: requests matches (evidence: `views/study_abroad.py`)
- Career planning → Rule recommenders: requests matches (evidence: `views/jobs.py`)
- Study planning → ML prediction: estimates admission (evidence: `views/study_abroad.py`)
- Career planning → ML prediction: predicts salary and sponsorship (evidence: `views/jobs.py`)
- Career planning → Prediction explanations: requests explanations (evidence: `views/jobs.py`)
- Study planning → Prediction explanations: requests explanations (evidence: `views/study_abroad.py`)
- Prediction explanations → ML prediction: loads model (evidence: `ml/explain.py`)
- Rule recommenders → Dataset access: loads datasets (evidence: `core/recommendation.py`)
- Dataset access → Live providers: enriches datasets (evidence: `core/data_loader.py`)
- Dataset access → Bundled CSV data: loads fallback
- Live providers → HTTP and cache: fetches with cache
- HTTP and cache → External live data: requests live data
- Dashboard and live data → Dataset access: loads metrics and live data (evidence: `views/dashboard.py`)
- Chat page → RAG chatbot: submits questions
- RAG chatbot → Dataset retrieval: retrieves context (evidence: `chatbot/chatbot.py`)
- Dataset retrieval → Dataset access: indexes datasets (evidence: `chatbot/rag.py`)
- Student or professional → REST API: uses API
- REST API → API authentication: registers router (evidence: `api/main.py`)
- REST API → Saved API: registers router (evidence: `api/main.py`)
- REST API → Dataset access: serves shared data (evidence: `api/main.py`)
- API authentication → Account authentication: delegates authentication (evidence: `api/routers/auth.py`)
- Saved API → SQLite accounts and saves: reads and writes (evidence: `api/routers/saved.py`)
- Saved recommendations and reports → SQLite accounts and saves: loads and deletes saves (evidence: `views/saved.py`)
- Saved recommendations and reports → PDF export: exports report (evidence: `views/saved.py`)
