# nikhil-r-parmar/student-management-system-python-mysql architecture

> Architecture diagram of the GitHub repository nikhil-r-parmar/student-management-system-python-mysql, 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/nikhil-r-parmar/student-management-system-python-mysql
- Repository: https://github.com/nikhil-r-parmar/student-management-system-python-mysql

## Overview

This command-line student manager takes menu choices from the user, dispatches CRUD actions, and reports results in the terminal. Feature handlers validate input and issue SQL through a shared MySQL connection and cursor; the README also documents name updates, whose implementation was not excerpted. The schema/setup is described in the README, but its SQL file was not sampled. Edges reflect calls and database operations visible in excerpts or documented capabilities.

Main entry points: [`database.py`](https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/database.py) (Connection and cursor), [`main.py`](https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/main.py) (Menu dispatcher), [`features/add_students.py`](https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/features/add_students.py) (Add student), [`features/all_students.py`](https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/features/all_students.py) (View students)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflow"]
  node_menu["Menu dispatcher<br/>[main.py]"]
  node_update_dispatch["Update submenu<br/>[main.py]"]
end

subgraph group_features["Student operations"]
  node_add["Add student<br/>[add_students.py]"]
  node_view["View students<br/>[all_students.py]"]
  node_search["Search by ID<br/>[search.py]"]
  node_update_name["Update name<br/>[update_name.py]"]
  node_update_age["Update age<br/>[update_age.py]"]
  node_update_city["Update city<br/>[update_city.py]"]
  node_delete["Delete student<br/>[delete.py]"]
end

subgraph group_persistence["MySQL persistence"]
  node_db_access["Connection and cursor<br/>[database.py]"]
  node_mysql[("MySQL database")]
end

node_user(("CLI user"))

node_user -->|"chooses action"| node_menu
node_menu -->|"dispatches"| node_add
node_menu -->|"dispatches"| node_view
node_menu -->|"dispatches"| node_search
node_menu -->|"opens submenu"| node_update_dispatch
node_update_dispatch -->|"dispatches"| node_update_name
node_update_dispatch -->|"dispatches"| node_update_age
node_update_dispatch -->|"dispatches"| node_update_city
node_menu -->|"dispatches"| node_delete
node_add -->|"executes SQL"| node_db_access
node_view -->|"executes SQL"| node_db_access
node_search -->|"queries record"| node_db_access
node_delete -->|"queries and deletes"| node_db_access
node_update_age -->|"queries and updates"| node_db_access
node_update_city -->|"queries and updates"| node_db_access
node_db_access -->|"connects"| node_mysql
node_update_name -.->|"uses shared connection"| node_db_access

click node_menu "https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/main.py"
click node_add "https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/features/add_students.py"
click node_view "https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/features/all_students.py"
click node_search "https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/features/search.py"
click node_update_dispatch "https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/main.py"
click node_update_name "https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/features/update_name.py"
click node_update_age "https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/features/update_age.py"
click node_update_city "https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/features/update_city.py"
click node_delete "https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/features/delete.py"
click node_db_access "https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/database.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_update_dispatch,node_user toneBlue
class node_add,node_view,node_search,node_update_name,node_update_age,node_update_city,node_delete toneAmber
class node_db_access,node_mysql toneMint
```

## Components

### CLI workflow

- [Menu dispatcher](https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/main.py): `main.py`
- [Update submenu](https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/main.py): `main.py`

### Student operations

- [Add student](https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/features/add_students.py): `features/add_students.py`
- [View students](https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/features/all_students.py): `features/all_students.py`
- [Search by ID](https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/features/search.py): `features/search.py`
- [Update name](https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/features/update_name.py): `features/update_name.py`
- [Update age](https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/features/update_age.py): `features/update_age.py`
- [Update city](https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/features/update_city.py): `features/update_city.py`
- [Delete student](https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/features/delete.py): `features/delete.py`

### MySQL persistence

- [Connection and cursor](https://github.com/nikhil-r-parmar/student-management-system-python-mysql/blob/main/database.py): `database.py`
- **MySQL database**

### Other components

- **CLI user**

## Connections

- CLI user → Menu dispatcher: chooses action (evidence: `main.py`)
- Menu dispatcher → Add student: dispatches (evidence: `main.py`)
- Menu dispatcher → View students: dispatches (evidence: `main.py`)
- Menu dispatcher → Search by ID: dispatches (evidence: `main.py`)
- Menu dispatcher → Update submenu: opens submenu (evidence: `main.py`)
- Update submenu → Update name: dispatches (evidence: `main.py`)
- Update submenu → Update age: dispatches (evidence: `main.py`)
- Update submenu → Update city: dispatches (evidence: `main.py`)
- Menu dispatcher → Delete student: dispatches (evidence: `main.py`)
- Add student → Connection and cursor: executes SQL (evidence: `features/add_students.py`)
- View students → Connection and cursor: executes SQL (evidence: `features/all_students.py`)
- Search by ID → Connection and cursor: queries record (evidence: `features/search.py`)
- Delete student → Connection and cursor: queries and deletes (evidence: `features/delete.py`)
- Update age → Connection and cursor: queries and updates (evidence: `features/update_age.py`)
- Update city → Connection and cursor: queries and updates (evidence: `features/update_city.py`)
- Connection and cursor → MySQL database: connects (evidence: `database.py`)
- Update name → Connection and cursor: uses shared connection
