# alanvww/100-days-of-design-engineering architecture

> Architecture diagram of the GitHub repository alanvww/100-days-of-design-engineering, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alanvww/100-days-of-design-engineering
- Repository: https://github.com/alanvww/100-days-of-design-engineering

## Overview

##### Project Overview and Type
- This is a Next.js frontend application that documents a design engineering journey (“100 Days of Design Engineering”) using modern web technologies (React, Next.js, WebGL).
- The repository primarily serves as a showcase of various UI demonstrations and interactive components, where each “day” is represented by content files (in markdown) and supporting assets (images/videos inside public/assets).
- Although there are some API endpoints (for feedback and project data), the core focus is on the UI composition and frontend rendering.

##### File Structure Components
- Frontend Application (src/app):
- Contains page layouts (layout.tsx), the homepage (page.tsx), and dynamic routes for days (src/app/days/[slug] with its pages, loading indicators, and opengraph image generation).
- There are also admin-specific pages under src/app/admin and API handlers (in src/app/api) for processing feedback and project routes.
- Components (src/components and src/components/ui):
- These directories showcase the reusable UI elements, such as navigation bars, footers, buttons, cards, sliders, and more.
- The UI components in src/components/ui are used to construct the visual and interactive parts of the site.
- Elements (src/elements):
- Includes custom interactive and design-centric elements such as draggable grids, text editors, animated components, and wrappers for specialized functionality.
- Content (src/content):
- Consists of Markdown files for each “day”, forming the narrative and instructive content. This underpins the project’s purpose as a design showcase.
- Library and Utility Files (src/lib & src/types):
- Provide utilities for markdown processing, type definitions, and supabase integration – supporting functions for rendering and interactivity on the frontend.
- Public Assets (public/assets):
- Contains static resources (images, videos, JSON files) supporting the visual components and content pages.

