# abdallahelmohammady-stack/g2-in-another-life architecture

> Architecture diagram of the GitHub repository abdallahelmohammady-stack/g2-in-another-life, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abdallahelmohammady-stack/g2-in-another-life
- Repository: https://github.com/abdallahelmohammady-stack/g2-in-another-life

## Overview

This is a static website catalogue: the browser loads site records, normalizes them, and renders a searchable, sortable gallery with visit links and summary counts. The sampled viewer also supports theme preferences, local fallback caching, and automatic site logos with a generated-avatar fallback. The single JavaScript file is the main runtime module; the HTML, JSON, and CSS provide the page, catalogue data, and presentation. Source excerpts are partial, so only directly evidenced connections are shown.

Main entry points: [`js/viewer.js`](https://github.com/abdallahelmohammady-stack/g2-in-another-life/blob/main/js/viewer.js) (Gallery viewer), [`index.html`](https://github.com/abdallahelmohammady-stack/g2-in-another-life/blob/main/index.html) (Catalogue page), [`data/sites.json`](https://github.com/abdallahelmohammady-stack/g2-in-another-life/blob/main/data/sites.json) (Site records), [`css/style.css`](https://github.com/abdallahelmohammady-stack/g2-in-another-life/blob/main/css/style.css) (Gallery styles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalogue["Catalogue experience"]
  node_logo_sources["Logo sources"]
end

subgraph group_viewer["Viewer runtime"]
  node_viewer["Gallery viewer<br/>[viewer.js]"]
  node_browser_cache[("Browser storage")]
end

subgraph group_assets["Site assets"]
  node_page["Catalogue page<br/>[index.html]"]
  node_records["Site records<br/>[sites.json]"]
  node_styles["Gallery styles<br/>[style.css]"]
end

node_visitor(("Visitor"))
node_site_targets["Listed websites"]

node_visitor -->|"opens"| node_page
node_page -.->|"loads"| node_viewer
node_viewer -->|"fetches"| node_records
node_viewer -->|"reads fallback"| node_browser_cache
node_viewer -->|"saves cache"| node_browser_cache
node_viewer -->|"renders gallery"| node_page
node_viewer -->|"loads icons"| node_logo_sources
node_viewer -->|"links visits"| node_site_targets
node_page -.->|"uses styles"| node_styles

click node_page "https://github.com/abdallahelmohammady-stack/g2-in-another-life/blob/main/index.html"
click node_viewer "https://github.com/abdallahelmohammady-stack/g2-in-another-life/blob/main/js/viewer.js"
click node_records "https://github.com/abdallahelmohammady-stack/g2-in-another-life/blob/main/data/sites.json"
click node_styles "https://github.com/abdallahelmohammady-stack/g2-in-another-life/blob/main/css/style.css"

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_logo_sources toneBlue
class node_viewer,node_browser_cache toneAmber
class node_page,node_records,node_styles toneMint
class node_visitor,node_site_targets toneIndigo
```

## Components

### Catalogue experience

- **Logo sources**

### Viewer runtime

- [Gallery viewer](https://github.com/abdallahelmohammady-stack/g2-in-another-life/blob/main/js/viewer.js): `js/viewer.js`
- **Browser storage**

### Site assets

- [Catalogue page](https://github.com/abdallahelmohammady-stack/g2-in-another-life/blob/main/index.html): `index.html`
- [Site records](https://github.com/abdallahelmohammady-stack/g2-in-another-life/blob/main/data/sites.json): `data/sites.json`
- [Gallery styles](https://github.com/abdallahelmohammady-stack/g2-in-another-life/blob/main/css/style.css): `css/style.css`

### Other components

- **Visitor**
- **Listed websites**

## Connections

- Visitor → Catalogue page: opens
- Catalogue page → Gallery viewer: loads
- Gallery viewer → Site records: fetches (evidence: `js/viewer.js`)
- Gallery viewer → Browser storage: reads fallback (evidence: `js/viewer.js`)
- Gallery viewer → Browser storage: saves cache (evidence: `js/viewer.js`)
- Gallery viewer → Catalogue page: renders gallery (evidence: `js/viewer.js`)
- Gallery viewer → Logo sources: loads icons (evidence: `js/viewer.js`)
- Gallery viewer → Listed websites: links visits (evidence: `js/viewer.js`)
- Catalogue page → Gallery styles: uses styles
