# sam14334/grade_tracker architecture

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

- Interactive diagram: https://gitdiagram.com/sam14334/grade_tracker
- Repository: https://github.com/sam14334/grade_tracker

## Overview

This is a PHP grade-tracking portal for students and professors. Users register or sign in, then work in role-specific dashboards: professors publish weighted course templates, while students enroll with a class code and use grade-tracking features. Template management and enrollment actions persist through MySQL. The student dashboard excerpt also shows local grade data, a GWA target, and trend-chart rendering. Several action-to-dashboard links are not visible in the sampled markup, so those relationships are omitted rather than inferred.

Main entry points: [`php/db.php`](https://github.com/sam14334/grade_tracker/blob/main/php/db.php) (Grade tracker database), [`php/login.php`](https://github.com/sam14334/grade_tracker/blob/main/php/login.php) (Sign in), [`professor_dashboard.php`](https://github.com/sam14334/grade_tracker/blob/main/professor_dashboard.php) (Professor dashboard), [`php/publish_template.php`](https://github.com/sam14334/grade_tracker/blob/main/php/publish_template.php) (Publish template)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity &amp; Sessions"]
  node_registration["Registration<br/>[register.php]"]
  node_sign_in["Sign in<br/>[login.php]"]
  node_sign_out["Sign out<br/>[logout.php]"]
end

subgraph group_courses["Courses &amp; Templates"]
  node_prof_dashboard["Professor dashboard"]
  node_publish["Publish template"]
  node_enrollment["Course enrollment<br/>[enroll_course.php]"]
  node_template_removal["Template removal"]
end

subgraph group_tracking["Grade Tracking"]
  node_student_dashboard["Student dashboard"]
  node_grade_tools["Grade &amp; GWA tools"]
end

subgraph group_storage["Persistence"]
  node_course_templates[("Course templates")]
  node_grade_tracker_db[("Grade tracker database<br/>[db.php]")]
end

node_visitor(("Portal user"))

node_visitor -.->|"registers"| node_registration
node_visitor -.->|"signs in"| node_sign_in
node_sign_in -->|"redirects professors"| node_prof_dashboard
node_sign_in -->|"redirects students"| node_student_dashboard
node_prof_dashboard -->|"submits template"| node_publish
node_publish -->|"writes template"| node_course_templates
node_publish -->|"uses connection"| node_grade_tracker_db
node_enrollment -->|"reads and writes"| node_grade_tracker_db
node_template_removal -->|"deletes records"| node_grade_tracker_db
node_prof_dashboard -->|"queries templates"| node_grade_tracker_db
node_student_dashboard -->|"queries courses"| node_grade_tracker_db
node_student_dashboard -->|"renders tools"| node_grade_tools
node_visitor -.->|"enrolls by code"| node_enrollment
node_visitor -.->|"removes template"| node_template_removal
node_visitor -.->|"ends session"| node_sign_out

click node_registration "https://github.com/sam14334/grade_tracker/blob/main/php/register.php"
click node_sign_in "https://github.com/sam14334/grade_tracker/blob/main/php/login.php"
click node_sign_out "https://github.com/sam14334/grade_tracker/blob/main/php/logout.php"
click node_prof_dashboard "https://github.com/sam14334/grade_tracker/blob/main/professor_dashboard.php"
click node_student_dashboard "https://github.com/sam14334/grade_tracker/blob/main/student_dashboard.php"
click node_publish "https://github.com/sam14334/grade_tracker/blob/main/php/publish_template.php"
click node_enrollment "https://github.com/sam14334/grade_tracker/blob/main/php/enroll_course.php"
click node_template_removal "https://github.com/sam14334/grade_tracker/blob/main/php/delete_template.php"
click node_grade_tools "https://github.com/sam14334/grade_tracker/blob/main/student_dashboard.php"
click node_course_templates "https://github.com/sam14334/grade_tracker/blob/main/php/publish_template.php"
click node_grade_tracker_db "https://github.com/sam14334/grade_tracker/blob/main/php/db.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_registration,node_sign_in,node_sign_out,node_visitor toneBlue
class node_prof_dashboard,node_publish,node_enrollment,node_template_removal toneAmber
class node_student_dashboard,node_grade_tools toneMint
class node_course_templates,node_grade_tracker_db toneRose
```

## Components

### Identity & Sessions

- [Registration](https://github.com/sam14334/grade_tracker/blob/main/php/register.php): `php/register.php`
- [Sign in](https://github.com/sam14334/grade_tracker/blob/main/php/login.php): `php/login.php`
- [Sign out](https://github.com/sam14334/grade_tracker/blob/main/php/logout.php): `php/logout.php`

### Courses & Templates

- [Professor dashboard](https://github.com/sam14334/grade_tracker/blob/main/professor_dashboard.php): `professor_dashboard.php`
- [Publish template](https://github.com/sam14334/grade_tracker/blob/main/php/publish_template.php): `php/publish_template.php`
- [Course enrollment](https://github.com/sam14334/grade_tracker/blob/main/php/enroll_course.php): `php/enroll_course.php`
- [Template removal](https://github.com/sam14334/grade_tracker/blob/main/php/delete_template.php): `php/delete_template.php`

### Grade Tracking

- [Student dashboard](https://github.com/sam14334/grade_tracker/blob/main/student_dashboard.php): `student_dashboard.php`
- [Grade & GWA tools](https://github.com/sam14334/grade_tracker/blob/main/student_dashboard.php): `student_dashboard.php`

### Persistence

- [Course templates](https://github.com/sam14334/grade_tracker/blob/main/php/publish_template.php): `php/publish_template.php`
- [Grade tracker database](https://github.com/sam14334/grade_tracker/blob/main/php/db.php): `php/db.php`

### Other components

- **Portal user**

## Connections

- Portal user → Registration: registers
- Portal user → Sign in: signs in
- Sign in → Professor dashboard: redirects professors (evidence: `php/login.php`)
- Sign in → Student dashboard: redirects students (evidence: `php/login.php`)
- Professor dashboard → Publish template: submits template (evidence: `professor_dashboard.php`)
- Publish template → Course templates: writes template (evidence: `php/publish_template.php`)
- Publish template → Grade tracker database: uses connection (evidence: `php/publish_template.php`)
- Course enrollment → Grade tracker database: reads and writes (evidence: `php/enroll_course.php`)
- Template removal → Grade tracker database: deletes records (evidence: `php/delete_template.php`)
- Professor dashboard → Grade tracker database: queries templates (evidence: `professor_dashboard.php`)
- Student dashboard → Grade tracker database: queries courses (evidence: `student_dashboard.php`)
- Student dashboard → Grade & GWA tools: renders tools (evidence: `student_dashboard.php`)
- Portal user → Course enrollment: enrolls by code
- Portal user → Template removal: removes template
- Portal user → Sign out: ends session
