# xzawar/lab-2-web architecture

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

- Interactive diagram: https://gitdiagram.com/xzawar/lab-2-web
- Repository: https://github.com/xzawar/lab-2-web

## Overview

This is a small static profile page with a contact form. Visitors submit a name and topic, which the page saves in browser localStorage and restores on later visits; they can also clear the saved values. The README documents semantic HTML and accessible form fields, but the HTML excerpts were not provided, so page-to-script wiring is not verified. The graph shows the form behavior visible in script.js and the documented page capabilities.

Main entry points: [`script.js`](https://github.com/xzawar/lab-2-web/blob/main/script.js) (Form handlers), [`index.html`](https://github.com/xzawar/lab-2-web/blob/main/index.html) (Contact form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_profile["Profile page"]
  node_page["Profile page<br/>[index.html]"]
  node_form["Contact form<br/>[index.html]"]
end

subgraph group_behavior["Form behavior"]
  node_handler["Form handlers<br/>[script.js]"]
  node_storage[("Browser localStorage")]
end

node_visitor(("Visitor"))

node_visitor -->|"views"| node_page
node_visitor -->|"submits"| node_form
node_form -->|"triggers"| node_handler
node_handler -->|"writes"| node_storage
node_storage -->|"restores"| node_handler
node_visitor -->|"clears saved data"| node_handler

click node_page "https://github.com/xzawar/lab-2-web/blob/main/index.html"
click node_form "https://github.com/xzawar/lab-2-web/blob/main/index.html"
click node_handler "https://github.com/xzawar/lab-2-web/blob/main/script.js"

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_page,node_form toneBlue
class node_handler,node_storage toneAmber
class node_visitor toneIndigo
```

## Components

### Profile page

- [Profile page](https://github.com/xzawar/lab-2-web/blob/main/index.html): `index.html`
- [Contact form](https://github.com/xzawar/lab-2-web/blob/main/index.html): `index.html`

### Form behavior

- [Form handlers](https://github.com/xzawar/lab-2-web/blob/main/script.js): `script.js`
- **Browser localStorage**

### Other components

- **Visitor**

## Connections

- Visitor → Profile page: views (evidence: `README.md`)
- Visitor → Contact form: submits (evidence: `README.md`)
- Contact form → Form handlers: triggers (evidence: `script.js`)
- Form handlers → Browser localStorage: writes (evidence: `script.js`)
- Browser localStorage → Form handlers: restores (evidence: `script.js`)
- Visitor → Form handlers: clears saved data (evidence: `script.js`)
