# nikyls007/insurance_managment_system_py architecture

> Architecture diagram of the GitHub repository nikyls007/insurance_managment_system_py, 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/nikyls007/insurance_managment_system_py
- Repository: https://github.com/nikyls007/insurance_managment_system_py

## Overview

This is a console-based insurance policy administration program. A customer or agent starts at the menu; the program initializes its server, handles customer registration or login, and lets authenticated customers view details and select a health, motor, or general policy. Agent functions provide customer/policy viewing. Methods.py owns the database operations, while Policy.py handles policy selection. Claims are a documented capability, but the supplied excerpts do not show their implementation or control flow; that branch is therefore marked unverified. Database details and some internal calls are limited to the excerpts.

Main entry points: [`Methods.py`](https://github.com/nikyls007/insurance_managment_system_py/blob/master/Methods.py) (Registration and login), [`Policy.py`](https://github.com/nikyls007/insurance_managment_system_py/blob/master/Policy.py) (Policy selection), [`main.py`](https://github.com/nikyls007/insurance_managment_system_py/blob/master/main.py) (Console entry), [`Customer.py`](https://github.com/nikyls007/insurance_managment_system_py/blob/master/Customer.py) (Customer record display)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Console and access"]
  node_console["Console entry<br/>[main.py]"]
  node_access["Registration and login<br/>[Methods.py]"]
end

subgraph group_insurance["Insurance operations"]
  node_customer_record["Customer record display<br/>[Customer.py]"]
  node_policy_selection["Policy selection<br/>[Policy.py]"]
  node_policy_admin["Policy administration<br/>[Methods.py]"]
  node_agent_view["Agent information view<br/>[Methods.py]"]
  node_claims["Claims<br/>[Methods.py]"]
end

subgraph group_persistence["Persistence"]
  node_db_ops["Database operations<br/>[Methods.py]"]
  node_mysql[("MySQL database")]
end

node_customer_actor(("Customer"))
node_agent_actor(("Agent"))

node_customer_actor -->|"starts"| node_console
node_agent_actor -->|"starts"| node_console
node_console -->|"starts server and menu"| node_access
node_access -->|"routes policy access"| node_policy_selection
node_policy_selection -->|"inserts policy"| node_policy_admin
node_policy_selection -->|"requests customer details"| node_policy_admin
node_policy_admin -->|"imports model"| node_customer_record
node_access -->|"registers and checks login"| node_db_ops
node_policy_admin -->|"stores and retrieves policies"| node_db_ops
node_agent_view -->|"queries customer policies"| node_db_ops
node_db_ops -->|"queries database"| node_mysql
node_access -.->|"may expose claims"| node_claims

click node_console "https://github.com/nikyls007/insurance_managment_system_py/blob/master/main.py"
click node_access "https://github.com/nikyls007/insurance_managment_system_py/blob/master/Methods.py"
click node_customer_record "https://github.com/nikyls007/insurance_managment_system_py/blob/master/Customer.py"
click node_policy_selection "https://github.com/nikyls007/insurance_managment_system_py/blob/master/Policy.py"
click node_policy_admin "https://github.com/nikyls007/insurance_managment_system_py/blob/master/Methods.py"
click node_agent_view "https://github.com/nikyls007/insurance_managment_system_py/blob/master/Methods.py"
click node_claims "https://github.com/nikyls007/insurance_managment_system_py/blob/master/Methods.py"
click node_db_ops "https://github.com/nikyls007/insurance_managment_system_py/blob/master/Methods.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_console,node_access toneBlue
class node_customer_record,node_policy_selection,node_policy_admin,node_agent_view,node_claims toneAmber
class node_db_ops,node_mysql toneMint
class node_customer_actor,node_agent_actor toneIndigo
```

## Components

### Console and access

- [Console entry](https://github.com/nikyls007/insurance_managment_system_py/blob/master/main.py): `main.py`
- [Registration and login](https://github.com/nikyls007/insurance_managment_system_py/blob/master/Methods.py): `Methods.py`

### Insurance operations

- [Customer record display](https://github.com/nikyls007/insurance_managment_system_py/blob/master/Customer.py): `Customer.py`
- [Policy selection](https://github.com/nikyls007/insurance_managment_system_py/blob/master/Policy.py): `Policy.py`
- [Policy administration](https://github.com/nikyls007/insurance_managment_system_py/blob/master/Methods.py): `Methods.py`
- [Agent information view](https://github.com/nikyls007/insurance_managment_system_py/blob/master/Methods.py): `Methods.py`
- [Claims](https://github.com/nikyls007/insurance_managment_system_py/blob/master/Methods.py): `Methods.py`

### Persistence

- [Database operations](https://github.com/nikyls007/insurance_managment_system_py/blob/master/Methods.py): `Methods.py`
- **MySQL database**

### Other components

- **Customer**
- **Agent**

## Connections

- Customer → Console entry: starts (evidence: `README.md`)
- Agent → Console entry: starts (evidence: `README.md`)
- Console entry → Registration and login: starts server and menu (evidence: `main.py`)
- Registration and login → Policy selection: routes policy access (evidence: `Methods.py`)
- Policy selection → Policy administration: inserts policy (evidence: `Policy.py`)
- Policy selection → Policy administration: requests customer details (evidence: `Policy.py`)
- Policy administration → Customer record display: imports model (evidence: `Methods.py`)
- Registration and login → Database operations: registers and checks login (evidence: `Methods.py`)
- Policy administration → Database operations: stores and retrieves policies (evidence: `Methods.py`)
- Agent information view → Database operations: queries customer policies (evidence: `Methods.py`)
- Database operations → MySQL database: queries database (evidence: `Methods.py`)
- Registration and login → Claims: may expose claims (evidence: `Methods.py`)
