# anshumanmahato/happy-birthday-card architecture

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

- Interactive diagram: https://gitdiagram.com/anshumanmahato/happy-birthday-card
- Repository: https://github.com/anshumanmahato/happy-birthday-card

## Overview

Happy Birthday Card is a customizable web-based greeting with a build-time personalization flow and an interactive birthday experience. Setup supplies a recipient name and picture, optionally a scrolling message; the builder prepares the picture and markup, then generates the page. At runtime, the card can gate access by birthday date and otherwise guides the viewer through animated scenes to the greeting. The graph includes documented local and remote setup options. Styling and template relationships are shown only where the provided source establishes them; unsampled implementation details are not inferred.

Main entry points: [`builder/init.js`](https://github.com/anshumanmahato/happy-birthday-card/blob/main/builder/init.js) (Setup Orchestrator), [`src/js/index.js`](https://github.com/anshumanmahato/happy-birthday-card/blob/main/src/js/index.js) (Runtime Entry), [`src/js/animation.js`](https://github.com/anshumanmahato/happy-birthday-card/blob/main/src/js/animation.js) (Scene Animation), [`builder/genIndex.js`](https://github.com/anshumanmahato/happy-birthday-card/blob/main/builder/genIndex.js) (Page Generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Card Personalization"]
  node_builder_entry["Setup Orchestrator<br/>[init.js]"]
  node_local_source["Local Inputs"]
end

subgraph group_builder["Content Preparation"]
  node_image_prep["Photo Resizer<br/>[getPic.js]"]
  node_markup_prep["Message Markup<br/>[generateMarkup.js]"]
  node_page_generation["Page Generator<br/>[genIndex.js]"]
end

subgraph group_runtime["Birthday Experience"]
  node_runtime_entry["Runtime Entry<br/>[index.js]"]
  node_birthday_check["Birthday Date Check<br/>[openDate.js]"]
  node_alternate_pages["Early/Late Pages<br/>[pages.js]"]
  node_page_switch["Page Switcher<br/>[setPage.js]"]
  node_scene_animation["Scene Animation<br/>[animation.js]"]
end

subgraph group_presentation["Card Presentation"]
  node_page_template["HTML Template<br/>[template.html]"]
  node_card_styles["Card Styles<br/>[main.scss]"]
end

node_setup_user(("Card Creator"))
node_remote_photo(("Remote Photo"))
node_telegra_source(("Telegraph Message"))
node_viewer(("Card Viewer"))

node_setup_user -->|"provides settings"| node_builder_entry
node_local_source -->|"supplies local inputs"| node_builder_entry
node_remote_photo -->|"provides photo URL"| node_builder_entry
node_telegra_source -->|"provides message URL"| node_builder_entry
node_builder_entry -->|"processes photo"| node_image_prep
node_builder_entry -->|"formats message"| node_markup_prep
node_builder_entry -->|"generates page"| node_page_generation
node_page_generation -->|"reads template"| node_page_template
node_runtime_entry -->|"checks date"| node_birthday_check
node_runtime_entry -->|"sets alternate page"| node_page_switch
node_runtime_entry -->|"selects page content"| node_alternate_pages
node_runtime_entry -->|"starts animation"| node_scene_animation
node_page_switch -->|"renders page data"| node_alternate_pages
node_viewer -->|"interacts with card"| node_scene_animation
node_scene_animation -->|"shows greeting"| node_viewer

click node_builder_entry "https://github.com/anshumanmahato/happy-birthday-card/blob/main/builder/init.js"
click node_local_source "https://github.com/anshumanmahato/happy-birthday-card/tree/main/local"
click node_image_prep "https://github.com/anshumanmahato/happy-birthday-card/blob/main/builder/getPic.js"
click node_markup_prep "https://github.com/anshumanmahato/happy-birthday-card/blob/main/builder/generateMarkup.js"
click node_page_generation "https://github.com/anshumanmahato/happy-birthday-card/blob/main/builder/genIndex.js"
click node_page_template "https://github.com/anshumanmahato/happy-birthday-card/blob/main/src/template.html"
click node_runtime_entry "https://github.com/anshumanmahato/happy-birthday-card/blob/main/src/js/index.js"
click node_birthday_check "https://github.com/anshumanmahato/happy-birthday-card/blob/main/src/js/ext/openDate.js"
click node_alternate_pages "https://github.com/anshumanmahato/happy-birthday-card/blob/main/src/js/pages.js"
click node_page_switch "https://github.com/anshumanmahato/happy-birthday-card/blob/main/src/js/ext/setPage.js"
click node_scene_animation "https://github.com/anshumanmahato/happy-birthday-card/blob/main/src/js/animation.js"
click node_card_styles "https://github.com/anshumanmahato/happy-birthday-card/blob/main/src/scss/main.scss"

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_builder_entry,node_local_source,node_viewer toneBlue
class node_image_prep,node_markup_prep,node_page_generation toneAmber
class node_runtime_entry,node_birthday_check,node_alternate_pages,node_page_switch,node_scene_animation toneMint
class node_page_template,node_card_styles toneRose
class node_setup_user,node_remote_photo,node_telegra_source toneIndigo
```

## Components

### Card Personalization

- [Setup Orchestrator](https://github.com/anshumanmahato/happy-birthday-card/blob/main/builder/init.js): `builder/init.js`
- [Local Inputs](https://github.com/anshumanmahato/happy-birthday-card/tree/main/local): `local`

### Content Preparation

- [Photo Resizer](https://github.com/anshumanmahato/happy-birthday-card/blob/main/builder/getPic.js): `builder/getPic.js`
- [Message Markup](https://github.com/anshumanmahato/happy-birthday-card/blob/main/builder/generateMarkup.js): `builder/generateMarkup.js`
- [Page Generator](https://github.com/anshumanmahato/happy-birthday-card/blob/main/builder/genIndex.js): `builder/genIndex.js`

### Birthday Experience

- [Runtime Entry](https://github.com/anshumanmahato/happy-birthday-card/blob/main/src/js/index.js): `src/js/index.js`
- [Birthday Date Check](https://github.com/anshumanmahato/happy-birthday-card/blob/main/src/js/ext/openDate.js): `src/js/ext/openDate.js`
- [Early/Late Pages](https://github.com/anshumanmahato/happy-birthday-card/blob/main/src/js/pages.js): `src/js/pages.js`
- [Page Switcher](https://github.com/anshumanmahato/happy-birthday-card/blob/main/src/js/ext/setPage.js): `src/js/ext/setPage.js`
- [Scene Animation](https://github.com/anshumanmahato/happy-birthday-card/blob/main/src/js/animation.js): `src/js/animation.js`

### Card Presentation

- [HTML Template](https://github.com/anshumanmahato/happy-birthday-card/blob/main/src/template.html): `src/template.html`
- [Card Styles](https://github.com/anshumanmahato/happy-birthday-card/blob/main/src/scss/main.scss): `src/scss/main.scss`

### Other components

- **Card Creator**
- **Remote Photo**
- **Telegraph Message**
- **Card Viewer**

## Connections

- Card Creator → Setup Orchestrator: provides settings (evidence: `README.md`)
- Local Inputs → Setup Orchestrator: supplies local inputs (evidence: `builder/init.js`)
- Remote Photo → Setup Orchestrator: provides photo URL (evidence: `builder/init.js`)
- Telegraph Message → Setup Orchestrator: provides message URL (evidence: `builder/init.js`)
- Setup Orchestrator → Photo Resizer: processes photo (evidence: `builder/init.js`)
- Setup Orchestrator → Message Markup: formats message (evidence: `builder/init.js`)
- Setup Orchestrator → Page Generator: generates page (evidence: `builder/init.js`)
- Page Generator → HTML Template: reads template (evidence: `builder/genIndex.js`)
- Runtime Entry → Birthday Date Check: checks date (evidence: `src/js/index.js`)
- Runtime Entry → Page Switcher: sets alternate page (evidence: `src/js/index.js`)
- Runtime Entry → Early/Late Pages: selects page content (evidence: `src/js/index.js`)
- Runtime Entry → Scene Animation: starts animation (evidence: `src/js/index.js`)
- Page Switcher → Early/Late Pages: renders page data (evidence: `src/js/index.js`)
- Card Viewer → Scene Animation: interacts with card (evidence: `src/js/animation.js`)
- Scene Animation → Card Viewer: shows greeting (evidence: `src/js/animation.js`)
