# loki722-svg/calculator-app architecture

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

- Interactive diagram: https://gitdiagram.com/loki722-svg/calculator-app
- Repository: https://github.com/loki722-svg/calculator-app

## Overview

This is a minimal calculator PWA shell: the browser requests the app, while a service worker pre-caches its page and manifest and serves requests cache-first with a network fallback. The tree and excerpts do not reveal the calculator interface or calculation logic, so those are not inferred. The service-worker behavior is evidenced directly; page and manifest content was not sampled.

Main entry points: [`service-worker.js`](https://github.com/loki722-svg/calculator-app/blob/main/service-worker.js) (Service worker), [`index.html`](https://github.com/loki722-svg/calculator-app/blob/main/index.html) (App page), [`manifest.json`](https://github.com/loki722-svg/calculator-app/blob/main/manifest.json) (PWA manifest)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_browser(("Browser"))
node_worker["Service worker<br/>[service-worker.js]"]
node_page["App page<br/>[index.html]"]
node_manifest["PWA manifest<br/>[manifest.json]"]
node_cache[("Cache storage")]
node_network(("Network"))

node_browser -->|"dispatches requests"| node_worker
node_worker -->|"pre-caches assets"| node_cache
node_worker -->|"checks requests"| node_cache
node_worker -->|"fetches on miss"| node_network
node_cache -->|"returns cached response"| node_browser
node_network -->|"returns fallback response"| node_browser
node_cache -->|"stores"| node_page
node_cache -->|"stores"| node_manifest

click node_worker "https://github.com/loki722-svg/calculator-app/blob/main/service-worker.js"
click node_page "https://github.com/loki722-svg/calculator-app/blob/main/index.html"
click node_manifest "https://github.com/loki722-svg/calculator-app/blob/main/manifest.json"

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_browser toneBlue
class node_worker toneRose
class node_page,node_manifest toneTeal
class node_cache toneAmber
class node_network toneIndigo
```

## Components

### Other components

- **Browser**
- [Service worker](https://github.com/loki722-svg/calculator-app/blob/main/service-worker.js): `service-worker.js`
- [App page](https://github.com/loki722-svg/calculator-app/blob/main/index.html): `index.html`
- [PWA manifest](https://github.com/loki722-svg/calculator-app/blob/main/manifest.json): `manifest.json`
- **Cache storage**
- **Network**

## Connections

- Browser → Service worker: dispatches requests (evidence: `service-worker.js`)
- Service worker → Cache storage: pre-caches assets (evidence: `service-worker.js`)
- Service worker → Cache storage: checks requests (evidence: `service-worker.js`)
- Service worker → Network: fetches on miss (evidence: `service-worker.js`)
- Cache storage → Browser: returns cached response
- Network → Browser: returns fallback response
- Cache storage → App page: stores
- Cache storage → PWA manifest: stores
