# juancruzperez/ahoracado_alura_latam architecture

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

- Interactive diagram: https://gitdiagram.com/juancruzperez/ahoracado_alura_latam
- Repository: https://github.com/juancruzperez/ahoracado_alura_latam

## Overview

##### Project type and purpose
- This is a static, front-end–only web game (“Ahorcado” or Hangman). It consists of HTML, CSS, and JavaScript files plus an image folder. There is no backend or database—everything runs in the browser.

##### File structure
- index.html: the shell of the game (UI container, script/style imports)
- ahorcado.js: core game logic (word selection, state machine, user input handling)
- canvas.js: drawing logic (rendering the “hangman” figure onto an HTML5 canvas)
- README.md: minimal metadata (project title)

##### Key insights from README
- No further architecture notes—this is purely a browser‐based static application.

## Diagram (Mermaid)

```mermaid
flowchart TB
    WebServer["Web Server (Static Host)"]:::external
    Browser["Browser (Client)"]:::external

    WebServer -->|"GET /index.html, /style.css, /ahorcado.js, /canvas.js, /img/*"| Browser

    subgraph "Browser (Client-Side)"
        UI["UI Layer\n(index.html, style.css)"]:::static
        Logic["Game Logic Module\n(ahorcado.js)"]:::runtime
        Renderer["Rendering Module\n(canvas.js)"]:::runtime
        Assets["Asset Store\n(img/)"]:::static
        CanvasElem["HTML5 Canvas Element"]:::static
        User["User"]:::interaction

        Browser --> UI
        Browser --> Logic
        Browser --> Renderer
        Browser --> Assets

        User -->|"keypress/click event"| Logic
        Logic -->|"drawCommand()"| Renderer
        Renderer -->|"Canvas API calls"| CanvasElem
        CanvasElem -->|"visual update"| UI
    end

    click UI "https://github.com/juancruzperez/ahoracado_alura_latam/blob/main/index.html"
    click UI "https://github.com/juancruzperez/ahoracado_alura_latam/blob/main/style.css"
    click Logic "https://github.com/juancruzperez/ahoracado_alura_latam/blob/main/ahorcado.js"
    click Renderer "https://github.com/juancruzperez/ahoracado_alura_latam/blob/main/canvas.js"
    click Assets "https://github.com/juancruzperez/ahoracado_alura_latam/tree/main/img/"

    classDef static fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef runtime fill:#90EE90,stroke:#000,stroke-width:1px
    classDef interaction fill:#FFA500,stroke:#000,stroke-width:1px
    classDef external stroke-dasharray:5 5,stroke:#999,fill:#FFF,stroke-width:1px
```
