# vedant11460/contact-book architecture

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

- Interactive diagram: https://gitdiagram.com/vedant11460/contact-book
- Repository: https://github.com/vedant11460/contact-book

## Overview

This is a small, single-file contact-book application. Its workflow is a top-level scripted session that loads saved contacts, creates and validates contacts, supports case-insensitive lookup and sorted display, handles deletion and undo, then saves the current contacts as JSON. ContactBook owns the in-memory dictionary and deletion stack; Contact supplies validation and serialization behavior. The file is loaded and saved by ContactBook. All shown relationships are supported by contacts.py; the README corroborates the advertised capabilities.

Main entry points: [`contacts.py`](https://github.com/vedant11460/contact-book/blob/main/contacts.py) (Contact Book)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_session["Scripted Session<br/>[contacts.py]"]
node_book["Contact Book<br/>[contacts.py]"]
node_contact["Contact Model<br/>[contacts.py]"]
node_jsonfile[("JSON Contact File<br/>[contacts.py]")]

node_user -->|"runs"| node_session
node_session -->|"loads and manages"| node_book
node_book -->|"validates and serializes"| node_contact
node_book -->|"reads and writes"| node_jsonfile

click node_session "https://github.com/vedant11460/contact-book/blob/main/contacts.py"
click node_book "https://github.com/vedant11460/contact-book/blob/main/contacts.py"
click node_contact "https://github.com/vedant11460/contact-book/blob/main/contacts.py"
click node_jsonfile "https://github.com/vedant11460/contact-book/blob/main/contacts.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_user toneBlue
class node_session,node_book toneTeal
class node_contact toneIndigo
class node_jsonfile toneAmber
```

## Components

### Other components

- **User**
- [Scripted Session](https://github.com/vedant11460/contact-book/blob/main/contacts.py): `contacts.py`
- [Contact Book](https://github.com/vedant11460/contact-book/blob/main/contacts.py): `contacts.py`
- [Contact Model](https://github.com/vedant11460/contact-book/blob/main/contacts.py): `contacts.py`
- [JSON Contact File](https://github.com/vedant11460/contact-book/blob/main/contacts.py): `contacts.py`

## Connections

- User → Scripted Session: runs (evidence: `README.md`)
- Scripted Session → Contact Book: loads and manages (evidence: `contacts.py`)
- Contact Book → Contact Model: validates and serializes (evidence: `contacts.py`)
- Contact Book → JSON Contact File: reads and writes (evidence: `contacts.py`)
