# vknaidu-07/form-assistant architecture

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

- Interactive diagram: https://gitdiagram.com/vknaidu-07/form-assistant
- Repository: https://github.com/vknaidu-07/form-assistant

## Overview

TTD Form Assistant is a human-in-the-loop Chrome extension that stores encrypted booking profiles and uses them to preview and fill visible fields on the TTD booking form. The user creates or unlocks a profile, reviews a preview, fills the form, then completes booking steps manually. The graph distinguishes profile handling, encryption, page-field handling, and storage access. Some content-script message handling and manifest wiring were not sampled, so the popup-to-page edge reflects the popup’s shown dispatch rather than an inspected receiver.

Main entry points: [`popup.js`](https://github.com/vknaidu-07/form-assistant/blob/main/popup.js) (Profile editor), [`content.js`](https://github.com/vknaidu-07/form-assistant/blob/main/content.js) (Field preview and fill), [`service-worker.js`](https://github.com/vknaidu-07/form-assistant/blob/main/service-worker.js) (Storage restriction), [`crypto.js`](https://github.com/vknaidu-07/form-assistant/blob/main/crypto.js) (Vault crypto)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_profile["Profile management"]
  node_popup["Profile editor<br/>[popup.js]"]
end

subgraph group_page["Form assistance"]
  node_content["Field preview and fill<br/>[content.js]"]
  node_portal["TTD booking form"]
end

subgraph group_security["Vault security"]
  node_crypto["Vault crypto<br/>[crypto.js]"]
  node_storage[("Chrome storage")]
  node_worker["Storage restriction<br/>[service-worker.js]"]
end

node_user(("User"))

node_user -->|"edits profile"| node_popup
node_popup -->|"encrypts and decrypts"| node_crypto
node_popup -->|"reads and saves vault"| node_storage
node_worker -->|"restricts access"| node_storage
node_popup -->|"dispatches preview and fill"| node_content
node_content -->|"detects and fills fields"| node_portal
node_user -->|"completes booking manually"| node_portal

click node_popup "https://github.com/vknaidu-07/form-assistant/blob/main/popup.js"
click node_crypto "https://github.com/vknaidu-07/form-assistant/blob/main/crypto.js"
click node_worker "https://github.com/vknaidu-07/form-assistant/blob/main/service-worker.js"
click node_content "https://github.com/vknaidu-07/form-assistant/blob/main/content.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_popup,node_user toneBlue
class node_content,node_portal toneAmber
class node_crypto,node_storage,node_worker toneMint
```

## Components

### Profile management

- [Profile editor](https://github.com/vknaidu-07/form-assistant/blob/main/popup.js): `popup.js`

### Form assistance

- [Field preview and fill](https://github.com/vknaidu-07/form-assistant/blob/main/content.js): `content.js`
- **TTD booking form**

### Vault security

- [Vault crypto](https://github.com/vknaidu-07/form-assistant/blob/main/crypto.js): `crypto.js`
- **Chrome storage**
- [Storage restriction](https://github.com/vknaidu-07/form-assistant/blob/main/service-worker.js): `service-worker.js`

### Other components

- **User**

## Connections

- User → Profile editor: edits profile (evidence: `README.md`)
- Profile editor → Vault crypto: encrypts and decrypts (evidence: `popup.js`)
- Profile editor → Chrome storage: reads and saves vault (evidence: `popup.js`)
- Storage restriction → Chrome storage: restricts access (evidence: `service-worker.js`)
- Profile editor → Field preview and fill: dispatches preview and fill (evidence: `popup.js`)
- Field preview and fill → TTD booking form: detects and fills fields (evidence: `content.js`)
- User → TTD booking form: completes booking manually (evidence: `README.md`)
