# ouadjih/flappy architecture

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

- Interactive diagram: https://gitdiagram.com/ouadjih/flappy
- Repository: https://github.com/ouadjih/flappy

## Overview

##### Project type and purpose
- This is a standalone Java-based game/application (“Flappy”) built on LWJGL (Lightweight Java Game Library) version 3.5.0.
- It provides a minimal rendering engine (shaders, textures, math utilities) and a main game loop (Main.java).

##### File structure
- Top‐level:
- README.md (lists JDK, LWJGL, IDE requirements)
- module-info.java (Java module declaration)
- flappy/ (Eclipse metadata, build output in bin, source in src, shaders in shaders)
- flappy/src/com/ouadjih/flappy:
- Main.java (entry point, init + game loop)
- graphics/ (Shader.java, Texture.java)
- math/ (Matrix4f.java, Vector3f.java)
- util/ (BufferUtils.java, FileUtils.java, ShaderUtils.java)
- flappy/shaders: two GLSL files (shader.vert, shader.frag)
- bin/ holds compiled .class files.

##### README
- Confirms Java 17 and LWJGL 3.5 requirements—no other external services or databases.

##### Final advice
- Be very detailed in separating:
- Startup/Initialization
- Resource loading
- Game loop (update vs render)
- Utility libraries
- Java package as a distinct component and show how Main orchestrates them together with LWJGL.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Application Layer
    subgraph "Application Layer"
        Main["Main"]:::application
    end

    %% Resource Layer
    subgraph "Resource Layer"
        FileUtils["FileUtils"]:::internal
    end

    %% Shader Manager
    subgraph "Shader Manager"
        ShaderUtils["ShaderUtils"]:::internal
        Shader["Shader"]:::internal
        shaderVert["shader.vert"]:::external
        shaderFrag["shader.frag"]:::external
    end

    %% Texture Manager
    subgraph "Texture Manager"
        Texture["Texture"]:::internal
        BufferUtils["BufferUtils"]:::internal
    end

    %% Math Library
    subgraph "Math Library"
        Vector3f["Vector3f"]:::internal
        Matrix4f["Matrix4f"]:::internal
    end

    %% Rendering Engine
    subgraph "Rendering Engine"
        Renderer["Renderer (LWJGL Context)"]:::internal
    end

    %% External Dependencies
    LWJGL["LWJGL 3.5"]:::external

    %% Initialization Flow
    Main -->|"initRenderer()"| Renderer
    Main -->|"loadShaderSource()"| FileUtils
    FileUtils -->|"readShaderFile()"| ShaderUtils
    ShaderUtils -->|"compileShader()"| Shader
    shaderVert --> ShaderUtils
    shaderFrag --> ShaderUtils
    Main -->|"loadTexture()"| Texture
    Texture -->|"createBuffer()"| BufferUtils
    Main -->|"use transforms"| Vector3f
    Main -->|"use transforms"| Matrix4f

    %% Game Loop
    Main -->|"gameLoop: update & render"| Renderer
    Renderer -->|"OpenGL calls"| LWJGL

    %% Click Events
    click Main "https://github.com/ouadjih/flappy/blob/main/flappy/src/com/ouadjih/flappy/Main.java"
    click Shader "https://github.com/ouadjih/flappy/blob/main/flappy/src/com/ouadjih/flappy/graphics/Shader.java"
    click ShaderUtils "https://github.com/ouadjih/flappy/blob/main/flappy/src/com/ouadjih/flappy/util/ShaderUtils.java"
    click shaderVert "https://github.com/ouadjih/flappy/blob/main/flappy/shaders/shader.vert"
    click shaderFrag "https://github.com/ouadjih/flappy/blob/main/flappy/shaders/shader.frag"
    click Texture "https://github.com/ouadjih/flappy/blob/main/flappy/src/com/ouadjih/flappy/graphics/Texture.java"
    click BufferUtils "https://github.com/ouadjih/flappy/blob/main/flappy/src/com/ouadjih/flappy/util/BufferUtils.java"
    click Vector3f "https://github.com/ouadjih/flappy/blob/main/flappy/src/com/ouadjih/flappy/math/Vector3f.java"
    click Matrix4f "https://github.com/ouadjih/flappy/blob/main/flappy/src/com/ouadjih/flappy/math/Matrix4f.java"
    click FileUtils "https://github.com/ouadjih/flappy/blob/main/flappy/src/com/ouadjih/flappy/util/FileUtils.java"
    click module-info "https://github.com/ouadjih/flappy/blob/main/flappy/src/module-info.java"

    %% Styles
    classDef application fill:#aecbfa,stroke:#2a56c6,color:#000
    classDef internal fill:#c7f0c4,stroke:#2e7d32,color:#000
    classDef external fill:#ffe0b2,stroke:#e65100,color:#000
```
