# noorsacademy/student-management-mysql architecture

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

- Interactive diagram: https://gitdiagram.com/noorsacademy/student-management-mysql
- Repository: https://github.com/noorsacademy/student-management-mysql

## Overview

This is a small interactive student-management CLI backed by MySQL. The user selects an operation in the menu; the entry point initializes the database, then dispatches add, view, search, update, or delete actions. Setup and student operations obtain connections through a shared helper, while the operations perform their own SQL. City search is currently a placeholder. The tree omits the imported db_config.py, so the configuration dependency cannot be mapped to a repository node.

Main entry points: [`main.py`](https://github.com/noorsacademy/student-management-mysql/blob/main/main.py) (Interactive menu), [`db_connection.py`](https://github.com/noorsacademy/student-management-mysql/blob/main/db_connection.py) (Connection helper), [`student_operations.py`](https://github.com/noorsacademy/student-management-mysql/blob/main/student_operations.py) (Add student), [`setup_database.py`](https://github.com/noorsacademy/student-management-mysql/blob/main/setup_database.py) (Database setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI entry"]
  node_menu["Interactive menu<br/>[main.py]"]
end

subgraph group_students["Student operations"]
  node_add["Add student"]
  node_view["View students"]
  node_search["City search placeholder"]
  node_update["Update student"]
  node_delete["Delete student"]
end

subgraph group_persistence["Persistence"]
  node_setup["Database setup<br/>[setup_database.py]"]
  node_connection["Connection helper<br/>[db_connection.py]"]
end

node_user(("User"))
node_mysql[("MySQL database")]

node_user -->|"selects actions"| node_menu
node_menu -->|"initializes schema"| node_setup
node_menu -->|"dispatches"| node_add
node_menu -->|"dispatches"| node_view
node_menu -->|"dispatches"| node_search
node_menu -->|"dispatches"| node_update
node_menu -->|"dispatches"| node_delete
node_setup -->|"gets connection"| node_connection
node_add -->|"gets connection"| node_connection
node_view -->|"gets connection"| node_connection
node_update -->|"gets connection"| node_connection
node_delete -->|"gets connection"| node_connection
node_connection -->|"opens connection"| node_mysql
node_setup -->|"creates schema"| node_mysql
node_add -->|"inserts student"| node_mysql
node_view -->|"queries students"| node_mysql
node_update -->|"updates student"| node_mysql
node_delete -->|"queries and deletes"| node_mysql

click node_menu "https://github.com/noorsacademy/student-management-mysql/blob/main/main.py"
click node_add "https://github.com/noorsacademy/student-management-mysql/blob/main/student_operations.py"
click node_view "https://github.com/noorsacademy/student-management-mysql/blob/main/student_operations.py"
click node_search "https://github.com/noorsacademy/student-management-mysql/blob/main/student_operations.py"
click node_update "https://github.com/noorsacademy/student-management-mysql/blob/main/student_operations.py"
click node_delete "https://github.com/noorsacademy/student-management-mysql/blob/main/student_operations.py"
click node_setup "https://github.com/noorsacademy/student-management-mysql/blob/main/setup_database.py"
click node_connection "https://github.com/noorsacademy/student-management-mysql/blob/main/db_connection.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_menu,node_user toneBlue
class node_add,node_view,node_search,node_update,node_delete,node_mysql toneAmber
class node_setup,node_connection toneMint
```

## Components

### CLI entry

- [Interactive menu](https://github.com/noorsacademy/student-management-mysql/blob/main/main.py): `main.py`

### Student operations

- [Add student](https://github.com/noorsacademy/student-management-mysql/blob/main/student_operations.py): `student_operations.py`
- [View students](https://github.com/noorsacademy/student-management-mysql/blob/main/student_operations.py): `student_operations.py`
- [City search placeholder](https://github.com/noorsacademy/student-management-mysql/blob/main/student_operations.py): `student_operations.py`
- [Update student](https://github.com/noorsacademy/student-management-mysql/blob/main/student_operations.py): `student_operations.py`
- [Delete student](https://github.com/noorsacademy/student-management-mysql/blob/main/student_operations.py): `student_operations.py`

### Persistence

- [Database setup](https://github.com/noorsacademy/student-management-mysql/blob/main/setup_database.py): `setup_database.py`
- [Connection helper](https://github.com/noorsacademy/student-management-mysql/blob/main/db_connection.py): `db_connection.py`

### Other components

- **User**
- **MySQL database**

## Connections

- User → Interactive menu: selects actions (evidence: `main.py`)
- Interactive menu → Database setup: initializes schema (evidence: `main.py`)
- Interactive menu → Add student: dispatches (evidence: `main.py`)
- Interactive menu → View students: dispatches (evidence: `main.py`)
- Interactive menu → City search placeholder: dispatches (evidence: `main.py`)
- Interactive menu → Update student: dispatches (evidence: `main.py`)
- Interactive menu → Delete student: dispatches (evidence: `main.py`)
- Database setup → Connection helper: gets connection (evidence: `setup_database.py`)
- Add student → Connection helper: gets connection (evidence: `student_operations.py`)
- View students → Connection helper: gets connection (evidence: `student_operations.py`)
- Update student → Connection helper: gets connection (evidence: `student_operations.py`)
- Delete student → Connection helper: gets connection (evidence: `student_operations.py`)
- Connection helper → MySQL database: opens connection (evidence: `db_connection.py`)
- Database setup → MySQL database: creates schema (evidence: `setup_database.py`)
- Add student → MySQL database: inserts student (evidence: `student_operations.py`)
- View students → MySQL database: queries students (evidence: `student_operations.py`)
- Update student → MySQL database: updates student (evidence: `student_operations.py`)
- Delete student → MySQL database: queries and deletes (evidence: `student_operations.py`)
