# triplet19/nts-sms architecture

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

- Interactive diagram: https://gitdiagram.com/triplet19/nts-sms
- Repository: https://github.com/triplet19/nts-sms

## Overview

NTS-SMS is a school management system with an admin-configurable identity, branding, and mail layer. Its main user-facing workflow spans student and grade entry, grade approval, and report-card viewing or design; role and workflow administration support that process. The sampled code confirms the frontend auth client and backend auth/settings routes, but most school-domain implementations were not excerpted. Those capabilities are represented from the repository tree, without asserting unverified calls between them.

Main entry points: [`backend/app/Http/Controllers/Api/MailSettingsController.php`](https://github.com/triplet19/nts-sms/blob/main/backend/app/Http/Controllers/Api/MailSettingsController.php) (Mail settings API), [`backend/routes/api.php`](https://github.com/triplet19/nts-sms/blob/main/backend/routes/api.php) (API routes), [`backend/app/Http/Controllers/Api/GeneralSettingsController.php`](https://github.com/triplet19/nts-sms/blob/main/backend/app/Http/Controllers/Api/GeneralSettingsController.php) (General settings API), [`frontend/app/(auth)/login/page.tsx`](https://github.com/triplet19/nts-sms/blob/main/frontend/app/(auth)/login/page.tsx) (Login screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and navigation"]
  node_login_ui["Login screen<br/>[page.tsx]"]
  node_auth_client["Auth client<br/>[auth.ts]"]
  node_api_client["API client<br/>[api.ts]"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_brand["Branding display<br/>[AppLogo.tsx]"]
end

subgraph group_school["School records and grading"]
  node_students["Student records<br/>[page.tsx]"]
  node_student_detail["Student detail<br/>[page.tsx]"]
  node_grade_entry["Grade submission<br/>[page.tsx]"]
  node_grade_approval["Grade approvals<br/>[page.tsx]"]
end

subgraph group_reports["Report cards"]
  node_report_list["Report cards<br/>[page.tsx]"]
  node_report_view["Student report card<br/>[page.tsx]"]
  node_designer["Template designer<br/>[page.tsx]"]
end

subgraph group_admin["Administration"]
  node_roles["Roles and permissions<br/>[page.tsx]"]
  node_workflow["Approval workflows<br/>[page.tsx]"]
  node_general_ui["General settings<br/>[page.tsx]"]
  node_mail_ui["Mail settings<br/>[page.tsx]"]
end

subgraph group_backend["Backend services"]
  node_auth_api["Authentication API<br/>[AuthController.php]"]
  node_api_routes["API routes<br/>[api.php]"]
  node_grade_api["Grade submission API"]
  node_approval_api["Approval API"]
  node_report_pdf["Report-card PDF"]
  node_template_api["Template management"]
  node_general_api["General settings API"]
  node_general_settings[("General settings store")]
  node_public_settings["Public settings API"]
  node_mail_api["Mail settings API"]
  node_mail_settings[("Mail settings store<br/>[MailSettings.php]")]
  node_test_mail["Test email<br/>[TestMail.php]"]
end

node_staff(("School staff"))

node_staff -.->|"signs in"| node_login_ui
node_auth_client -->|"uses"| node_api_client
node_api_routes -->|"routes auth"| node_auth_api
node_api_routes -->|"routes settings"| node_general_api
node_api_routes -->|"routes settings"| node_mail_api
node_general_api -->|"reads and saves"| node_general_settings
node_public_settings -->|"reads"| node_general_settings
node_mail_api -->|"reads and saves"| node_mail_settings
node_mail_api -->|"sends"| node_test_mail
node_login_ui -.->|"authenticates via"| node_auth_client
node_dashboard -.->|"offers records"| node_students
node_students -.->|"opens"| node_student_detail
node_grade_entry -.->|"submits to"| node_grade_api
node_grade_approval -.->|"reviews via"| node_approval_api
node_report_list -.->|"opens"| node_report_view
node_report_view -.->|"requests PDF"| node_report_pdf
node_designer -.->|"edits templates via"| node_template_api
node_general_ui -.->|"updates via"| node_general_api
node_mail_ui -.->|"updates via"| node_mail_api
node_brand -.->|"loads branding"| node_public_settings

click node_login_ui "https://github.com/triplet19/nts-sms/blob/main/frontend/app/(auth)/login/page.tsx"
click node_auth_client "https://github.com/triplet19/nts-sms/blob/main/frontend/lib/auth.ts"
click node_api_client "https://github.com/triplet19/nts-sms/blob/main/frontend/lib/api.ts"
click node_auth_api "https://github.com/triplet19/nts-sms/blob/main/backend/app/Http/Controllers/Api/AuthController.php"
click node_api_routes "https://github.com/triplet19/nts-sms/blob/main/backend/routes/api.php"
click node_dashboard "https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/dashboard/page.tsx"
click node_students "https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/students/page.tsx"
click node_student_detail "https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/students/%5Bid%5D/page.tsx"
click node_grade_entry "https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/grades/submit/page.tsx"
click node_grade_api "https://github.com/triplet19/nts-sms/blob/main/backend/app/Http/Controllers/Api/GradeController.php"
click node_grade_approval "https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/grades/approvals/page.tsx"
click node_approval_api "https://github.com/triplet19/nts-sms/blob/main/backend/app/Http/Controllers/Api/ApprovalController.php"
click node_report_list "https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/report-cards/page.tsx"
click node_report_view "https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/report-cards/%5BstudentId%5D/page.tsx"
click node_report_pdf "https://github.com/triplet19/nts-sms/blob/main/backend/app/Http/Controllers/Api/ReportCardPdfController.php"
click node_template_api "https://github.com/triplet19/nts-sms/blob/main/backend/app/Http/Controllers/Api/ReportCardTemplateController.php"
click node_designer "https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/admin/report-card-designer/page.tsx"
click node_roles "https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/admin/roles/page.tsx"
click node_workflow "https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/admin/workflows/page.tsx"
click node_general_ui "https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/admin/settings/general/page.tsx"
click node_general_api "https://github.com/triplet19/nts-sms/blob/main/backend/app/Http/Controllers/Api/GeneralSettingsController.php"
click node_general_settings "https://github.com/triplet19/nts-sms/blob/main/backend/app/Settings/GeneralSettings.php"
click node_public_settings "https://github.com/triplet19/nts-sms/blob/main/backend/app/Http/Controllers/Api/PublicSettingsController.php"
click node_mail_ui "https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/admin/settings/mail/page.tsx"
click node_mail_api "https://github.com/triplet19/nts-sms/blob/main/backend/app/Http/Controllers/Api/MailSettingsController.php"
click node_mail_settings "https://github.com/triplet19/nts-sms/blob/main/backend/app/Settings/MailSettings.php"
click node_test_mail "https://github.com/triplet19/nts-sms/blob/main/backend/app/Mail/TestMail.php"
click node_brand "https://github.com/triplet19/nts-sms/blob/main/frontend/components/layout/AppLogo.tsx"

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_login_ui,node_auth_client,node_api_client,node_dashboard,node_brand toneBlue
class node_students,node_student_detail,node_grade_entry,node_grade_approval toneAmber
class node_report_list,node_report_view,node_designer toneMint
class node_roles,node_workflow,node_general_ui,node_mail_ui toneRose
class node_auth_api,node_api_routes,node_grade_api,node_approval_api,node_report_pdf,node_template_api,node_general_api,node_general_settings,node_public_settings,node_mail_api,node_mail_settings,node_test_mail,node_staff toneIndigo
```

## Components

### Access and navigation

- [Login screen](https://github.com/triplet19/nts-sms/blob/main/frontend/app/(auth)/login/page.tsx): `frontend/app/(auth)/login/page.tsx`
- [Auth client](https://github.com/triplet19/nts-sms/blob/main/frontend/lib/auth.ts): `frontend/lib/auth.ts`
- [API client](https://github.com/triplet19/nts-sms/blob/main/frontend/lib/api.ts): `frontend/lib/api.ts`
- [Dashboard](https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/dashboard/page.tsx): `frontend/app/(dashboard)/dashboard/page.tsx`
- [Branding display](https://github.com/triplet19/nts-sms/blob/main/frontend/components/layout/AppLogo.tsx): `frontend/components/layout/AppLogo.tsx`

### School records and grading

- [Student records](https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/students/page.tsx): `frontend/app/(dashboard)/students/page.tsx`
- [Student detail](https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/students/%5Bid%5D/page.tsx): `frontend/app/(dashboard)/students/[id]/page.tsx`
- [Grade submission](https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/grades/submit/page.tsx): `frontend/app/(dashboard)/grades/submit/page.tsx`
- [Grade approvals](https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/grades/approvals/page.tsx): `frontend/app/(dashboard)/grades/approvals/page.tsx`

### Report cards

- [Report cards](https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/report-cards/page.tsx): `frontend/app/(dashboard)/report-cards/page.tsx`
- [Student report card](https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/report-cards/%5BstudentId%5D/page.tsx): `frontend/app/(dashboard)/report-cards/[studentId]/page.tsx`
- [Template designer](https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/admin/report-card-designer/page.tsx): `frontend/app/(dashboard)/admin/report-card-designer/page.tsx`

### Administration

- [Roles and permissions](https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/admin/roles/page.tsx): `frontend/app/(dashboard)/admin/roles/page.tsx`
- [Approval workflows](https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/admin/workflows/page.tsx): `frontend/app/(dashboard)/admin/workflows/page.tsx`
- [General settings](https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/admin/settings/general/page.tsx): `frontend/app/(dashboard)/admin/settings/general/page.tsx`
- [Mail settings](https://github.com/triplet19/nts-sms/blob/main/frontend/app/(dashboard)/admin/settings/mail/page.tsx): `frontend/app/(dashboard)/admin/settings/mail/page.tsx`

### Backend services

- [Authentication API](https://github.com/triplet19/nts-sms/blob/main/backend/app/Http/Controllers/Api/AuthController.php): `backend/app/Http/Controllers/Api/AuthController.php`
- [API routes](https://github.com/triplet19/nts-sms/blob/main/backend/routes/api.php): `backend/routes/api.php`
- [Grade submission API](https://github.com/triplet19/nts-sms/blob/main/backend/app/Http/Controllers/Api/GradeController.php): `backend/app/Http/Controllers/Api/GradeController.php`
- [Approval API](https://github.com/triplet19/nts-sms/blob/main/backend/app/Http/Controllers/Api/ApprovalController.php): `backend/app/Http/Controllers/Api/ApprovalController.php`
- [Report-card PDF](https://github.com/triplet19/nts-sms/blob/main/backend/app/Http/Controllers/Api/ReportCardPdfController.php): `backend/app/Http/Controllers/Api/ReportCardPdfController.php`
- [Template management](https://github.com/triplet19/nts-sms/blob/main/backend/app/Http/Controllers/Api/ReportCardTemplateController.php): `backend/app/Http/Controllers/Api/ReportCardTemplateController.php`
- [General settings API](https://github.com/triplet19/nts-sms/blob/main/backend/app/Http/Controllers/Api/GeneralSettingsController.php): `backend/app/Http/Controllers/Api/GeneralSettingsController.php`
- [General settings store](https://github.com/triplet19/nts-sms/blob/main/backend/app/Settings/GeneralSettings.php): `backend/app/Settings/GeneralSettings.php`
- [Public settings API](https://github.com/triplet19/nts-sms/blob/main/backend/app/Http/Controllers/Api/PublicSettingsController.php): `backend/app/Http/Controllers/Api/PublicSettingsController.php`
- [Mail settings API](https://github.com/triplet19/nts-sms/blob/main/backend/app/Http/Controllers/Api/MailSettingsController.php): `backend/app/Http/Controllers/Api/MailSettingsController.php`
- [Mail settings store](https://github.com/triplet19/nts-sms/blob/main/backend/app/Settings/MailSettings.php): `backend/app/Settings/MailSettings.php`
- [Test email](https://github.com/triplet19/nts-sms/blob/main/backend/app/Mail/TestMail.php): `backend/app/Mail/TestMail.php`

### Other components

- **School staff**

## Connections

- School staff → Login screen: signs in
- Auth client → API client: uses (evidence: `frontend/lib/auth.ts`)
- API routes → Authentication API: routes auth (evidence: `backend/routes/api.php`)
- API routes → General settings API: routes settings (evidence: `backend/routes/api.php`)
- API routes → Mail settings API: routes settings (evidence: `backend/routes/api.php`)
- General settings API → General settings store: reads and saves (evidence: `backend/app/Http/Controllers/Api/GeneralSettingsController.php`)
- Public settings API → General settings store: reads (evidence: `backend/app/Http/Controllers/Api/PublicSettingsController.php`)
- Mail settings API → Mail settings store: reads and saves (evidence: `backend/app/Http/Controllers/Api/MailSettingsController.php`)
- Mail settings API → Test email: sends (evidence: `backend/app/Http/Controllers/Api/MailSettingsController.php`)
- Login screen → Auth client: authenticates via
- Dashboard → Student records: offers records
- Student records → Student detail: opens
- Grade submission → Grade submission API: submits to
- Grade approvals → Approval API: reviews via
- Report cards → Student report card: opens
- Student report card → Report-card PDF: requests PDF
- Template designer → Template management: edits templates via
- General settings → General settings API: updates via
- Mail settings → Mail settings API: updates via
- Branding display → Public settings API: loads branding
