# smtharun2007-coder/sgi architecture

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

- Interactive diagram: https://gitdiagram.com/smtharun2007-coder/sgi
- Repository: https://github.com/smtharun2007-coder/sgi

## Overview

SGI is a PHP student-growth web application backed by MongoDB Atlas. Students sign in, manage academic records and attendance, review semester results, and use the LEAP placement program; mentors oversee students, attendance, approvals, and LEAP activity. The graph retains the major academic, attendance, approval, and LEAP areas named by the source index. Evidence is limited to the README and sampled excerpts; unsampled page-to-page and API wiring is not inferred.

Main entry points: [`mentor_dashboard.php`](https://github.com/smtharun2007-coder/sgi/blob/main/mentor_dashboard.php) (Mentor dashboard), [`index.php`](https://github.com/smtharun2007-coder/sgi/blob/main/index.php) (Role entry), [`mentor_leap_applications.php`](https://github.com/smtharun2007-coder/sgi/blob/main/mentor_leap_applications.php) (Mentor LEAP), [`leap_auth.php`](https://github.com/smtharun2007-coder/sgi/blob/main/leap_auth.php) (LEAP access helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and access"]
  node_welcome["Role entry<br/>[index.php]"]
  node_student_home["Student dashboard<br/>[dashboard.php]"]
  node_mentor_home["Mentor dashboard"]
  node_db_config["MongoDB setup<br/>[config.php]"]
end

subgraph group_academic["Academic records"]
  node_semester["Semester details"]
  node_credit["Credit subjects"]
  node_student_approval["Student requests"]
  node_approval_actions["Approval handling<br/>[approvals.php]"]
  node_sgi_calculation["SGI calculation<br/>[calculate_sgi.php]"]
end

subgraph group_attendance["Attendance"]
  node_student_attendance["Student attendance<br/>[attendance.php]"]
  node_attendance_api["Attendance API<br/>[attendance_api.php]"]
  node_attendance_calendar["Attendance calendar"]
  node_mentor_attendance["Mentor attendance"]
  node_mentor_attendance_calendar["Mentor attendance calendar"]
end

subgraph group_mentor_leap["Mentor and LEAP"]
  node_mentor_approval["Mentor approvals"]
  node_mentor_announcements["Mentor announcements"]
  node_mentor_timetable["Mentor timetable"]
  node_leap_student["Student LEAP<br/>[leap.php]"]
  node_leap_guard["LEAP access helpers<br/>[leap_auth.php]"]
  node_leap_mentor["Mentor LEAP"]
  node_leap_modal["LEAP student modal"]
end

node_student(("Student"))
node_mentor(("Mentor"))
node_mongodb[("MongoDB Atlas")]

node_student -->|"opens"| node_welcome
node_mentor -->|"opens"| node_welcome
node_welcome -->|"redirects"| node_student_home
node_welcome -->|"redirects"| node_mentor_home
node_db_config -->|"connects to"| node_mongodb
node_student_approval -->|"submits requests"| node_approval_actions
node_mentor_home -->|"links to"| node_mentor_approval
node_mentor_home -->|"links to"| node_mentor_announcements
node_mentor_home -->|"links to"| node_leap_mentor
node_mentor_home -->|"fetches data for"| node_leap_modal
node_leap_student -->|"uses"| node_leap_guard
node_leap_mentor -->|"uses"| node_leap_guard

click node_welcome "https://github.com/smtharun2007-coder/sgi/blob/main/index.php"
click node_student_home "https://github.com/smtharun2007-coder/sgi/blob/main/dashboard.php"
click node_mentor_home "https://github.com/smtharun2007-coder/sgi/blob/main/mentor_dashboard.php"
click node_db_config "https://github.com/smtharun2007-coder/sgi/blob/main/config.php"
click node_semester "https://github.com/smtharun2007-coder/sgi/blob/main/semester_detail.php"
click node_credit "https://github.com/smtharun2007-coder/sgi/blob/main/credit_subjects.php"
click node_student_approval "https://github.com/smtharun2007-coder/sgi/blob/main/student_approvals.php"
click node_approval_actions "https://github.com/smtharun2007-coder/sgi/blob/main/approvals.php"
click node_sgi_calculation "https://github.com/smtharun2007-coder/sgi/blob/main/calculate_sgi.php"
click node_student_attendance "https://github.com/smtharun2007-coder/sgi/blob/main/attendance.php"
click node_attendance_api "https://github.com/smtharun2007-coder/sgi/blob/main/attendance_api.php"
click node_attendance_calendar "https://github.com/smtharun2007-coder/sgi/blob/main/attendance_calendar.php"
click node_mentor_attendance "https://github.com/smtharun2007-coder/sgi/blob/main/mentor_attendance.php"
click node_mentor_attendance_calendar "https://github.com/smtharun2007-coder/sgi/blob/main/mentor_attendance_calendar.php"
click node_mentor_approval "https://github.com/smtharun2007-coder/sgi/blob/main/mentor_approvals.php"
click node_mentor_announcements "https://github.com/smtharun2007-coder/sgi/blob/main/mentor_announcements.php"
click node_mentor_timetable "https://github.com/smtharun2007-coder/sgi/blob/main/mentor_timetable.php"
click node_leap_student "https://github.com/smtharun2007-coder/sgi/blob/main/leap.php"
click node_leap_guard "https://github.com/smtharun2007-coder/sgi/blob/main/leap_auth.php"
click node_leap_mentor "https://github.com/smtharun2007-coder/sgi/blob/main/mentor_leap_applications.php"
click node_leap_modal "https://github.com/smtharun2007-coder/sgi/blob/main/mentor_leap_student_modal.php"

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_welcome,node_student_home,node_mentor_home,node_db_config toneBlue
class node_semester,node_credit,node_student_approval,node_approval_actions,node_sgi_calculation,node_mongodb toneAmber
class node_student_attendance,node_attendance_api,node_attendance_calendar,node_mentor_attendance,node_mentor_attendance_calendar toneMint
class node_mentor_approval,node_mentor_announcements,node_mentor_timetable,node_leap_student,node_leap_guard,node_leap_mentor,node_leap_modal toneRose
class node_student,node_mentor toneIndigo
```

## Components

### Entry and access

- [Role entry](https://github.com/smtharun2007-coder/sgi/blob/main/index.php): `index.php`
- [Student dashboard](https://github.com/smtharun2007-coder/sgi/blob/main/dashboard.php): `dashboard.php`
- [Mentor dashboard](https://github.com/smtharun2007-coder/sgi/blob/main/mentor_dashboard.php): `mentor_dashboard.php`
- [MongoDB setup](https://github.com/smtharun2007-coder/sgi/blob/main/config.php): `config.php`

### Academic records

- [Semester details](https://github.com/smtharun2007-coder/sgi/blob/main/semester_detail.php): `semester_detail.php`
- [Credit subjects](https://github.com/smtharun2007-coder/sgi/blob/main/credit_subjects.php): `credit_subjects.php`
- [Student requests](https://github.com/smtharun2007-coder/sgi/blob/main/student_approvals.php): `student_approvals.php`
- [Approval handling](https://github.com/smtharun2007-coder/sgi/blob/main/approvals.php): `approvals.php`
- [SGI calculation](https://github.com/smtharun2007-coder/sgi/blob/main/calculate_sgi.php): `calculate_sgi.php`

### Attendance

- [Student attendance](https://github.com/smtharun2007-coder/sgi/blob/main/attendance.php): `attendance.php`
- [Attendance API](https://github.com/smtharun2007-coder/sgi/blob/main/attendance_api.php): `attendance_api.php`
- [Attendance calendar](https://github.com/smtharun2007-coder/sgi/blob/main/attendance_calendar.php): `attendance_calendar.php`
- [Mentor attendance](https://github.com/smtharun2007-coder/sgi/blob/main/mentor_attendance.php): `mentor_attendance.php`
- [Mentor attendance calendar](https://github.com/smtharun2007-coder/sgi/blob/main/mentor_attendance_calendar.php): `mentor_attendance_calendar.php`

### Mentor and LEAP

- [Mentor approvals](https://github.com/smtharun2007-coder/sgi/blob/main/mentor_approvals.php): `mentor_approvals.php`
- [Mentor announcements](https://github.com/smtharun2007-coder/sgi/blob/main/mentor_announcements.php): `mentor_announcements.php`
- [Mentor timetable](https://github.com/smtharun2007-coder/sgi/blob/main/mentor_timetable.php): `mentor_timetable.php`
- [Student LEAP](https://github.com/smtharun2007-coder/sgi/blob/main/leap.php): `leap.php`
- [LEAP access helpers](https://github.com/smtharun2007-coder/sgi/blob/main/leap_auth.php): `leap_auth.php`
- [Mentor LEAP](https://github.com/smtharun2007-coder/sgi/blob/main/mentor_leap_applications.php): `mentor_leap_applications.php`
- [LEAP student modal](https://github.com/smtharun2007-coder/sgi/blob/main/mentor_leap_student_modal.php): `mentor_leap_student_modal.php`

### Other components

- **Student**
- **Mentor**
- **MongoDB Atlas**

## Connections

- Student → Role entry: opens (evidence: `index.php`)
- Mentor → Role entry: opens (evidence: `index.php`)
- Role entry → Student dashboard: redirects (evidence: `index.php`)
- Role entry → Mentor dashboard: redirects (evidence: `index.php`)
- MongoDB setup → MongoDB Atlas: connects to
- Student requests → Approval handling: submits requests (evidence: `student_approvals.php`)
- Mentor dashboard → Mentor approvals: links to (evidence: `mentor_dashboard.php`)
- Mentor dashboard → Mentor announcements: links to (evidence: `mentor_dashboard.php`)
- Mentor dashboard → Mentor LEAP: links to (evidence: `mentor_dashboard.php`)
- Mentor dashboard → LEAP student modal: fetches data for (evidence: `mentor_dashboard.php`)
- Student LEAP → LEAP access helpers: uses (evidence: `leap.php`)
- Mentor LEAP → LEAP access helpers: uses (evidence: `mentor_leap_applications.php`)
