# patnaikswayam131/mindbrdige architecture

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

- Interactive diagram: https://gitdiagram.com/patnaikswayam131/mindbrdige
- Repository: https://github.com/patnaikswayam131/mindbrdige

## Overview

MindBridge is a student mental-health support application: students can access assessments, an AI support chat, and counselor booking, while counselor and admin pages provide operational views. In the chat workflow, the browser client sends messages to the FastAPI backend, which loads and saves thread history, invokes the conversation agent, and calls Gemini; the response returns to the client. Page names indicate additional assessment, booking, dashboard, and analytics capabilities, but their implementation and wiring were not sampled.

Main entry points: [`js/chat-integration.js`](https://github.com/patnaikswayam131/mindbrdige/blob/main/js/chat-integration.js) (Chat client), [`backend/main.py`](https://github.com/patnaikswayam131/mindbrdige/blob/main/backend/main.py) (Chat API), [`pages/ai_mental_health_chatbot.html`](https://github.com/patnaikswayam131/mindbrdige/blob/main/pages/ai_mental_health_chatbot.html) (AI chat page), [`js/language.js`](https://github.com/patnaikswayam131/mindbrdige/blob/main/js/language.js) (Language switching)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_student["Student support"]
  node_student_auth["Student access<br/>[student_login.html]"]
  node_student_register["Registration"]
  node_student_dashboard["Student dashboard"]
  node_assessment["Mental-health assessments"]
  node_booking["Counselor booking"]
end

subgraph group_staff["Staff tools"]
  node_counselor_dashboard["Counselor dashboard"]
  node_analytics["Admin analytics"]
end

subgraph group_chat["AI chat"]
  node_chat_page["AI chat page"]
  node_chat_client["Chat client"]
  node_chat_api["Chat API<br/>[main.py]"]
  node_agent["Conversation agent<br/>[main.py]"]
end

subgraph group_state["Chat state"]
  node_chat_db[("Chat history<br/>[chat_history.db]")]
  node_browser_state[("Browser storage")]
end

subgraph group_i18n["Language support"]
  node_language_client["Language switching<br/>[language.js]"]
end

node_student_actor(("Student"))
node_staff_actor(("Counselor / admin"))
node_gemini{{"Gemini API"}}
node_translate{{"Google Translate"}}

node_student_actor -->|"opens access"| node_student_auth
node_student_actor -->|"creates account"| node_student_register
node_student_actor -->|"opens dashboard"| node_student_dashboard
node_student_actor -->|"takes assessment"| node_assessment
node_student_actor -->|"books counselor"| node_booking
node_staff_actor -->|"opens dashboard"| node_counselor_dashboard
node_staff_actor -->|"views analytics"| node_analytics
node_student_actor -->|"starts chat"| node_chat_page
node_chat_page -->|"uses client"| node_chat_client
node_chat_client -->|"posts messages"| node_chat_api
node_chat_api -->|"reads and writes"| node_chat_db
node_chat_api -->|"invokes graph"| node_agent
node_agent -->|"requests response"| node_gemini
node_chat_client -->|"stores thread"| node_browser_state
node_language_client -.->|"loads translation"| node_translate

click node_student_auth "https://github.com/patnaikswayam131/mindbrdige/blob/main/pages/student_login.html"
click node_student_register "https://github.com/patnaikswayam131/mindbrdige/blob/main/pages/student_register.html"
click node_student_dashboard "https://github.com/patnaikswayam131/mindbrdige/blob/main/pages/student_dashboard.html"
click node_assessment "https://github.com/patnaikswayam131/mindbrdige/blob/main/pages/mental_health_assessments.html"
click node_booking "https://github.com/patnaikswayam131/mindbrdige/blob/main/pages/counselor_appointment_booking.html"
click node_counselor_dashboard "https://github.com/patnaikswayam131/mindbrdige/blob/main/pages/counselor_dashboard.html"
click node_analytics "https://github.com/patnaikswayam131/mindbrdige/blob/main/pages/admin_analytics_dashboard.html"
click node_chat_page "https://github.com/patnaikswayam131/mindbrdige/blob/main/pages/ai_mental_health_chatbot.html"
click node_chat_client "https://github.com/patnaikswayam131/mindbrdige/blob/main/js/chat-integration.js"
click node_chat_api "https://github.com/patnaikswayam131/mindbrdige/blob/main/backend/main.py"
click node_agent "https://github.com/patnaikswayam131/mindbrdige/blob/main/backend/main.py"
click node_chat_db "https://github.com/patnaikswayam131/mindbrdige/blob/main/backend/chat_history.db"
click node_language_client "https://github.com/patnaikswayam131/mindbrdige/blob/main/js/language.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_student_auth,node_student_register,node_student_dashboard,node_assessment,node_booking toneBlue
class node_counselor_dashboard,node_analytics toneAmber
class node_chat_page,node_chat_client,node_chat_api,node_agent,node_gemini toneMint
class node_chat_db,node_browser_state toneRose
class node_language_client,node_student_actor,node_staff_actor,node_translate toneIndigo
```

## Components

### Student support

- [Student access](https://github.com/patnaikswayam131/mindbrdige/blob/main/pages/student_login.html): `pages/student_login.html`
- [Registration](https://github.com/patnaikswayam131/mindbrdige/blob/main/pages/student_register.html): `pages/student_register.html`
- [Student dashboard](https://github.com/patnaikswayam131/mindbrdige/blob/main/pages/student_dashboard.html): `pages/student_dashboard.html`
- [Mental-health assessments](https://github.com/patnaikswayam131/mindbrdige/blob/main/pages/mental_health_assessments.html): `pages/mental_health_assessments.html`
- [Counselor booking](https://github.com/patnaikswayam131/mindbrdige/blob/main/pages/counselor_appointment_booking.html): `pages/counselor_appointment_booking.html`

### Staff tools

- [Counselor dashboard](https://github.com/patnaikswayam131/mindbrdige/blob/main/pages/counselor_dashboard.html): `pages/counselor_dashboard.html`
- [Admin analytics](https://github.com/patnaikswayam131/mindbrdige/blob/main/pages/admin_analytics_dashboard.html): `pages/admin_analytics_dashboard.html`

### AI chat

- [AI chat page](https://github.com/patnaikswayam131/mindbrdige/blob/main/pages/ai_mental_health_chatbot.html): `pages/ai_mental_health_chatbot.html`
- [Chat client](https://github.com/patnaikswayam131/mindbrdige/blob/main/js/chat-integration.js): `js/chat-integration.js`
- [Chat API](https://github.com/patnaikswayam131/mindbrdige/blob/main/backend/main.py): `backend/main.py`
- [Conversation agent](https://github.com/patnaikswayam131/mindbrdige/blob/main/backend/main.py): `backend/main.py`

### Chat state

- [Chat history](https://github.com/patnaikswayam131/mindbrdige/blob/main/backend/chat_history.db): `backend/chat_history.db`
- **Browser storage**

### Language support

- [Language switching](https://github.com/patnaikswayam131/mindbrdige/blob/main/js/language.js): `js/language.js`

### Other components

- **Student**
- **Counselor / admin**
- **Gemini API**
- **Google Translate**

## Connections

- Student → Student access: opens access
- Student → Registration: creates account
- Student → Student dashboard: opens dashboard
- Student → Mental-health assessments: takes assessment
- Student → Counselor booking: books counselor
- Counselor / admin → Counselor dashboard: opens dashboard
- Counselor / admin → Admin analytics: views analytics
- Student → AI chat page: starts chat
- AI chat page → Chat client: uses client
- Chat client → Chat API: posts messages
- Chat API → Chat history: reads and writes
- Chat API → Conversation agent: invokes graph
- Conversation agent → Gemini API: requests response
- Chat client → Browser storage: stores thread
- Language switching → Google Translate: loads translation
