# anuj579/birthday-site-v2 architecture

> Architecture diagram of the GitHub repository anuj579/birthday-site-v2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anuj579/birthday-site-v2
- Repository: https://github.com/anuj579/birthday-site-v2

## Overview

##### Project Type and Purpose
- This is a full-stack (front-end only) static/SSR React application built with Next.js.
- Purpose: Render a birthday-themed UI with animations, confetti, countdown timer, and a photo slideshow.

##### Main Components
a. Client (Browser)
- Sends HTTP requests and renders the React UI.
b. Next.js Server (or Static Hosting)
- Serves HTML, CSS, and JS bundles.
- Handles SSR or SSG at build time.
c. UI Components (src/app/components)
- Celebration.jsx (confetti)
- Countdown.jsx (timer)
- HappyBirthday.jsx (title/animation)
- Letter.jsx (personal message)
- Loader.jsx (initial loading)
- PhotoGallery.jsx (Swiper slideshow)
d. Styling & Animations
- Tailwind CSS (globals.css + postcss.config.mjs)
- Framer Motion (entrance/fade animations)
- Canvas Confetti (celebration effect)
e. Static Assets
- public/images (photos for the gallery)
f. Build & Config
- next.config.mjs (Next.js configuration)
- tailwind.config.mjs (Tailwind setup via postcss)
- eslint.config.mjs, jsconfig.json (dev tooling)

##### Relationships & Data Flow
1. User opens Browser → HTTP GET to Next.js Server or CDN
2. Server returns HTML + JS bundles, including React entry at src/app/page.jsx
3. React hydrates on client
4. Page layout (src/app/layout.js) mounts global CSS; core components render in page.jsx
5. UI components invoke:
– Countdown logic (Countdown.jsx)
– Confetti via Canvas Confetti (Celebration.jsx)
– Animations via Framer Motion
– Photo slideshow via Swiper.js (PhotoGallery.jsx)
6. All assets (images, CSS) served from public/ and bundled code.

##### Architectural Patterns & Principles
- Component-based UI (React + Next.js App Router)
- Static-first deployment (SSG/SSR)
- Single Page Application with dynamic components
- Separation of concerns: styling (Tailwind) vs. logic (React) vs. animations (Framer Motion, Canvas Confetti)

##### Must-Include Elements
- Core application (React + Next.js)
- Third-party libraries
- Assets (images/CSS)
- External actor (Browser/CDN)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Actor
    Browser["Browser"]:::external

    %% Server / Hosting
    NextServer["Next.js Server / CDN"]:::server

    Browser -->|"HTTP GET"| NextServer
    NextServer -->|"Serves HTML/CSS/JS"| ReactApp

    subgraph "React App (src/app/)" 
        direction TB
        Layout["layout.js"]:::app
        Page["page.jsx"]:::app

        subgraph "UI Components (src/app/components)"
            direction TB
            Celebration["Celebration.jsx"]:::component
            Countdown["Countdown.jsx"]:::component
            HappyBirthday["HappyBirthday.jsx"]:::component
            Letter["Letter.jsx"]:::component
            Loader["Loader.jsx"]:::component
            PhotoGallery["PhotoGallery.jsx"]:::component
        end

        Layout --> Page
        Page --> Celebration
        Page --> Countdown
        Page --> HappyBirthday
        Page --> Letter
        Page --> Loader
        Page --> PhotoGallery
    end

    %% External Libraries & Styling
    subgraph "Styling & Animations"
        direction TB
        Tailwind["globals.css"]:::assets
        PostCSS["postcss.config.mjs"]:::config
        FramerMotion["Framer Motion"]:::library
        CanvasConfetti["Canvas Confetti"]:::library
        SwiperJS["Swiper.js"]:::library
    end

    %% Static Assets
    PublicImages["public/images"]:::assets

    %% Config & Tooling
    subgraph "Build & Config"
        direction TB
        NextConfig["next.config.mjs"]:::config
        ESLint["eslint.config.mjs"]:::config
        JSConfig["jsconfig.json"]:::config
    end

    %% Relationships
    ReactApp --> Tailwind
    ReactApp --> PostCSS
    Celebration --> CanvasConfetti
    Celebration --> FramerMotion
    Countdown --> FramerMotion
    HappyBirthday --> FramerMotion
    Loader --> FramerMotion
    PhotoGallery --> SwiperJS
    PhotoGallery --> PublicImages

    NextServer --> NextConfig
    ReactApp --> ESLint
    ReactApp --> JSConfig

    %% Click Events
    click NextConfig "https://github.com/anuj579/birthday-site-v2/blob/main/next.config.mjs"
    click Layout "https://github.com/anuj579/birthday-site-v2/blob/main/src/app/layout.js"
    click Page "https://github.com/anuj579/birthday-site-v2/blob/main/src/app/page.jsx"
    click Celebration "https://github.com/anuj579/birthday-site-v2/blob/main/src/app/components/Celebration.jsx"
    click Countdown "https://github.com/anuj579/birthday-site-v2/blob/main/src/app/components/Countdown.jsx"
    click HappyBirthday "https://github.com/anuj579/birthday-site-v2/blob/main/src/app/components/HappyBirthday.jsx"
    click Letter "https://github.com/anuj579/birthday-site-v2/blob/main/src/app/components/Letter.jsx"
    click Loader "https://github.com/anuj579/birthday-site-v2/blob/main/src/app/components/Loader.jsx"
    click PhotoGallery "https://github.com/anuj579/birthday-site-v2/blob/main/src/app/components/PhotoGallery.jsx"
    click Tailwind "https://github.com/anuj579/birthday-site-v2/blob/main/src/app/globals.css"
    click PostCSS "https://github.com/anuj579/birthday-site-v2/blob/main/postcss.config.mjs"
    click ESLint "https://github.com/anuj579/birthday-site-v2/blob/main/eslint.config.mjs"
    click JSConfig "https://github.com/anuj579/birthday-site-v2/blob/main/jsconfig.json"
    click PublicImages "https://github.com/anuj579/birthday-site-v2/tree/main/public/images"

    %% Styles
    classDef external fill:#f9f,stroke:#333,stroke-width:1px
    classDef server fill:#bbf,stroke:#333,stroke-width:1px
    classDef app fill:#bfb,stroke:#333,stroke-width:1px
    classDef component fill:#ffb,stroke:#333,stroke-width:1px
    classDef library fill:#fb8,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5
    classDef assets fill:#8fb,stroke:#333,stroke-width:1px
    classDef config fill:#f88,stroke:#333,stroke-width:1px,stroke-dasharray: 2 2
```
