# jaswanth-jrk/smart-address-book-system architecture

> Architecture diagram of the GitHub repository jaswanth-jrk/smart-address-book-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jaswanth-jrk/smart-address-book-system
- Repository: https://github.com/jaswanth-jrk/smart-address-book-system

## Overview

Smart Address Book provides two contact-management interfaces: a C++ console program and a browser-based website. Both support contact management, search, favorites, grouping, priorities, sorting, reminders, and creative names; the C++ program persists to text and JSON, while the website starts from JSON and keeps edits in browser storage for later export. The website also provides demo login/logout. The README documents additional capabilities whose implementation is not shown in the sampled source; those are represented at the enclosing source-file level.

Main entry points: [`app.js`](https://github.com/jaswanth-jrk/smart-address-book-system/blob/main/app.js) (Contact management), [`auth.js`](https://github.com/jaswanth-jrk/smart-address-book-system/blob/main/auth.js) (Session auth), [`Smart_Address_Book_Final.cpp`](https://github.com/jaswanth-jrk/smart-address-book-system/blob/main/Smart_Address_Book_Final.cpp) (Console address book), [`contacts.json`](https://github.com/jaswanth-jrk/smart-address-book-system/blob/main/contacts.json) (Shared contacts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Website"]
  node_login["Login page<br/>[login.html]"]
  node_auth["Session auth<br/>[auth.js]"]
  node_dashboard["Contact dashboard<br/>[index.html]"]
  node_webapp["Contact management<br/>[app.js]"]
  node_logout["Logout page<br/>[logout.html]"]
end

subgraph group_cpp["Console app"]
  node_cppapp["Console address book"]
end

subgraph group_storage["Contact data"]
  node_json["Shared contacts<br/>[contacts.json]"]
  node_text["Text contacts<br/>[contacts.txt]"]
  node_local[("Browser contact storage")]
  node_session[("Browser session storage")]
end

node_browser(("Website user"))
node_terminal(("Console user"))

node_browser -->|"opens"| node_login
node_login -->|"checks credentials"| node_auth
node_auth -->|"stores session"| node_session
node_browser -->|"opens"| node_dashboard
node_dashboard -->|"starts"| node_webapp
node_webapp -->|"checks session"| node_auth
node_auth -->|"reads session"| node_session
node_webapp -->|"loads fallback"| node_json
node_webapp -->|"loads and saves edits"| node_local
node_webapp -->|"exports download"| node_json
node_browser -->|"imports JSON"| node_webapp
node_browser -->|"opens"| node_logout
node_logout -->|"signs out"| node_auth
node_auth -->|"removes session"| node_session
node_terminal -->|"uses"| node_cppapp
node_cppapp -->|"loads and saves"| node_json
node_cppapp -->|"loads and saves"| node_text

click node_login "https://github.com/jaswanth-jrk/smart-address-book-system/blob/main/login.html"
click node_auth "https://github.com/jaswanth-jrk/smart-address-book-system/blob/main/auth.js"
click node_dashboard "https://github.com/jaswanth-jrk/smart-address-book-system/blob/main/index.html"
click node_webapp "https://github.com/jaswanth-jrk/smart-address-book-system/blob/main/app.js"
click node_logout "https://github.com/jaswanth-jrk/smart-address-book-system/blob/main/logout.html"
click node_cppapp "https://github.com/jaswanth-jrk/smart-address-book-system/blob/main/Smart_Address_Book_Final.cpp"
click node_json "https://github.com/jaswanth-jrk/smart-address-book-system/blob/main/contacts.json"
click node_text "https://github.com/jaswanth-jrk/smart-address-book-system/blob/main/contacts.txt"

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_login,node_auth,node_dashboard,node_webapp,node_logout,node_browser,node_terminal toneBlue
class node_cppapp toneAmber
class node_json,node_text,node_local,node_session toneMint
```

## Components

### Website

- [Login page](https://github.com/jaswanth-jrk/smart-address-book-system/blob/main/login.html): `login.html`
- [Session auth](https://github.com/jaswanth-jrk/smart-address-book-system/blob/main/auth.js): `auth.js`
- [Contact dashboard](https://github.com/jaswanth-jrk/smart-address-book-system/blob/main/index.html): `index.html`
- [Contact management](https://github.com/jaswanth-jrk/smart-address-book-system/blob/main/app.js): `app.js`
- [Logout page](https://github.com/jaswanth-jrk/smart-address-book-system/blob/main/logout.html): `logout.html`

### Console app

- [Console address book](https://github.com/jaswanth-jrk/smart-address-book-system/blob/main/Smart_Address_Book_Final.cpp): `Smart_Address_Book_Final.cpp`

### Contact data

- [Shared contacts](https://github.com/jaswanth-jrk/smart-address-book-system/blob/main/contacts.json): `contacts.json`
- [Text contacts](https://github.com/jaswanth-jrk/smart-address-book-system/blob/main/contacts.txt): `contacts.txt`
- **Browser contact storage**
- **Browser session storage**

### Other components

- **Website user**
- **Console user**

## Connections

- Website user → Login page: opens
- Login page → Session auth: checks credentials
- Session auth → Browser session storage: stores session
- Website user → Contact dashboard: opens
- Contact dashboard → Contact management: starts
- Contact management → Session auth: checks session
- Session auth → Browser session storage: reads session
- Contact management → Shared contacts: loads fallback
- Contact management → Browser contact storage: loads and saves edits
- Contact management → Shared contacts: exports download
- Website user → Contact management: imports JSON
- Website user → Logout page: opens
- Logout page → Session auth: signs out
- Session auth → Browser session storage: removes session
- Console user → Console address book: uses
- Console address book → Shared contacts: loads and saves
- Console address book → Text contacts: loads and saves
