# maaz-319/sms architecture

> Architecture diagram of the GitHub repository maaz-319/sms, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/maaz-319/sms
- Repository: https://github.com/maaz-319/sms

## Overview

##### Project Type and Purpose
- This is a C++ console-based School Management System. It’s a full-application (not web-based) with a menu-driven UI, object-oriented domain model (Person → Student/Teacher/Staff), file-based persistence, and an integrated test suite.

##### File Structure Analysis
- Top-level directories:
- /      → All header files (Person, Student, Teacher, Staff, Database_handler, Utility)
- src/          → Implementation (.cpp) including main.cpp
- data/         → Runtime flat-file storage (students.txt, teachers.txt, staff.txt)
- build/        → Compiled executables and test scripts
- tests/        → UnitTest.cpp, IntegrationTest.cpp + README
- docs/         → API, UserManual, DeveloperGuide
- Key configuration/build triggers:
- build scripts (.bat), g++ compile commands in README
- Architectural hints:
- Abstract base class (Person) with derived types
- Database_handler for file I/O
- Utility module for console formatting
- main.cpp orchestrates UI and leverages Database_handler

##### README Insights
- Emphasizes OOP principles, polymorphism, inheritance, dynamic memory, file I/O
- Unified ID system across all Person types
- Six core use-cases exposed via menu
- Testing via UnitTest.exe and IntegrationTest.exe

## Diagram (Mermaid)

```mermaid
flowchart TD
  subgraph "Console UI Layer"
    UI["ConsoleUI\n(main.cpp, Utility)"]:::ui
  end

  subgraph "Service/Controller Layer"
    SC["ServiceController\n(menu logic)"]:::service
  end

  subgraph "Domain Model Layer"
    Person["Person"]:::domain
    Student["Student"]:::domain
    Teacher["Teacher"]:::domain
    Staff["Staff"]:::domain
  end

  subgraph "Persistence Layer"
    DB["Database_handler"]:::persistence
    NotePersist(("Max 100 records\nUnified ID from 1000")):::note
  end

  subgraph "Data Storage"
    FS1["students.txt"]:::storage
    FS2["teachers.txt"]:::storage
    FS3["staff.txt"]:::storage
  end

  subgraph "Test Suite"
    UT["UnitTest.exe"]:::test
    IT["IntegrationTest.exe"]:::test
  end

  subgraph "Documentation"
    API["API.md"]:::docs
    DG["DeveloperGuide.md"]:::docs
    UM["UserManual.md"]:::docs
  end

  UI -->|"displayMenu()"| SC
  SC -->|"createPerson()"| Person
  SC -->|"manipulateObjects()"| Student
  SC -->|"manipulateObjects()"| Teacher
  SC -->|"manipulateObjects()"| Staff
  SC -->|"loadRecords()"| DB
  SC -->|"saveRecord()"| DB
  DB -->|"read/write"| FS1
  DB -->|"read/write"| FS2
  DB -->|"read/write"| FS3

  UT -.->|"tests domain"| Person
  UT -.->|"tests persistence"| DB
  IT -.->|"integration tests"| SC
  IT -.->|"integration tests"| DB

  classDef ui fill:#D6E9F8,stroke:#31708F,color:#31708F;
  classDef service fill:#F2DEDE,stroke:#A94442,color:#A94442;
  classDef domain fill:#DFF0D8,stroke:#3C763D,color:#3C763D;
  classDef persistence fill:#FCF8E3,stroke:#8A6D3B,color:#8A6D3B;
  classDef storage fill:#EEEEEE,stroke:#AAAAAA,color:#666666;
  classDef test fill:#EBDEF0,stroke:#7D3C98,color:#7D3C98;
  classDef docs fill:#F5F5F5,stroke:#999999,color:#333333;
  classDef note fill:#FFFFFF,stroke:#999999,color:#999999,stroke-dasharray: 5 5;

  click UI "https://github.com/maaz-319/sms/blob/main/src/main.cpp"
  click UI "https://github.com/maaz-319/sms/blob/main/include/Utility.h"
  click UI "https://github.com/maaz-319/sms/blob/main/src/Utility.cpp"
  click SC "https://github.com/maaz-319/sms/blob/main/src/main.cpp"
  click SC "https://github.com/maaz-319/sms/blob/main/include/Utility.h"
  click SC "https://github.com/maaz-319/sms/blob/main/src/Utility.cpp"
  click Person "https://github.com/maaz-319/sms/blob/main/include/Person.h"
  click Person "https://github.com/maaz-319/sms/blob/main/src/Person.cpp"
  click Student "https://github.com/maaz-319/sms/blob/main/include/Student.h"
  click Student "https://github.com/maaz-319/sms/blob/main/src/Student.cpp"
  click Teacher "https://github.com/maaz-319/sms/blob/main/include/Teacher.h"
  click Teacher "https://github.com/maaz-319/sms/blob/main/src/Teacher.cpp"
  click Staff "https://github.com/maaz-319/sms/blob/main/include/Staff.h"
  click Staff "https://github.com/maaz-319/sms/blob/main/src/Staff.cpp"
  click DB "https://github.com/maaz-319/sms/blob/main/include/Database_handler.h"
  click DB "https://github.com/maaz-319/sms/blob/main/src/Database_handler.cpp"
  click FS1 "https://github.com/maaz-319/sms/blob/main/data/students.txt"
  click FS2 "https://github.com/maaz-319/sms/blob/main/data/teachers.txt"
  click FS3 "https://github.com/maaz-319/sms/blob/main/data/staff.txt"
  click UT "https://github.com/maaz-319/sms/blob/main/tests/UnitTest.cpp"
  click IT "https://github.com/maaz-319/sms/blob/main/tests/IntegrationTest.cpp"
  click API "https://github.com/maaz-319/sms/blob/main/docs/API.md"
  click DG "https://github.com/maaz-319/sms/blob/main/docs/DeveloperGuide.md"
  click UM "https://github.com/maaz-319/sms/blob/main/docs/UserManual.md"
```
