# mehreen-14/the-butterscotch-atelier architecture

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

- Interactive diagram: https://gitdiagram.com/mehreen-14/the-butterscotch-atelier
- Repository: https://github.com/mehreen-14/the-butterscotch-atelier

## Overview

ButterscotchAtelier is an Angular art portfolio and media gallery. Visitors enter through the shared application shell, navigate home, gallery, category, or about routes, and can open gallery items in a keyboard-navigable image/video lightbox. GalleryService exposes the catalog and prepares items; LightboxService owns viewing state. The graph includes the documented-by-code route and component relationships. Asset loading details and unsampled templates are not shown, so no asset-serving or presentation-specific links are inferred.

Main entry points: [`src/app/app.routes.ts`](https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/app.routes.ts) (Route table), [`src/app/services/gallery.service.ts`](https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/services/gallery.service.ts) (Gallery service), [`src/app/app.component.ts`](https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/app.component.ts) (Application shell), [`src/app/components/gallery/gallery.component.ts`](https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/components/gallery/gallery.component.ts) (Gallery page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_bootstrap["App bootstrap<br/>[main.ts]"]
  node_config["App configuration<br/>[app.config.ts]"]
  node_routes["Route table<br/>[app.routes.ts]"]
  node_shell["Application shell<br/>[app.component.ts]"]
  node_header["Site header"]
  node_footer["Site footer"]
end

subgraph group_browse["Browse and pages"]
  node_home["Home page<br/>[home.component.ts]"]
  node_gallerypage["Gallery page"]
  node_categorypage["Category page"]
  node_about["About page<br/>[about.component.ts]"]
  node_notfound["Not found page"]
end

subgraph group_gallery["Gallery data and viewing"]
  node_catalog[("Gallery catalog<br/>[gallery-data.ts]")]
  node_categorymodel["Category model"]
  node_galleryservice["Gallery service<br/>[gallery.service.ts]"]
  node_lightboxservice["Lightbox state"]
  node_lightbox["Lightbox viewer"]
end

subgraph group_safety["Browser protection"]
  node_capture["Capture guard"]
end

node_visitor(("Visitor"))

node_bootstrap -->|"bootstraps"| node_shell
node_bootstrap -->|"configures"| node_config
node_config -->|"provides routes"| node_routes
node_routes -->|"routes to"| node_home
node_routes -->|"routes to"| node_gallerypage
node_routes -->|"routes to"| node_categorypage
node_routes -->|"routes to"| node_about
node_routes -->|"routes to"| node_notfound
node_shell -->|"renders"| node_header
node_shell -->|"renders"| node_footer
node_shell -->|"renders"| node_lightbox
node_shell -->|"enables"| node_capture
node_home -->|"reads catalog"| node_galleryservice
node_gallerypage -->|"reads catalog"| node_galleryservice
node_gallerypage -->|"opens items"| node_lightboxservice
node_categorypage -->|"loads category"| node_galleryservice
node_categorypage -->|"opens items"| node_lightboxservice
node_about -->|"reads totals"| node_galleryservice
node_galleryservice -->|"loads catalog"| node_catalog
node_galleryservice -->|"uses type"| node_categorymodel
node_lightbox -->|"controls viewer"| node_lightboxservice
node_visitor -.->|"navigates"| node_routes

click node_bootstrap "https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/main.ts"
click node_config "https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/app.config.ts"
click node_routes "https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/app.routes.ts"
click node_shell "https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/app.component.ts"
click node_header "https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/components/header/header.component.ts"
click node_footer "https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/components/footer/footer.component.ts"
click node_home "https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/components/home/home.component.ts"
click node_gallerypage "https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/components/gallery/gallery.component.ts"
click node_categorypage "https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/components/category-gallery/category-gallery.component.ts"
click node_about "https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/components/about/about.component.ts"
click node_notfound "https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/components/not-found/not-found.component.ts"
click node_catalog "https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/gallery-data.ts"
click node_categorymodel "https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/gallery-category.model.ts"
click node_galleryservice "https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/services/gallery.service.ts"
click node_lightboxservice "https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/services/lightbox.service.ts"
click node_lightbox "https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/components/lightbox/lightbox.component.ts"
click node_capture "https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/services/capture-guard.service.ts"

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_bootstrap,node_config,node_routes,node_shell,node_header,node_footer toneBlue
class node_home,node_gallerypage,node_categorypage,node_about,node_notfound toneAmber
class node_catalog,node_categorymodel,node_galleryservice,node_lightboxservice,node_lightbox toneMint
class node_capture toneRose
class node_visitor toneIndigo
```

## Components

### Application shell

- [App bootstrap](https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/main.ts): `src/main.ts`
- [App configuration](https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/app.config.ts): `src/app/app.config.ts`
- [Route table](https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/app.routes.ts): `src/app/app.routes.ts`
- [Application shell](https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/app.component.ts): `src/app/app.component.ts`
- [Site header](https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/components/header/header.component.ts): `src/app/components/header/header.component.ts`
- [Site footer](https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/components/footer/footer.component.ts): `src/app/components/footer/footer.component.ts`

### Browse and pages

- [Home page](https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/components/home/home.component.ts): `src/app/components/home/home.component.ts`
- [Gallery page](https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/components/gallery/gallery.component.ts): `src/app/components/gallery/gallery.component.ts`
- [Category page](https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/components/category-gallery/category-gallery.component.ts): `src/app/components/category-gallery/category-gallery.component.ts`
- [About page](https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/components/about/about.component.ts): `src/app/components/about/about.component.ts`
- [Not found page](https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/components/not-found/not-found.component.ts): `src/app/components/not-found/not-found.component.ts`

### Gallery data and viewing

- [Gallery catalog](https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/gallery-data.ts): `src/app/gallery-data.ts`
- [Category model](https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/gallery-category.model.ts): `src/app/gallery-category.model.ts`
- [Gallery service](https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/services/gallery.service.ts): `src/app/services/gallery.service.ts`
- [Lightbox state](https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/services/lightbox.service.ts): `src/app/services/lightbox.service.ts`
- [Lightbox viewer](https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/components/lightbox/lightbox.component.ts): `src/app/components/lightbox/lightbox.component.ts`

### Browser protection

- [Capture guard](https://github.com/mehreen-14/the-butterscotch-atelier/blob/main/src/app/services/capture-guard.service.ts): `src/app/services/capture-guard.service.ts`

### Other components

- **Visitor**

## Connections

- App bootstrap → Application shell: bootstraps (evidence: `src/main.ts`)
- App bootstrap → App configuration: configures (evidence: `src/main.ts`)
- App configuration → Route table: provides routes (evidence: `src/app/app.config.ts`)
- Route table → Home page: routes to (evidence: `src/app/app.routes.ts`)
- Route table → Gallery page: routes to (evidence: `src/app/app.routes.ts`)
- Route table → Category page: routes to (evidence: `src/app/app.routes.ts`)
- Route table → About page: routes to (evidence: `src/app/app.routes.ts`)
- Route table → Not found page: routes to (evidence: `src/app/app.routes.ts`)
- Application shell → Site header: renders (evidence: `src/app/app.component.ts`)
- Application shell → Site footer: renders (evidence: `src/app/app.component.ts`)
- Application shell → Lightbox viewer: renders (evidence: `src/app/app.component.ts`)
- Application shell → Capture guard: enables (evidence: `src/app/app.component.ts`)
- Home page → Gallery service: reads catalog (evidence: `src/app/components/home/home.component.ts`)
- Gallery page → Gallery service: reads catalog (evidence: `src/app/components/gallery/gallery.component.ts`)
- Gallery page → Lightbox state: opens items (evidence: `src/app/components/gallery/gallery.component.ts`)
- Category page → Gallery service: loads category (evidence: `src/app/components/category-gallery/category-gallery.component.ts`)
- Category page → Lightbox state: opens items (evidence: `src/app/components/category-gallery/category-gallery.component.ts`)
- About page → Gallery service: reads totals (evidence: `src/app/components/about/about.component.ts`)
- Gallery service → Gallery catalog: loads catalog (evidence: `src/app/services/gallery.service.ts`)
- Gallery service → Category model: uses type (evidence: `src/app/services/gallery.service.ts`)
- Lightbox viewer → Lightbox state: controls viewer (evidence: `src/app/components/lightbox/lightbox.component.ts`)
- Visitor → Route table: navigates