- Main Components to Include:
a. Browser Client: Represents the user’s browser making HTTP requests.
b. Next.js Frontend Application:
- UI Components Layer: A distinct block containing the imported components from src/components/ui and other shared components (like Navbar, Footer, etc.). Emphasize that these handle the rendering of interactive design showcase elements.
- Page Components Layer: Illustrate dynamic routing and page generation (e.g., src/app/days/[slug]/page.tsx) that consumes content from Markdown files.
c. API & Backend Endpoints (Optional Light Reference):
- API endpoints (API for feedback and project routes) which serve as supplemental support for data submission and retrieval, though these are not the primary focus.
d. Data and Content Management:
- Content Repository: Include a component for Markdown files (src/content) that provides text and contextual content.
e. Assets & Static Resources:
- Public Folder: Include a block for the public assets (images, videos, JSON) that support UI demonstrations.
f. Utility & Library Layer:
- Utilities providing markdown support, database types, and supabase interactions.
- Relationships and Interactions:
- Within the frontend block, illustrate the relationship between the Layout, Page Components, and UI Components layers. For instance, show that the layout page loads consistent elements (header/footer) and then dynamically renders the page content.
- Optionally, link API endpoints to the UI components that might trigger or display data from the feedback or project routes.
- Architectural Patterns:
- Component-based architecture typical with React/Next.js.
- Dynamic routing approach, where each “day” corresponds to a dynamic route with its own content and media.
- The separation of concerns is clear—UI components for display, elements for specialized effects, and content for narrative documentation.
- Technologies & Frameworks:
- Next.js for SSR and dynamic routing.
- React for the component-based UI.
- TypeScript for type safety.
- WebGL for some of the interactive or animated UI elements.
- Bun for package management.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global Entities
    Browser["Browser Client"]:::browser

    %% Frontend Application Subgraph
    subgraph "Next.js Frontend Application"
        subgraph "Layout & Routing"
            RootLayout["Root Layout (layout.tsx)"]:::frontend
            HomePage["Home Page (page.tsx)"]:::frontend
            DynamicDay["Dynamic Day Page ([slug]/page.tsx)"]:::frontend
            DayLoading["Day Loading ([slug]/loading.tsx)"]:::frontend
            Opengraph["Opengraph Image ([slug]/opengraph-image.tsx)"]:::frontend
        end
        subgraph "UI Components Layer"
            UIDir["UI Components Directory"]:::ui
            Navbar["Navbar (Navbar.tsx)"]:::ui
            Footer["Footer (Footer.tsx)"]:::ui
            ThemeSwitch["ThemeSwitch (ThemeSwitch.tsx)"]:::ui
            ElementShowcase["ElementShowcase (ElementShowcase.tsx)"]:::ui
            FeedbackBar["FeedbackBar (FeedbackBar.tsx)"]:::ui
        end
    end

    %% Interactive & Custom Elements
    Elements["Interactive Elements (src/elements)"]:::elements

    %% Admin & API Endpoints Subgraph
    subgraph "Admin & API Endpoints"
        AdminFeedback["Admin Feedback (feedback/page.tsx)"]:::api
        APIFeedback["API Feedback (src/app/api/feedback)"]:::api
        APIProject["API Project (src/app/api/project)"]:::api
    end

    %% Content Repository & Assets
    Content["Markdown Content (src/content)"]:::content
    Assets["Public Assets (public/assets)"]:::assets

    %% Utility & Library Files
    UtilLib["Utilities & Library (src/lib & src/types)"]:::util

    %% Relationships and Data Flow
    Browser -->|"HTTP_Request"| RootLayout
    RootLayout -->|"renders"| HomePage
    RootLayout -->|"renders"| DynamicDay
    DynamicDay -->|"shows_loading"| DayLoading
    DynamicDay -->|"generates"| Opengraph

    RootLayout ---|"includes"| UIDir
    UIDir -->|"contains"| Navbar
    UIDir -->|"contains"| Footer
    UIDir -->|"contains"| ThemeSwitch
    UIDir -->|"contains"| ElementShowcase
    UIDir -->|"contains"| FeedbackBar
    UIDir -->|"integrates"| Elements

    DynamicDay -->|"loads"| Content
    DynamicDay -->|"loads"| Assets
    DynamicDay -->|"utilizes"| UtilLib

    HomePage -->|"accesses"| Content

    HomePage -->|"admin_access"| AdminFeedback
    AdminFeedback -->|"calls"| APIFeedback
    AdminFeedback -->|"calls"| APIProject

    %% Click Events for Next.js Frontend Application (Layout & Routing)
    click RootLayout "https://github.com/alanvww/100-days-of-design-engineering/blob/main/src/app/layout.tsx"
    click HomePage "https://github.com/alanvww/100-days-of-design-engineering/blob/main/src/app/page.tsx"
    click DynamicDay "https://github.com/alanvww/100-days-of-design-engineering/blob/main/src/app/days/[slug]/page.tsx"
    click DayLoading "https://github.com/alanvww/100-days-of-design-engineering/blob/main/src/app/days/[slug]/loading.tsx"
    click Opengraph "https://github.com/alanvww/100-days-of-design-engineering/blob/main/src/app/days/[slug]/opengraph-image.tsx"

    %% Click Events for Admin & API Endpoints
    click AdminFeedback "https://github.com/alanvww/100-days-of-design-engineering/blob/main/src/app/admin/feedback/page.tsx"
    click APIFeedback "https://github.com/alanvww/100-days-of-design-engineering/tree/main/src/app/api/feedback"
    click APIProject "https://github.com/alanvww/100-days-of-design-engineering/tree/main/src/app/api/project"

    %% Click Events for UI Components Layer
    click UIDir "https://github.com/alanvww/100-days-of-design-engineering/tree/main/src/components/ui"
    click Navbar "https://github.com/alanvww/100-days-of-design-engineering/blob/main/src/components/ui/Navbar.tsx"
    click Footer "https://github.com/alanvww/100-days-of-design-engineering/blob/main/src/components/ui/Footer.tsx"
    click ThemeSwitch "https://github.com/alanvww/100-days-of-design-engineering/blob/main/src/components/ui/ThemeSwitch.tsx"
    click ElementShowcase "https://github.com/alanvww/100-days-of-design-engineering/blob/main/src/components/ElementShowcase.tsx"
    click FeedbackBar "https://github.com/alanvww/100-days-of-design-engineering/blob/main/src/components/FeedbackBar.tsx"

    %% Click Event for Interactive Elements
    click Elements "https://github.com/alanvww/100-days-of-design-engineering/tree/main/src/elements"

    %% Click Event for Content Repository
    click Content "https://github.com/alanvww/100-days-of-design-engineering/tree/main/src/content"

    %% Click Event for Public Assets
    click Assets "https://github.com/alanvww/100-days-of-design-engineering/tree/main/public/assets"

    %% Click Event for Utility & Library Files
    click UtilLib "https://github.com/alanvww/100-days-of-design-engineering/tree/main/src/lib"

    %% Styles
    classDef browser fill:#ffcc00,stroke:#333,stroke-width:2px;
    classDef frontend fill:#99ccff,stroke:#333,stroke-width:2px;
    classDef ui fill:#a6d854,stroke:#333,stroke-width:2px;
    classDef api fill:#f6ab6c,stroke:#333,stroke-width:2px;
    classDef content fill:#8cd3ff,stroke:#333,stroke-width:2px;
    classDef assets fill:#f4a7b9,stroke:#333,stroke-width:2px;
    classDef util fill:#ffd966,stroke:#333,stroke-width:2px;
    classDef elements fill:#b4a7d6,stroke:#333,stroke-width:2px;
```
