# bennie/conbadge-drinking-game architecture

> Architecture diagram of the GitHub repository bennie/conbadge-drinking-game, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bennie/conbadge-drinking-game
- Repository: https://github.com/bennie/conbadge-drinking-game

## Overview

##### Main Components

a) Web Interface Layer
- Index.html as the entry point
- CGI processing capabilities

b) Processing Layer
- Perl scripts (drinking.pl and wolves.pl)
- Rules processing engine

c) Data Storage Layer
- Wolves.txt as a data source
- Category storage for name components

##### Component Relationships

**[Web Browser] → [Web Server]**
- ↓
**[index.html] → [drinking.cgi]**
- ↓
- [Perl Processing Layer]
- ╔═══════════════════════╗
- ║ - drinking.pl         ║
- ║ - wolves.pl           ║
- ╚═══════════════════════╝
- ↓
- [Data Sources Layer]
- ╔═══════════════════════╗
- ║ - wolves.txt          ║
- ║ - Category Rules      ║
- ╚═══════════════════════╝

**[Rules Engine]**

- → Animals
- → Elements
- → Seasons
- → Celestials

##### Additional Elements

A separate section for bonus rules:
**[Bonus Rules]**

- → Cutesy
- → Titles
- → Pedantic

##### Data Flow Indicators

- User input flow
- Rule processing direction
- Results delivery

##### Technical Details

- CGI processing path
- Perl script interaction
- Data file access patterns
- Rule evaluation flow

- The CGI-based architecture
- The rule processing hierarchy
- The separation between interface and logic
- The data flow from user input to result output

This will give other developers a clear understanding of how the application processes badge names and applies the drinking game rules.

Remember to include version information and any relevant notes about the development environment or deployment requirements.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Web Layer"
        Browser["Web Browser"]
        WebServer["Web Server"]
        Index["index.html"]:::interface
    end

    subgraph "CGI Layer"
        CGI["drinking.cgi"]:::cgi
    end

    subgraph "Processing Layer"
        DrinkingPL["drinking.pl"]:::processing
        WolvesPL["wolves.pl"]:::processing
    end

    subgraph "Rules Engine"
        Rules["Rules Processor"]
        Animals["Animals"]:::rule
        Colors["Colors"]:::rule
        Elements["Elements"]:::rule
        Seasons["Seasons"]:::rule
        Celestials["Celestials"]:::rule
    end

    subgraph "Bonus Rules"
        BonusRules["Bonus Processor"]
        Cutesy["Cutesy"]:::bonus
        Titles["Titles"]:::bonus
        Pedantic["Pedantic"]:::bonus
    end

    subgraph "Data Layer"
        WolvesTxt["wolves.txt"]:::data
        Categories["Category Rules"]:::data
    end

    Browser --> WebServer
    WebServer --> Index
    Index --> CGI
    CGI --> DrinkingPL
    DrinkingPL --> WolvesPL
    DrinkingPL --> Rules
    DrinkingPL --> BonusRules
    
    Rules --> Animals
    Rules --> Colors
    Rules --> Elements
    Rules --> Seasons
    Rules --> Celestials
    
    BonusRules --> Cutesy
    BonusRules --> Titles
    BonusRules --> Pedantic
    
    WolvesPL --> WolvesTxt
    Rules --> Categories

    %% Click events for component mapping
    click Index "https://github.com/bennie/conbadge-drinking-game/blob/master/index.html"
    click CGI "https://github.com/bennie/conbadge-drinking-game/blob/master/drinking.cgi"
    click DrinkingPL "https://github.com/bennie/conbadge-drinking-game/blob/master/drinking.pl"
    click WolvesPL "https://github.com/bennie/conbadge-drinking-game/blob/master/wolves.pl"
    click WolvesTxt "https://github.com/bennie/conbadge-drinking-game/blob/master/wolves.txt"

    %% Styling
    classDef interface fill:#3498db
    classDef cgi fill:#2ecc71
    classDef processing fill:#27ae60
    classDef rule fill:#e74c3c
    classDef bonus fill:#f1c40f
    classDef data fill:#95a5a6

    %% Legend
    subgraph Legend
        L1["Interface Components"]:::interface
        L2["CGI Components"]:::cgi
        L3["Processing Scripts"]:::processing
        L4["Rule Categories"]:::rule
        L5["Bonus Rules"]:::bonus
        L6["Data Storage"]:::data
    end
```
