# vuanhnguyeen/wedding-hub architecture

> Architecture diagram of the GitHub repository vuanhnguyeen/wedding-hub, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vuanhnguyeen/wedding-hub
- Repository: https://github.com/vuanhnguyeen/wedding-hub

## Overview

##### Project Type and Purpose
- It is a full-stack (or at least a complete frontend) web application built with Next.js, focusing on a component‑driven, responsive website.
- The file tree shows multiple UI components (e.g., Album, Bigdate, Couple, Hero, Notebook, Photos, Pink, Thanks, Time) which are likely used to build different sections/pages of the site.
- The public directory includes static assets (like an album folder and a music file) indicating multimedia or rich media content is part of the site experience.

##### File Structure
- Top-level directories and files:
- components – Contains subdirectories for each UI component. Each component is self-contained with its own index.js and SCSS styling.
- pages – Houses the main routing files (_app.js, _document.js, index.js) that drive the Next.js pages.
- public – Contains assets (e.g., album pictures, a music file) that are statically served.
- styles – Global and common SCSS files for cross‑component styling.
- next.config.js, package.json – Essential configuration and dependency management for the Next.js environment.
- The structure uses a modular architecture built around individual React components.

##### Key Insights from the README
- It confirms use of Next.js, mentions API routes (even though the file tree only shows a sample API route in the README documentation), and highlights features for development and deployment.
- The README does not suggest additional backend services; the primary focus is on the frontend part with component-based rendering and possibly some API route integrations.

a. Main Components:
- Next.js Framework Core:
- Pages (including _app.js, _document.js, index.js)
- API routes (if present in future, as outlined in the README)
- Components:
- Individual UI components (Album, Bigdate, Couple, etc.) representing discrete parts of the UI.
- Public Assets:
- Static assets (images in public/album, music files, etc.)
- Styles:
- Global styles and SCSS modules used by components.

b. Relationships and Interactions:
- Pages serve as the composition root, integrating various UI components to build the full pages.
- Each component interacts with global styles by importing SCSS modules.
- The public directory interacts with the application via static references (e.g., images, music).
- Next.js config and build scripts (next.config.js, package.json) oversee overall building, routing, and deployment.

c. Architectural Patterns and Design Principles:
- Component-Based Architecture: Each UI component is isolated with its logic and styling.
- File-based Routing: The organization in the pages directory follows Next.js conventions.
- Separation of Concerns: Clear delineation between presentation components (in components/), routing (pages/), and static assets (public/).

d. Relevant Technologies and Frameworks:
- Next.js for React-based server-side rendering (SSR) and static site generation (SSG).
- React for component rendering.
- SCSS for styling (with module support for each component).
- Vercel for deployment (as suggested in the README).

##### Elements
- "Next.js Framework" container, with sub‑components "Pages" (routing, _app.js, _document.js) and "Components" (listing each UI element).
- Data flow from Pages to Components.
- Where global assets (from the public folder) are referenced by these components.

##### Putting It Together
- Inside that container, split into:
- "Pages Layer" (with _app.js, _document.js, index.js)
- "Components Layer" – subdivide this into the multiple component blocks (Album, Bigdate, Couple, etc.).
- "Public Assets" – indicate folder contents such as images, music.
- "Styles" – show global styles and component-specific SCSS modules.
- That the Next.js configuration (next.config.js) and package.json manage the environment and dependencies.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Next.js Application"
        %% Pages Layer
        subgraph "Pages Layer"
            app[" _app.js"]:::pages
            doc[" _document.js"]:::pages
            idx[" index.js"]:::pages
        end

        %% Components Layer
        subgraph "Components Layer"
            album["Album"]:::components
            bigdate["Bigdate"]:::components
            couple["Couple"]:::components
            hero["Hero"]:::components
            notebook["Notebook"]:::components
            photos["Photos"]:::components
            pink["Pink"]:::components
            thanks["Thanks"]:::components
            time["Time"]:::components
        end

        %% Public Assets
        subgraph "Public Assets"
            pubAlbum["Album Assets"]:::assets
            music["Music File"]:::assets
        end

        %% Global Styles
        subgraph "Global Styles"
            globals["globals.scss"]:::styles
            mixin["Common Mixins"]:::styles
        end

        %% Next.js Config & Dependencies
        subgraph "Next.js Config & Dependencies"
            config["next.config.js"]:::config
            pkg["package.json"]:::config
        end
    end

    %% Relationships: Pages integrate UI Components
    idx -->|"uses"| album
    idx -->|"uses"| bigdate
    idx -->|"uses"| couple
    idx -->|"uses"| hero
    idx -->|"uses"| notebook
    idx -->|"uses"| photos
    idx -->|"uses"| pink
    idx -->|"uses"| thanks
    idx -->|"uses"| time

    %% Relationships: Global styles linked to Components (example linkage)
    globals -->|"styles"| album
    globals -->|"styles"| hero

    %% Relationships: Public Assets referenced by Components (example linkage)
    pubAlbum -->|"provides"| album
    music -->|"provides"| hero

    %% Relationships: Config & Dependencies initialize Pages
    config -->|"configures"| app
    pkg -->|"manages"| app

    %% Styles for nodes
    classDef pages fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef components fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef assets fill:#FFD700,stroke:#000,stroke-width:1px;
    classDef styles fill:#FFB6C1,stroke:#000,stroke-width:1px;
    classDef config fill:#D3D3D3,stroke:#000,stroke-width:1px;

    %% Click Events for Pages Layer
    click app "https://github.com/vuanhnguyeen/wedding-hub/blob/main/pages/_app.js"
    click doc "https://github.com/vuanhnguyeen/wedding-hub/blob/main/pages/_document.js"
    click idx "https://github.com/vuanhnguyeen/wedding-hub/blob/main/pages/index.js"

    %% Click Events for UI Components (using JS file mapping)
    click album "https://github.com/vuanhnguyeen/wedding-hub/blob/main/components/Album/index.js"
    click bigdate "https://github.com/vuanhnguyeen/wedding-hub/blob/main/components/Bigdate/index.js"
    click couple "https://github.com/vuanhnguyeen/wedding-hub/blob/main/components/Couple/index.js"
    click hero "https://github.com/vuanhnguyeen/wedding-hub/blob/main/components/Hero/index.js"
    click notebook "https://github.com/vuanhnguyeen/wedding-hub/blob/main/components/Notebook/index.js"
    click photos "https://github.com/vuanhnguyeen/wedding-hub/blob/main/components/Photos/index.js"
    click pink "https://github.com/vuanhnguyeen/wedding-hub/blob/main/components/Pink/index.js"
    click thanks "https://github.com/vuanhnguyeen/wedding-hub/blob/main/components/Thanks/index.js"
    click time "https://github.com/vuanhnguyeen/wedding-hub/blob/main/components/Time/index.js"

    %% Click Events for Public Assets
    click pubAlbum "https://github.com/vuanhnguyeen/wedding-hub/tree/main/public/album"
    click music "https://github.com/vuanhnguyeen/wedding-hub/blob/main/public/music.mp3"

    %% Click Events for Global Styles
    click globals "https://github.com/vuanhnguyeen/wedding-hub/blob/main/styles/globals.scss"
    click mixin "https://github.com/vuanhnguyeen/wedding-hub/blob/main/styles/_common.mixin.scss"

    %% Click Events for Next.js Configuration and Dependencies
    click config "https://github.com/vuanhnguyeen/wedding-hub/blob/main/next.config.js"
    click pkg "https://github.com/vuanhnguyeen/wedding-hub/blob/main/package.json"
```
