# dannybabbev/babbev-com architecture

> Architecture diagram of the GitHub repository dannybabbev/babbev-com, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-02-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dannybabbev/babbev-com
- Repository: https://github.com/dannybabbev/babbev-com

## Overview

##### Project type + purpose (what you’re diagramming)
This repo is a **Next.js personal website** (babbev.com). Based on the tree, it’s a **single web app** using the **Next.js “app router”** (`app/` with `layout.js` and `page.js`) and a set of **UI components** that render an interactive/animated experience (terminal, matrix rain, intro animation, typewriter, character). There’s no explicit backend service, database, or API layer shown in the repo structure—so the “system” is primarily **browser + Next.js runtime + static assets**.

- **Next.js app shell** (routing/layout/page composition)
- **Component modules** (UI/animations)
- **Local “model/helpers”** (data + constants feeding the UI)
- **Static assets + CSS modules/global styles**
- **Build & runtime** (dev/build/start)

##### Next.js App Router entrypoints
- `app/layout.js`
Root layout: global HTML structure, likely imports global CSS, wraps the page with shared layout concerns.
- `app/page.js`
The home page route (`/`) which composes the main experience using components.

##### Feature/UI components (most of the “business logic” lives here)
The `components/` directory is organized by component folder:
- `components/Terminal/Terminal.js` + `.module.css`
- `components/TerminalInput/TerminalInput.js` + `.module.css`
- `components/MatrixRain/MatrixRain.js` + `.module.css`
- `components/IntroAnimation/IntroAnimation.js` + `.module.css`
- `components/TypeWriter/TypeWriter.js`
- `components/Character/Character.js`

- “Terminal” likely orchestrates output + command handling
- “TerminalInput” likely handles keystrokes/user input and emits events upward
- “MatrixRain / IntroAnimation / TypeWriter / Character” are visual/animation modules

##### Helpers and Model (local domain/data layer)
- `helpers/consts.js` (shared constants/config)
- `helpers/os-data.js` (likely structured data about “OS commands/content” displayed in the terminal UX)
- `model/os.js` and `model/os.js` (domain model for the “OS” concept; maybe commands, filesystem, responses)

##### Tooling / runtime
- `package.json` + `package-lock.json` (scripts: `dev`, `build`, `start`)
- ESLint config (`.eslintrc.json`, `eslint.config.mjs`)
- `.vscode`, `.gitignore`

##### What to include from README
README confirms:
- It’s Next.js
- Primary operations: dev/build/start

##### Next.js App (App Router)
- `app/layout.js`
- `app/page.js`
##### UI Components
- Terminal
- TerminalInput
- MatrixRain
- IntroAnimation
- TypeWriter
- Character
##### Local Domain/Data Layer
- `model/os.js`
- `helpers/os-data.js`
- `helpers/consts.js`

##### Build Tooling
- npm scripts (`dev/build/start`)
- Next.js build pipeline (implicit)
- ESLint configs

Optionally add:

**Request/Render flow**
- Browser → Next.js App: HTTP request for `/`
- Next.js App (`layout.js` + `page.js`) → UI Components: composition/import usage
- UI Components ↔ User: user input events (keyboard) and rendered output (DOM/canvas)

**Data flow inside app**
- Terminal / TerminalInput → Local Domain/Data Layer: “execute command”, “lookup response”, “load OS data”
- Local Domain/Data Layer → Terminal: returns text/output/state used to render
- Components → CSS Modules / Global Styles: styling dependencies
- Next.js App → Static Assets (`public/`): images/fonts/etc loaded by browser

**If animations rely on timers**
- UI Components → Browser APIs: requestAnimationFrame / setInterval / canvas (represent as “Browser APIs” if relevant)

##### c) Architectural patterns / principles used
From the structure, the key patterns to reflect visually:
- **Component-based UI architecture** (React/Next.js components)
- **App Router composition**: `layout.js` wraps `page.js`, `page.js` composes features
- **Local domain/model separation**: `model/` + `helpers/` provide data/logic separated from purely presentational code
- **CSS Modules per component**: styling encapsulation

