# whiteecattt/auction-house architecture

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

- Interactive diagram: https://gitdiagram.com/whiteecattt/auction-house
- Repository: https://github.com/whiteecattt/auction-house

## Overview

##### Main Components

A. Behavior Pack (BP)
- Database Layer
- Core Functions
- UI Management
- Configuration System

B. Resource Pack (RP)
- UI Definitions
- Textures
- Form Layouts

##### Component Relationships

**[Resource Pack Layer]**
- ↓
**[UI Management Layer]**
- ↓
**[Core System Layer]**
- ↓
**[Database Layer]**

##### Detailed Component Breakdown

A. Database Layer (Bottom):
- Connection to the database.js handler
- Data flow for item storage and retrieval

B. Core System Layer (Middle):
- Time Management (expiredTime.js)
- Score Management (getScore.js)
- Number Formatting (formatNumber.js, toRomanNumber.js)
- UI Control (forceShow.js)
- To both database and UI layers

C. UI Management Layer (Upper-Middle):
- ChestUI Component:
- Forms Handler
- Type Management
- Bidirectional connection to core system

D. Resource Pack Layer (Top):
- UI Definitions
- Form Layouts
- Texture Resources

##### Flow Indicators

- Data flow between database and core system
- User interaction flow through UI
- Configuration impact on system behavior
- Resource pack integration with UI system

##### Additional Elements

Specific features as sub-components:
- Auction Management System
- Item Search Functionality
- Player Listings Management
- Expiration Handler

**→ Data Flow**
**⟲ System Process**
**⟶ User Interaction**
**● Active Component**
**○ Passive Component**

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph RP["Resource Pack Layer"]
        UIDefs["UI Definitions"]
        FormLayouts["Form Layouts"]
        Textures["UI Textures"]
    end

    subgraph UI["UI Management Layer"]
        Forms["Forms Handler"]
        TypeMgmt["Type Management"]
        FormDefs["Form Definitions"]
    end

    subgraph Core["Core System Layer"]
        direction TB
        MainEntry["System Entry Point"]
        Config["Configuration System"]
        
        subgraph Functions["Core Functions"]
            direction TB
            Time["Time Management"]
            Score["Score Management"]
            NumFormat["Number Formatting"]
            RomanNum["Roman Numeral Converter"]
            ForceUI["UI Force Display"]
        end
    end

    subgraph DB["Database Layer"]
        DBStorage[(Database Storage)]
        DBHandler["Database Handler"]
    end

    %% Relationships
    RP --> UI
    UI --> Core
    Core --> DB
    Config --> Functions
    Config --> UI
    DBHandler <--> DBStorage

    %% Component Styling
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:1px
    classDef resource fill:#FFE6CC,stroke:#D79B00
    classDef ui fill:#DAE8FC,stroke:#6C8EBF
    classDef core fill:#D5E8D4,stroke:#82B366
    classDef database fill:#F8CECC,stroke:#B85450
    classDef config fill:#E1D5E7,stroke:#9673A6

    class UIDefs,FormLayouts,Textures resource
    class Forms,TypeMgmt,FormDefs ui
    class MainEntry,Functions,Time,Score,NumFormat,RomanNum,ForceUI core
    class DBStorage,DBHandler database
    class Config config

    %% Click Events
    click UIDefs "https://github.com/WhiteeCattt/Auction-House/blob/main/RP/ui/_ui_defs.json"
    click FormLayouts "https://github.com/WhiteeCattt/Auction-House/tree/main/RP/ui"
    click Textures "https://github.com/WhiteeCattt/Auction-House/tree/main/RP/textures/ui"
    click Forms "https://github.com/WhiteeCattt/Auction-House/blob/main/BP/scripts/ChestUI/forms.js"
    click TypeMgmt "https://github.com/WhiteeCattt/Auction-House/blob/main/BP/scripts/ChestUI/typeIds.js"
    click FormDefs "https://github.com/WhiteeCattt/Auction-House/blob/main/BP/scripts/ChestUI/forms.d.ts"
    click MainEntry "https://github.com/WhiteeCattt/Auction-House/blob/main/BP/scripts/index.js"
    click Config "https://github.com/WhiteeCattt/Auction-House/blob/main/BP/scripts/config.js"
    click Time "https://github.com/WhiteeCattt/Auction-House/blob/main/BP/scripts/Functions/expiredTime.js"
    click Score "https://github.com/WhiteeCattt/Auction-House/blob/main/BP/scripts/Functions/getScore.js"
    click NumFormat "https://github.com/WhiteeCattt/Auction-House/blob/main/BP/scripts/Functions/formatNumber.js"
    click RomanNum "https://github.com/WhiteeCattt/Auction-House/blob/main/BP/scripts/Functions/toRomanNumber.js"
    click ForceUI "https://github.com/WhiteeCattt/Auction-House/blob/main/BP/scripts/Functions/forceShow.js"
    click DBStorage "https://github.com/WhiteeCattt/Auction-House/blob/main/BP/entities/database.json"
    click DBHandler "https://github.com/WhiteeCattt/Auction-House/blob/main/BP/scripts/database.js"
```
