# dinesh8778/academiq architecture

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

- Interactive diagram: https://gitdiagram.com/dinesh8778/academiq
- Repository: https://github.com/dinesh8778/academiq

## Overview

AcademiQ is a Django student-management platform with role-based web/API access, academic recordkeeping, and three AI capabilities: risk prediction, a conversational assistant, and anomaly notifications. The main workflow is staff/student access to class, attendance, assignment, submission, and marks data; the AI subsystems analyze or query that data and present results. Edges are limited to relationships supported by the README or source index; several route and view implementations were not excerpted.

Main entry points: [`assistant/tools.py`](https://github.com/dinesh8778/academiq/blob/main/assistant/tools.py) (Role-scoped tools), [`students/models.py`](https://github.com/dinesh8778/academiq/blob/main/students/models.py) (Student records), [`academics/models.py`](https://github.com/dinesh8778/academiq/blob/main/academics/models.py) (Classes & coursework), [`attendance/models.py`](https://github.com/dinesh8778/academiq/blob/main/attendance/models.py) (Attendance records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access &amp; identity"]
  node_auth["Roles &amp; permissions<br/>[permissions.py]"]
  node_user_records[("Teacher accounts<br/>[models.py]")]
end

subgraph group_academic["Academic operations"]
  node_student_records[("Student records<br/>[models.py]")]
  node_academic_records[("Classes &amp; coursework<br/>[models.py]")]
  node_attendance_records[("Attendance records<br/>[models.py]")]
  node_management_ui["Management UI<br/>[views_ui.py]"]
  node_student_ui["Student UI<br/>[views_ui.py]"]
  node_academic_api["Academic REST API<br/>[views.py]"]
  node_attendance_api["Attendance API<br/>[views.py]"]
  node_student_api["Student REST API<br/>[views.py]"]
end

subgraph group_analytics["AI analytics"]
  node_risk_features["Risk feature pipeline<br/>[data_pipeline.py]"]
  node_risk_model["Risk prediction<br/>[predictor.py]"]
  node_risk_api["Risk API<br/>[views.py]"]
end

subgraph group_assistant["Conversational assistant"]
  node_assistant_endpoint["Assistant endpoint<br/>[views.py]"]
  node_groq_client["Groq tool loop<br/>[groq_client.py]"]
  node_assistant_tools["Role-scoped tools<br/>[tools.py]"]
  node_draft_records[("Assistant draft logs<br/>[models.py]")]
end

subgraph group_notify["Notifications"]
  node_anomaly_check["Anomaly checks"]
  node_notification_records[("Notification records<br/>[models.py]")]
  node_notification_ui["Notification views<br/>[views.py]"]
end

node_browser(("Browser users"))
node_groq_service{{"Groq API"}}
node_database[("Configured database")]

node_browser -->|"uses web UI"| node_management_ui
node_browser -->|"uses dashboard"| node_student_ui
node_browser -->|"uses REST API"| node_academic_api
node_browser -->|"asks questions"| node_assistant_endpoint
node_management_ui -->|"manages records"| node_academic_records
node_management_ui -->|"uses student data"| node_student_records
node_management_ui -->|"marks attendance"| node_attendance_records
node_student_ui -->|"reads and edits"| node_student_records
node_academic_api -->|"serializes coursework"| node_academic_records
node_academic_api -->|"reads attendance"| node_attendance_records
node_academic_api -->|"reads students"| node_student_records
node_attendance_api -->|"manages records"| node_attendance_records
node_student_api -->|"manages students"| node_student_records
node_student_api -->|"uses class data"| node_academic_records
node_risk_features -->|"reads students"| node_student_records
node_risk_features -->|"derives attendance"| node_attendance_records
node_risk_features -->|"derives academic features"| node_academic_records
node_risk_model -->|"builds features"| node_risk_features
node_risk_api -.->|"returns risk scores"| node_risk_model
node_anomaly_check -->|"checks students"| node_student_records
node_anomaly_check -->|"checks activity"| node_academic_records
node_anomaly_check -->|"checks attendance"| node_attendance_records
node_anomaly_check -->|"creates alerts"| node_notification_records
node_notification_ui -->|"reads notifications"| node_notification_records
node_assistant_endpoint -.->|"handles questions"| node_groq_client
node_groq_client -->|"calls model"| node_groq_service
node_groq_client -->|"dispatches tools"| node_assistant_tools
node_assistant_tools -->|"queries risk"| node_risk_model
node_assistant_tools -->|"queries profiles"| node_student_records
node_assistant_tools -->|"queries coursework"| node_academic_records
node_assistant_tools -->|"queries attendance"| node_attendance_records
node_assistant_tools -->|"records drafts"| node_draft_records
node_management_ui -.->|"persists changes"| node_database
node_academic_api -.->|"reads and writes"| node_database
node_anomaly_check -.->|"stores alerts"| node_database

click node_auth "https://github.com/dinesh8778/academiq/blob/main/users/permissions.py"
click node_user_records "https://github.com/dinesh8778/academiq/blob/main/users/models.py"
click node_student_records "https://github.com/dinesh8778/academiq/blob/main/students/models.py"
click node_academic_records "https://github.com/dinesh8778/academiq/blob/main/academics/models.py"
click node_attendance_records "https://github.com/dinesh8778/academiq/blob/main/attendance/models.py"
click node_management_ui "https://github.com/dinesh8778/academiq/blob/main/academics/views_ui.py"
click node_student_ui "https://github.com/dinesh8778/academiq/blob/main/students/views_ui.py"
click node_academic_api "https://github.com/dinesh8778/academiq/blob/main/academics/views.py"
click node_attendance_api "https://github.com/dinesh8778/academiq/blob/main/attendance/views.py"
click node_student_api "https://github.com/dinesh8778/academiq/blob/main/students/views.py"
click node_risk_features "https://github.com/dinesh8778/academiq/blob/main/ai_engine/data_pipeline.py"
click node_risk_model "https://github.com/dinesh8778/academiq/blob/main/ai_engine/predictor.py"
click node_risk_api "https://github.com/dinesh8778/academiq/blob/main/ai_engine/views.py"
click node_anomaly_check "https://github.com/dinesh8778/academiq/blob/main/notifications/management/commands/detect_anomalies.py"
click node_notification_records "https://github.com/dinesh8778/academiq/blob/main/notifications/models.py"
click node_notification_ui "https://github.com/dinesh8778/academiq/blob/main/notifications/views.py"
click node_assistant_endpoint "https://github.com/dinesh8778/academiq/blob/main/assistant/views.py"
click node_groq_client "https://github.com/dinesh8778/academiq/blob/main/assistant/groq_client.py"
click node_assistant_tools "https://github.com/dinesh8778/academiq/blob/main/assistant/tools.py"
click node_draft_records "https://github.com/dinesh8778/academiq/blob/main/assistant/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_auth,node_user_records,node_browser toneBlue
class node_student_records,node_academic_records,node_attendance_records,node_management_ui,node_student_ui,node_academic_api,node_attendance_api,node_student_api,node_database toneAmber
class node_risk_features,node_risk_model,node_risk_api,node_groq_service toneMint
class node_assistant_endpoint,node_groq_client,node_assistant_tools,node_draft_records toneRose
class node_anomaly_check,node_notification_records,node_notification_ui toneIndigo
```

## Components

### Access & identity

- [Roles & permissions](https://github.com/dinesh8778/academiq/blob/main/users/permissions.py): `users/permissions.py`
- [Teacher accounts](https://github.com/dinesh8778/academiq/blob/main/users/models.py): `users/models.py`

### Academic operations

- [Student records](https://github.com/dinesh8778/academiq/blob/main/students/models.py): `students/models.py`
- [Classes & coursework](https://github.com/dinesh8778/academiq/blob/main/academics/models.py): `academics/models.py`
- [Attendance records](https://github.com/dinesh8778/academiq/blob/main/attendance/models.py): `attendance/models.py`
- [Management UI](https://github.com/dinesh8778/academiq/blob/main/academics/views_ui.py): `academics/views_ui.py`
- [Student UI](https://github.com/dinesh8778/academiq/blob/main/students/views_ui.py): `students/views_ui.py`
- [Academic REST API](https://github.com/dinesh8778/academiq/blob/main/academics/views.py): `academics/views.py`
- [Attendance API](https://github.com/dinesh8778/academiq/blob/main/attendance/views.py): `attendance/views.py`
- [Student REST API](https://github.com/dinesh8778/academiq/blob/main/students/views.py): `students/views.py`

### AI analytics

- [Risk feature pipeline](https://github.com/dinesh8778/academiq/blob/main/ai_engine/data_pipeline.py): `ai_engine/data_pipeline.py`
- [Risk prediction](https://github.com/dinesh8778/academiq/blob/main/ai_engine/predictor.py): `ai_engine/predictor.py`
- [Risk API](https://github.com/dinesh8778/academiq/blob/main/ai_engine/views.py): `ai_engine/views.py`

### Conversational assistant

- [Assistant endpoint](https://github.com/dinesh8778/academiq/blob/main/assistant/views.py): `assistant/views.py`
- [Groq tool loop](https://github.com/dinesh8778/academiq/blob/main/assistant/groq_client.py): `assistant/groq_client.py`
- [Role-scoped tools](https://github.com/dinesh8778/academiq/blob/main/assistant/tools.py): `assistant/tools.py`
- [Assistant draft logs](https://github.com/dinesh8778/academiq/blob/main/assistant/models.py): `assistant/models.py`

### Notifications

- [Anomaly checks](https://github.com/dinesh8778/academiq/blob/main/notifications/management/commands/detect_anomalies.py): `notifications/management/commands/detect_anomalies.py`
- [Notification records](https://github.com/dinesh8778/academiq/blob/main/notifications/models.py): `notifications/models.py`
- [Notification views](https://github.com/dinesh8778/academiq/blob/main/notifications/views.py): `notifications/views.py`

### Other components

- **Browser users**
- **Groq API**
- **Configured database**

## Connections

- Browser users → Management UI: uses web UI
- Browser users → Student UI: uses dashboard
- Browser users → Academic REST API: uses REST API
- Browser users → Assistant endpoint: asks questions
- Management UI → Classes & coursework: manages records (evidence: `academics/views_ui.py`)
- Management UI → Student records: uses student data (evidence: `academics/views_ui.py`)
- Management UI → Attendance records: marks attendance (evidence: `academics/views_ui.py`)
- Student UI → Student records: reads and edits (evidence: `students/views_ui.py`)
- Academic REST API → Classes & coursework: serializes coursework (evidence: `academics/views.py`)
- Academic REST API → Attendance records: reads attendance (evidence: `academics/views.py`)
- Academic REST API → Student records: reads students (evidence: `academics/views.py`)
- Attendance API → Attendance records: manages records (evidence: `attendance/views.py`)
- Student REST API → Student records: manages students (evidence: `students/views.py`)
- Student REST API → Classes & coursework: uses class data (evidence: `students/views.py`)
- Risk feature pipeline → Student records: reads students (evidence: `ai_engine/data_pipeline.py`)
- Risk feature pipeline → Attendance records: derives attendance (evidence: `ai_engine/data_pipeline.py`)
- Risk feature pipeline → Classes & coursework: derives academic features (evidence: `ai_engine/data_pipeline.py`)
- Risk prediction → Risk feature pipeline: builds features (evidence: `ai_engine/predictor.py`)
- Risk API → Risk prediction: returns risk scores
- Anomaly checks → Student records: checks students (evidence: `notifications/management/commands/detect_anomalies.py`)
- Anomaly checks → Classes & coursework: checks activity (evidence: `notifications/management/commands/detect_anomalies.py`)
- Anomaly checks → Attendance records: checks attendance (evidence: `notifications/management/commands/detect_anomalies.py`)
- Anomaly checks → Notification records: creates alerts (evidence: `notifications/management/commands/detect_anomalies.py`)
- Notification views → Notification records: reads notifications (evidence: `notifications/views.py`)
- Assistant endpoint → Groq tool loop: handles questions
- Groq tool loop → Groq API: calls model (evidence: `assistant/groq_client.py`)
- Groq tool loop → Role-scoped tools: dispatches tools (evidence: `assistant/groq_client.py`)
- Role-scoped tools → Risk prediction: queries risk (evidence: `assistant/tools.py`)
- Role-scoped tools → Student records: queries profiles (evidence: `assistant/tools.py`)
- Role-scoped tools → Classes & coursework: queries coursework (evidence: `assistant/tools.py`)
- Role-scoped tools → Attendance records: queries attendance (evidence: `assistant/tools.py`)
- Role-scoped tools → Assistant draft logs: records drafts (evidence: `assistant/tools.py`)
- Management UI → Configured database: persists changes
- Academic REST API → Configured database: reads and writes
- Anomaly checks → Configured database: stores alerts
