# harsha943vf/neura architecture

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

- Interactive diagram: https://gitdiagram.com/harsha943vf/neura
- Repository: https://github.com/harsha943vf/neura

## Overview

Neura is a college-information assistant with student chat and administrative tools. A student sends a question through the chat interface; the backend routes it into a graph that classifies domains, invokes relevant information agents, and synthesizes a response using conversation history. Admins can authenticate and manage college records, while an analytics view exposes usage reporting. The graph and router excerpts support the main chat flow; analytics internals and some page-to-service wiring were not sampled, so those connections are left unasserted.

Main entry points: [`backend/graph/neura_graph.py`](https://github.com/harsha943vf/neura/blob/main/backend/graph/neura_graph.py) (Neura graph), [`frontend/src/services/api.js`](https://github.com/harsha943vf/neura/blob/main/frontend/src/services/api.js) (HTTP API client), [`frontend/src/App.jsx`](https://github.com/harsha943vf/neura/blob/main/frontend/src/App.jsx) (Web app router), [`backend/main.py`](https://github.com/harsha943vf/neura/blob/main/backend/main.py) (FastAPI app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_web_app["Web app router<br/>[App.jsx]"]
  node_chat_page["Chat page<br/>[ChatPage.jsx]"]
  node_login_page["Login page<br/>[LoginPage.jsx]"]
  node_admin_page["Admin page<br/>[AdminPage.jsx]"]
  node_analytics_page["Analytics page<br/>[AnalyticsPage.jsx]"]
  node_api_client["HTTP API client<br/>[api.js]"]
end

subgraph group_api["API routes"]
  node_api_app["FastAPI app<br/>[main.py]"]
  node_chat_route["Chat endpoint<br/>[chat.py]"]
  node_auth_route["Authentication endpoint<br/>[auth.py]"]
  node_admin_route["Admin endpoints<br/>[admin.py]"]
  node_analytics_route["Analytics endpoint<br/>[analytics.py]"]
end

subgraph group_assistant["Answer orchestration"]
  node_graph["Neura graph<br/>[neura_graph.py]"]
  node_super_agent["Classifier and synthesis<br/>[super_agent.py]"]
end

subgraph group_knowledge["College knowledge"]
  node_placement_agent["Placement agent<br/>[placement_agent.py]"]
  node_department_agent["Department agent"]
  node_events_agent["Events agent<br/>[events_agent.py]"]
  node_general_agent["General information agent<br/>[general_agent.py]"]
end

subgraph group_persistence["Persistence"]
  node_db_connection["Database connection<br/>[connection.py]"]
  node_data_models[("College and chat records<br/>[models.py]")]
end

node_student(("Student"))
node_admin_user(("Administrator"))
node_llm{{"Groq language model"}}

node_student -.->|"asks question"| node_chat_page
node_admin_user -.->|"signs in"| node_login_page
node_web_app -->|"routes to"| node_chat_page
node_web_app -->|"routes to"| node_login_page
node_web_app -->|"routes to"| node_admin_page
node_web_app -->|"routes to"| node_analytics_page
node_login_page -->|"calls login"| node_api_client
node_admin_page -->|"manages records"| node_api_client
node_api_client -->|"posts chat"| node_chat_route
node_api_client -->|"posts credentials"| node_auth_route
node_api_client -->|"requests records"| node_admin_route
node_api_client -->|"requests summary"| node_analytics_route
node_api_app -->|"registers route"| node_chat_route
node_api_app -->|"registers route"| node_auth_route
node_api_app -->|"registers route"| node_admin_route
node_api_app -->|"registers route"| node_analytics_route
node_chat_route -->|"runs query"| node_graph
node_chat_route -->|"records analytics"| node_data_models
node_graph -->|"classifies and synthesizes"| node_super_agent
node_graph -->|"dispatches placement"| node_placement_agent
node_graph -->|"dispatches department"| node_department_agent
node_graph -->|"dispatches events"| node_events_agent
node_graph -->|"dispatches general"| node_general_agent
node_placement_agent -->|"queries placements"| node_data_models
node_super_agent -->|"invokes model"| node_llm
node_placement_agent -->|"invokes model"| node_llm
node_admin_route -->|"reads and writes"| node_data_models
node_data_models -->|"uses base"| node_db_connection

click node_web_app "https://github.com/harsha943vf/neura/blob/main/frontend/src/App.jsx"
click node_chat_page "https://github.com/harsha943vf/neura/blob/main/frontend/src/pages/ChatPage.jsx"
click node_login_page "https://github.com/harsha943vf/neura/blob/main/frontend/src/pages/LoginPage.jsx"
click node_admin_page "https://github.com/harsha943vf/neura/blob/main/frontend/src/pages/AdminPage.jsx"
click node_analytics_page "https://github.com/harsha943vf/neura/blob/main/frontend/src/pages/AnalyticsPage.jsx"
click node_api_client "https://github.com/harsha943vf/neura/blob/main/frontend/src/services/api.js"
click node_api_app "https://github.com/harsha943vf/neura/blob/main/backend/main.py"
click node_chat_route "https://github.com/harsha943vf/neura/blob/main/backend/routers/chat.py"
click node_auth_route "https://github.com/harsha943vf/neura/blob/main/backend/routers/auth.py"
click node_admin_route "https://github.com/harsha943vf/neura/blob/main/backend/routers/admin.py"
click node_analytics_route "https://github.com/harsha943vf/neura/blob/main/backend/routers/analytics.py"
click node_graph "https://github.com/harsha943vf/neura/blob/main/backend/graph/neura_graph.py"
click node_super_agent "https://github.com/harsha943vf/neura/blob/main/backend/agents/super_agent.py"
click node_placement_agent "https://github.com/harsha943vf/neura/blob/main/backend/agents/placement_agent.py"
click node_department_agent "https://github.com/harsha943vf/neura/blob/main/backend/agents/department_agent.py"
click node_events_agent "https://github.com/harsha943vf/neura/blob/main/backend/agents/events_agent.py"
click node_general_agent "https://github.com/harsha943vf/neura/blob/main/backend/agents/general_agent.py"
click node_db_connection "https://github.com/harsha943vf/neura/blob/main/backend/database/connection.py"
click node_data_models "https://github.com/harsha943vf/neura/blob/main/backend/database/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_web_app,node_chat_page,node_login_page,node_admin_page,node_analytics_page,node_api_client toneBlue
class node_api_app,node_chat_route,node_auth_route,node_admin_route,node_analytics_route toneAmber
class node_graph,node_super_agent toneMint
class node_placement_agent,node_department_agent,node_events_agent,node_general_agent toneRose
class node_db_connection,node_data_models,node_student,node_admin_user,node_llm toneIndigo
```

## Components

### Web interface

- [Web app router](https://github.com/harsha943vf/neura/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Chat page](https://github.com/harsha943vf/neura/blob/main/frontend/src/pages/ChatPage.jsx): `frontend/src/pages/ChatPage.jsx`
- [Login page](https://github.com/harsha943vf/neura/blob/main/frontend/src/pages/LoginPage.jsx): `frontend/src/pages/LoginPage.jsx`
- [Admin page](https://github.com/harsha943vf/neura/blob/main/frontend/src/pages/AdminPage.jsx): `frontend/src/pages/AdminPage.jsx`
- [Analytics page](https://github.com/harsha943vf/neura/blob/main/frontend/src/pages/AnalyticsPage.jsx): `frontend/src/pages/AnalyticsPage.jsx`
- [HTTP API client](https://github.com/harsha943vf/neura/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### API routes

- [FastAPI app](https://github.com/harsha943vf/neura/blob/main/backend/main.py): `backend/main.py`
- [Chat endpoint](https://github.com/harsha943vf/neura/blob/main/backend/routers/chat.py): `backend/routers/chat.py`
- [Authentication endpoint](https://github.com/harsha943vf/neura/blob/main/backend/routers/auth.py): `backend/routers/auth.py`
- [Admin endpoints](https://github.com/harsha943vf/neura/blob/main/backend/routers/admin.py): `backend/routers/admin.py`
- [Analytics endpoint](https://github.com/harsha943vf/neura/blob/main/backend/routers/analytics.py): `backend/routers/analytics.py`

### Answer orchestration

- [Neura graph](https://github.com/harsha943vf/neura/blob/main/backend/graph/neura_graph.py): `backend/graph/neura_graph.py`
- [Classifier and synthesis](https://github.com/harsha943vf/neura/blob/main/backend/agents/super_agent.py): `backend/agents/super_agent.py`

### College knowledge

- [Placement agent](https://github.com/harsha943vf/neura/blob/main/backend/agents/placement_agent.py): `backend/agents/placement_agent.py`
- [Department agent](https://github.com/harsha943vf/neura/blob/main/backend/agents/department_agent.py): `backend/agents/department_agent.py`
- [Events agent](https://github.com/harsha943vf/neura/blob/main/backend/agents/events_agent.py): `backend/agents/events_agent.py`
- [General information agent](https://github.com/harsha943vf/neura/blob/main/backend/agents/general_agent.py): `backend/agents/general_agent.py`

### Persistence

- [Database connection](https://github.com/harsha943vf/neura/blob/main/backend/database/connection.py): `backend/database/connection.py`
- [College and chat records](https://github.com/harsha943vf/neura/blob/main/backend/database/models.py): `backend/database/models.py`

### Other components

- **Student**
- **Administrator**
- **Groq language model**

## Connections

- Student → Chat page: asks question
- Administrator → Login page: signs in
- Web app router → Chat page: routes to (evidence: `frontend/src/App.jsx`)
- Web app router → Login page: routes to (evidence: `frontend/src/App.jsx`)
- Web app router → Admin page: routes to (evidence: `frontend/src/App.jsx`)
- Web app router → Analytics page: routes to (evidence: `frontend/src/App.jsx`)
- Login page → HTTP API client: calls login (evidence: `frontend/src/services/api.js`)
- Admin page → HTTP API client: manages records (evidence: `frontend/src/pages/AdminPage.jsx`)
- HTTP API client → Chat endpoint: posts chat (evidence: `frontend/src/services/api.js`)
- HTTP API client → Authentication endpoint: posts credentials (evidence: `frontend/src/services/api.js`)
- HTTP API client → Admin endpoints: requests records (evidence: `frontend/src/services/api.js`)
- HTTP API client → Analytics endpoint: requests summary (evidence: `frontend/src/services/api.js`)
- FastAPI app → Chat endpoint: registers route (evidence: `backend/main.py`)
- FastAPI app → Authentication endpoint: registers route (evidence: `backend/main.py`)
- FastAPI app → Admin endpoints: registers route (evidence: `backend/main.py`)
- FastAPI app → Analytics endpoint: registers route (evidence: `backend/main.py`)
- Chat endpoint → Neura graph: runs query (evidence: `backend/routers/chat.py`)
- Chat endpoint → College and chat records: records analytics (evidence: `backend/routers/chat.py`)
- Neura graph → Classifier and synthesis: classifies and synthesizes (evidence: `backend/graph/neura_graph.py`)
- Neura graph → Placement agent: dispatches placement (evidence: `backend/graph/neura_graph.py`)
- Neura graph → Department agent: dispatches department (evidence: `backend/graph/neura_graph.py`)
- Neura graph → Events agent: dispatches events (evidence: `backend/graph/neura_graph.py`)
- Neura graph → General information agent: dispatches general (evidence: `backend/graph/neura_graph.py`)
- Placement agent → College and chat records: queries placements (evidence: `backend/agents/placement_agent.py`)
- Classifier and synthesis → Groq language model: invokes model (evidence: `backend/agents/super_agent.py`)
- Placement agent → Groq language model: invokes model (evidence: `backend/agents/placement_agent.py`)
- Admin endpoints → College and chat records: reads and writes (evidence: `backend/routers/admin.py`)
- College and chat records → Database connection: uses base (evidence: `backend/database/models.py`)
