# lafilledepondy/cupcake_bday architecture

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

- Interactive diagram: https://gitdiagram.com/lafilledepondy/cupcake_bday
- Repository: https://github.com/lafilledepondy/cupcake_bday

## Overview

##### Project type and purpose
- This is a single-sketch Processing (Java mode) desktop application that renders an interactive birthday cake scene.
- It captures mouse movements to adjust lighting and prompts the user for a name to display a custom birthday message.

##### File structure
- Only one top‐level file: “Cup_cake.pde.”
- No external services, databases, or multiple modules—everything lives in this single sketch.

##### README for additional insights
- Uses Processing’s 3D renderer (P3D) at 800×800 px.
- Requires a font resource (“Brush Script MT” or substituted).
- Handles two kinds of input: real-time mouse movement and a one-time text prompt.

a. Main components (logical modules)
- Input Handler
– MouseInput: tracks mouseX, mouseY per frame
– TextInput: captures the user’s typed name once at startup
- Renderer
– CanvasManager: sets up the P3D context and camera
– TextRenderer: displays prompt, user name, birthday message
- LightingController
– Computes dynamic point‐light position based on MouseInput
- ResourceLoader
– Loads font file into Processing’s PFont

b. Relationships and data flows
- MouseInput → LightingController → Renderer
- TextInput → TextRenderer
- ResourceLoader → TextRenderer

c. Architectural patterns and design principles
- Modular separation by concern—input, rendering, lighting, resources
- Imperative, frame‐by‐frame update cycle

d. Key technologies/frameworks/libraries
- Processing (Java mode) core library
- P3D graphics context
- Processing’s PFont for text

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Event Loop"
        A1["setup()"]:::process
        A2["draw()"]:::process
    end
    A1 --> A2

    subgraph "Input Handler"
        MI["MouseInput"]:::input
        TI["TextInput"]:::input
    end
    A2 --> MI
    A2 --> TI

    subgraph "Controller/Logic"
        LC["LightingController"]:::logic
    end
    MI --> LC

    subgraph "Renderer"
        CM["CanvasManager"]:::render
        SR["ShapeRenderer"]:::render
        TR["TextRenderer"]:::render
    end
    A2 --> CM
    LC --> SR
    TI --> TR
    CM --> SR
    CM --> TR

    subgraph "Resources"
        RL["ResourceLoader"]:::resource
    end
    RL --> TR

    DOC["Project Documentation (README)"]:::docs

    DOC

    click MI "https://github.com/lafilledepondy/cupcake_bday/blob/main/Cup_cake.pde"
    click TI "https://github.com/lafilledepondy/cupcake_bday/blob/main/Cup_cake.pde"
    click CM "https://github.com/lafilledepondy/cupcake_bday/blob/main/Cup_cake.pde"
    click SR "https://github.com/lafilledepondy/cupcake_bday/blob/main/Cup_cake.pde"
    click TR "https://github.com/lafilledepondy/cupcake_bday/blob/main/Cup_cake.pde"
    click LC "https://github.com/lafilledepondy/cupcake_bday/blob/main/Cup_cake.pde"
    click RL "https://github.com/lafilledepondy/cupcake_bday/blob/main/Cup_cake.pde"
    click DOC "https://github.com/lafilledepondy/cupcake_bday/blob/main/README.md"

    classDef input fill:#add8e6,stroke:#000
    classDef render fill:#90ee90,stroke:#000
    classDef logic fill:#ffffe0,stroke:#000
    classDef resource fill:#d3d3d3,stroke:#000
    classDef process fill:#f0e68c,stroke:#000
    classDef docs fill:#ffe4e1,stroke:#000
```