##### d) Label key technologies
- **Next.js (App Router)** for `app/`
- **React components** for `components/`
- **CSS Modules / global CSS**
- **Node.js + npm** for build/start

##### Right: Components cluster
- Terminal (connected to TerminalInput)
- MatrixRain
- IntroAnimation
- TypeWriter
- Character
##### Below/side: Static Assets & Styles

- npm scripts → Next.js build → deployment artifact → hosting

## Diagram (Mermaid)

```mermaid
flowchart TD
  %% =========================
  %% Runtime (User-facing)
  %% =========================
  subgraph "Runtime (User-facing)"
    direction TB

    U["User"]:::external
    B["Browser (DOM + JS Runtime)"]:::external
    BA["Browser APIs (events, timers, animation frames)"]:::external

    U <-->|"interacts"| B
    B -->|"uses"| BA

    subgraph "Next.js App (App Router)"
      direction TB
      NX["Next.js Runtime (SSR/SSG + Client Hydration)"]:::nextjs

      L["Root Layout (app/layout.js)"]:::nextjs
      P["Home Page Route '/' (app/page.js)"]:::nextjs

      NX -->|"renders"| L
      L -->|"wraps"| P
    end

    B -->|"HTTP GET /"| NX

    subgraph "UI Components (React)"
      direction TB

      subgraph "Terminal Experience"
        direction TB
        T["Terminal UI (components/Terminal)"]:::component
        TI["Terminal Input (components/TerminalInput)"]:::component
        T <-->|"input/output"| TI
      end

      subgraph "Animations / Visuals"
        direction TB
        MR["Matrix Rain (components/MatrixRain)"]:::component
        IA["Intro Animation (components/IntroAnimation)"]:::component
        TW["TypeWriter (components/TypeWriter)"]:::component
        CH["Character (components/Character)"]:::component
      end
    end

    P -->|"composes"| T
    P -->|"composes"| MR
    P -->|"composes"| IA
    P -->|"composes"| TW
    P -->|"composes"| CH

    B <-->|"UI events/rendered output"| T
    B <-->|"UI events/rendered output"| MR
    B <-->|"UI events/rendered output"| IA
    B <-->|"UI events/rendered output"| TW
    B <-->|"UI events/rendered output"| CH

    T -->|"listens/animates"| BA
    TI -->|"keyboard events"| BA
    MR -->|"animation loop"| BA
    IA -->|"animation loop"| BA
    TW -->|"timers"| BA
    CH -->|"timers/animation"| BA

    subgraph "Local Domain/Data Layer"
      direction TB
      OS["OS Model (model/os.js)"]:::data
      OSD["OS Data (helpers/os-data.js)"]:::data
      C["Shared Constants (helpers/consts.js)"]:::data

      OSD -->|"feeds"| OS
      C -->|"configures"| OS
    end

    TI -->|"execute command"| OS
    T -->|"lookup content/state"| OS
    OS -->|"returns output/state"| T

    subgraph "Static Assets & Styling"
      direction TB
      PUB(("Public Assets (/public)")):::static
      G["Global CSS (styles/global.css)"]:::static
      HM["Home CSS Module (styles/Home.module.css)"]:::static

      TCSS["Terminal CSS Module"]:::static
      TICSS["TerminalInput CSS Module"]:::static
      MRCSS["MatrixRain CSS Module"]:::static
      IACSS["IntroAnimation CSS Module"]:::static
    end

    L -.->|"imports"| G
    P -.->|"imports"| HM

    T -.->|"styles"| TCSS
    TI -.->|"styles"| TICSS
    MR -.->|"styles"| MRCSS
    IA -.->|"styles"| IACSS

    B -->|"requests assets"| PUB
    NX -->|"serves"| PUB
  end

  %% =========================
  %% Build / Dev Tooling
  %% =========================
  subgraph "Build / Dev Tooling"
    direction TB

    DOC["README (Usage/Ops)"]:::tooling
    PKG["package.json (npm scripts: dev/build/start)"]:::tooling
    LOCK["package-lock.json"]:::tooling

    ESL1[".eslintrc.json"]:::tooling
    ESL2["eslint.config.mjs"]:::tooling
    VSC[".vscode (Workspace settings)"]:::tooling

    PKG -->|"installs"| LOCK
    PKG -.->|"lint rules"| ESL1
    PKG -.->|"lint rules"| ESL2
    DOC -.->|"documents"| PKG
  end

  PKG -.->|"builds/runs"| NX

  %% =========================
  %% Click Events (mapped paths)
  %% =========================
  click L "https://github.com/dannybabbev/babbev-com/blob/main/app/layout.js"
  click P "https://github.com/dannybabbev/babbev-com/blob/main/app/page.js"

  click T "https://github.com/dannybabbev/babbev-com/blob/main/components/Terminal/Terminal.js"
  click TCSS "https://github.com/dannybabbev/babbev-com/blob/main/components/Terminal/Terminal.module.css"

  click TI "https://github.com/dannybabbev/babbev-com/blob/main/components/TerminalInput/TerminalInput.js"
  click TICSS "https://github.com/dannybabbev/babbev-com/blob/main/components/TerminalInput/TerminalInput.module.css"

  click MR "https://github.com/dannybabbev/babbev-com/blob/main/components/MatrixRain/MatrixRain.js"
  click MRCSS "https://github.com/dannybabbev/babbev-com/blob/main/components/MatrixRain/MatrixRain.module.css"

  click IA "https://github.com/dannybabbev/babbev-com/blob/main/components/IntroAnimation/IntroAnimation.js"
  click IACSS "https://github.com/dannybabbev/babbev-com/blob/main/components/IntroAnimation/IntroAnimation.module.css"

  click TW "https://github.com/dannybabbev/babbev-com/blob/main/components/TypeWriter/TypeWriter.js"
  click CH "https://github.com/dannybabbev/babbev-com/blob/main/components/Character/Character.js"

  click OS "https://github.com/dannybabbev/babbev-com/blob/main/model/os.js"
  click OSD "https://github.com/dannybabbev/babbev-com/blob/main/helpers/os-data.js"
  click C "https://github.com/dannybabbev/babbev-com/blob/main/helpers/consts.js"

  click G "https://github.com/dannybabbev/babbev-com/blob/main/styles/global.css"
  click HM "https://github.com/dannybabbev/babbev-com/blob/main/styles/Home.module.css"
  click PUB "https://github.com/dannybabbev/babbev-com/tree/main/public/"

  click PKG "https://github.com/dannybabbev/babbev-com/blob/main/package.json"
  click LOCK "https://github.com/dannybabbev/babbev-com/blob/main/package-lock.json"

  click ESL1 "https://github.com/dannybabbev/babbev-com/blob/main/.eslintrc.json"
  click ESL2 "https://github.com/dannybabbev/babbev-com/blob/main/eslint.config.mjs"
  click VSC "https://github.com/dannybabbev/babbev-com/blob/main/.vscode"
  click DOC "https://github.com/dannybabbev/babbev-com/blob/main/README.md"

  %% =========================
  %% Styles
  %% =========================
  classDef external fill:#ffedd5,stroke:#c2410c,color:#7c2d12,stroke-width:1.5px
  classDef nextjs fill:#dbeafe,stroke:#1d4ed8,color:#0b2a6f,stroke-width:1.5px
  classDef component fill:#bfdbfe,stroke:#1e40af,color:#0b2a6f,stroke-width:1.5px
  classDef data fill:#dcfce7,stroke:#166534,color:#14532d,stroke-width:1.5px
  classDef static fill:#e5e7eb,stroke:#374151,color:#111827,stroke-width:1.5px
  classDef tooling fill:#fde68a,stroke:#b45309,color:#78350f,stroke-width:1.5px
```
