# sarayuyalagandula/addressbook architecture

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

## Overview

AddressBook is a menu-driven C contact manager. The user selects an operation in the main loop; the program loads the address book at startup, performs contact operations in memory, and can save changes to CSV. The documented workflow also includes searching, editing, deleting, and listing by name, phone, or email, with input validation. Feature implementations are grouped in contact.c; the excerpts show selected calls and persistence behavior, but not every operation’s internals.

Main entry points: [`main.c`](https://github.com/sarayuyalagandula/addressbook/blob/main/main.c) (Menu and Dispatch), [`contact.c`](https://github.com/sarayuyalagandula/addressbook/blob/main/contact.c) (Load and Save), [`database.csv`](https://github.com/sarayuyalagandula/addressbook/blob/main/database.csv) (Contact Database), [`contact.h`](https://github.com/sarayuyalagandula/addressbook/blob/main/contact.h) (Contact Data Model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_menu["Menu and Dispatch<br/>[main.c]"]
  node_model["Contact Data Model<br/>[contact.h]"]
end

subgraph group_contacts["Contact Operations"]
  node_create["Create Contact<br/>[contact.c]"]
  node_search["Search Contact<br/>[contact.c]"]
  node_edit["Edit Contact<br/>[contact.c]"]
  node_delete["Delete Contact<br/>[contact.c]"]
  node_list["Sorted Contact Listing<br/>[contact.c]"]
  node_validation["Input Validation<br/>[contact.c]"]
  node_lookup["Contact Lookup Helpers<br/>[contact.c]"]
end

subgraph group_storage["Persistence"]
  node_persistence["Load and Save<br/>[contact.c]"]
  node_csv[("Contact Database<br/>[database.csv]")]
end

node_user(("User"))

node_user -->|"selects operation"| node_menu
node_menu -->|"uses data"| node_model
node_menu -->|"loads at startup"| node_persistence
node_menu -->|"dispatches"| node_create
node_menu -->|"dispatches"| node_search
node_menu -->|"dispatches"| node_edit
node_menu -->|"dispatches"| node_delete
node_menu -->|"dispatches"| node_list
node_menu -->|"saves on request"| node_persistence
node_edit -->|"validates input"| node_validation
node_search -->|"uses lookup"| node_lookup
node_edit -->|"uses lookup"| node_lookup
node_persistence -->|"writes CSV"| node_csv
node_persistence -.->|"loads CSV"| node_csv

click node_menu "https://github.com/sarayuyalagandula/addressbook/blob/main/main.c"
click node_model "https://github.com/sarayuyalagandula/addressbook/blob/main/contact.h"
click node_create "https://github.com/sarayuyalagandula/addressbook/blob/main/contact.c"
click node_search "https://github.com/sarayuyalagandula/addressbook/blob/main/contact.c"
click node_edit "https://github.com/sarayuyalagandula/addressbook/blob/main/contact.c"
click node_delete "https://github.com/sarayuyalagandula/addressbook/blob/main/contact.c"
click node_list "https://github.com/sarayuyalagandula/addressbook/blob/main/contact.c"
click node_validation "https://github.com/sarayuyalagandula/addressbook/blob/main/contact.c"
click node_lookup "https://github.com/sarayuyalagandula/addressbook/blob/main/contact.c"
click node_persistence "https://github.com/sarayuyalagandula/addressbook/blob/main/contact.c"
click node_csv "https://github.com/sarayuyalagandula/addressbook/blob/main/database.csv"

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_model,node_user toneBlue
class node_create,node_search,node_edit,node_delete,node_list,node_validation,node_lookup toneAmber
class node_persistence,node_csv toneMint
```

## Components

### Application

- [Menu and Dispatch](https://github.com/sarayuyalagandula/addressbook/blob/main/main.c): `main.c`
- [Contact Data Model](https://github.com/sarayuyalagandula/addressbook/blob/main/contact.h): `contact.h`

### Contact Operations

- [Create Contact](https://github.com/sarayuyalagandula/addressbook/blob/main/contact.c): `contact.c`
- [Search Contact](https://github.com/sarayuyalagandula/addressbook/blob/main/contact.c): `contact.c`
- [Edit Contact](https://github.com/sarayuyalagandula/addressbook/blob/main/contact.c): `contact.c`
- [Delete Contact](https://github.com/sarayuyalagandula/addressbook/blob/main/contact.c): `contact.c`
- [Sorted Contact Listing](https://github.com/sarayuyalagandula/addressbook/blob/main/contact.c): `contact.c`
- [Input Validation](https://github.com/sarayuyalagandula/addressbook/blob/main/contact.c): `contact.c`
- [Contact Lookup Helpers](https://github.com/sarayuyalagandula/addressbook/blob/main/contact.c): `contact.c`

### Persistence

- [Load and Save](https://github.com/sarayuyalagandula/addressbook/blob/main/contact.c): `contact.c`
- [Contact Database](https://github.com/sarayuyalagandula/addressbook/blob/main/database.csv): `database.csv`

### Other components

- **User**

## Connections

- User → Menu and Dispatch: selects operation (evidence: `README.md`)
- Menu and Dispatch → Contact Data Model: uses data (evidence: `main.c`)
- Menu and Dispatch → Load and Save: loads at startup (evidence: `main.c`)
- Menu and Dispatch → Create Contact: dispatches (evidence: `main.c`)
- Menu and Dispatch → Search Contact: dispatches (evidence: `main.c`)
- Menu and Dispatch → Edit Contact: dispatches (evidence: `main.c`)
- Menu and Dispatch → Delete Contact: dispatches (evidence: `main.c`)
- Menu and Dispatch → Sorted Contact Listing: dispatches (evidence: `main.c`)
- Menu and Dispatch → Load and Save: saves on request (evidence: `main.c`)
- Edit Contact → Input Validation: validates input (evidence: `contact.c`)
- Search Contact → Contact Lookup Helpers: uses lookup (evidence: `contact.c`)
- Edit Contact → Contact Lookup Helpers: uses lookup (evidence: `contact.c`)
- Load and Save → Contact Database: writes CSV (evidence: `contact.c`)
- Load and Save → Contact Database: loads CSV
