# andreugrey/contact_manager_console architecture

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

- Interactive diagram: https://gitdiagram.com/andreugrey/contact_manager_console
- Repository: https://github.com/andreugrey/contact_manager_console

## Overview

This is a small console contact manager. The user enters a menu choice, the menu validates it and dispatches listing, adding, editing, or deleting to contact workflows; those workflows call SQLite-backed operations. The README provides no additional capability details. Edges reflect calls visible in the excerpts; table creation is defined but no initialization call is shown.

Main entry points: [`main.py`](https://github.com/andreugrey/contact_manager_console/blob/main/main.py) (Main menu), [`database.py`](https://github.com/andreugrey/contact_manager_console/blob/main/database.py) (Contact DB operations), [`contacts.py`](https://github.com/andreugrey/contact_manager_console/blob/main/contacts.py) (List contacts), [`tests.py`](https://github.com/andreugrey/contact_manager_console/blob/main/tests.py) (Choice validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Console interface"]
  node_menu["Main menu<br/>[main.py]"]
  node_validation["Choice validation<br/>[tests.py]"]
end

subgraph group_contacts["Contact workflows"]
  node_listing["List contacts<br/>[contacts.py]"]
  node_adding["Add contact<br/>[contacts.py]"]
  node_editing["Edit contact<br/>[contacts.py]"]
  node_deleting["Delete contact<br/>[contacts.py]"]
end

subgraph group_persistence["SQLite persistence"]
  node_dbops["Contact DB operations<br/>[database.py]"]
  node_contact_table[("Contacts table<br/>[database.py]")]
end

node_user(("User"))

node_user -->|"chooses action"| node_menu
node_menu -->|"validates choice"| node_validation
node_menu -->|"dispatches listing"| node_listing
node_menu -->|"dispatches addition"| node_adding
node_menu -->|"dispatches editing"| node_editing
node_menu -->|"dispatches deletion"| node_deleting
node_listing -->|"requests page"| node_dbops
node_adding -->|"inserts or updates"| node_dbops
node_editing -->|"checks and updates"| node_dbops
node_deleting -->|"deletes contact"| node_dbops
node_dbops -->|"queries and writes"| node_contact_table

click node_menu "https://github.com/andreugrey/contact_manager_console/blob/main/main.py"
click node_validation "https://github.com/andreugrey/contact_manager_console/blob/main/tests.py"
click node_listing "https://github.com/andreugrey/contact_manager_console/blob/main/contacts.py"
click node_adding "https://github.com/andreugrey/contact_manager_console/blob/main/contacts.py"
click node_editing "https://github.com/andreugrey/contact_manager_console/blob/main/contacts.py"
click node_deleting "https://github.com/andreugrey/contact_manager_console/blob/main/contacts.py"
click node_dbops "https://github.com/andreugrey/contact_manager_console/blob/main/database.py"
click node_contact_table "https://github.com/andreugrey/contact_manager_console/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_validation,node_user toneBlue
class node_listing,node_adding,node_editing,node_deleting toneAmber
class node_dbops,node_contact_table toneMint
```

## Components

### Console interface

- [Main menu](https://github.com/andreugrey/contact_manager_console/blob/main/main.py): `main.py`
- [Choice validation](https://github.com/andreugrey/contact_manager_console/blob/main/tests.py): `tests.py`

### Contact workflows

- [List contacts](https://github.com/andreugrey/contact_manager_console/blob/main/contacts.py): `contacts.py`
- [Add contact](https://github.com/andreugrey/contact_manager_console/blob/main/contacts.py): `contacts.py`
- [Edit contact](https://github.com/andreugrey/contact_manager_console/blob/main/contacts.py): `contacts.py`
- [Delete contact](https://github.com/andreugrey/contact_manager_console/blob/main/contacts.py): `contacts.py`

### SQLite persistence

- [Contact DB operations](https://github.com/andreugrey/contact_manager_console/blob/main/database.py): `database.py`
- [Contacts table](https://github.com/andreugrey/contact_manager_console/blob/main/database.py): `database.py`

### Other components

- **User**

## Connections

- User → Main menu: chooses action (evidence: `main.py`)
- Main menu → Choice validation: validates choice (evidence: `main.py`)
- Main menu → List contacts: dispatches listing (evidence: `main.py`)
- Main menu → Add contact: dispatches addition (evidence: `main.py`)
- Main menu → Edit contact: dispatches editing (evidence: `main.py`)
- Main menu → Delete contact: dispatches deletion (evidence: `main.py`)
- List contacts → Contact DB operations: requests page (evidence: `contacts.py`)
- Add contact → Contact DB operations: inserts or updates (evidence: `contacts.py`)
- Edit contact → Contact DB operations: checks and updates (evidence: `contacts.py`)
- Delete contact → Contact DB operations: deletes contact (evidence: `contacts.py`)
- Contact DB operations → Contacts table: queries and writes (evidence: `database.py`)
