# danzgne/dictionary-app architecture

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

- Interactive diagram: https://gitdiagram.com/danzgne/dictionary-app
- Repository: https://github.com/danzgne/dictionary-app

## Overview

##### Project type and purpose
- This is a standalone Java desktop application (packaged as dictionary-app.jar) that provides dictionary operations (add, edit, delete, search), search history tracking, and mini “game modes” (guess definition, guess slang, random word, today’s word).
- Users interact via GUI windows, which call into core logic to manipulate data stored in flat files under resources/.

##### File structure
- Top-level:
- dictionary-app.jar            – the compiled runnable JAR
- resources/                   – data files and manifest
- src/                         – all .java source files
- In src/:
- GUI classes (AddGUI, DeleteGUI, EditGUI, MainMenu, ManagementGUI, etc.) – UI layer
- Main.java                   – application entry point
- FileOperations.java         – reads/writes resources/*.txt and today_word.bin
- SlangWordList.java, History.java, DefinitionsSearchHistory.java, SlangSearchHistory.java – domain models for words and histories
- KMPMatcher.java             – search algorithm implementation
- No database; data persistence is via text/binary files in resources/.

##### Relevant README insights
- README only indicates project name (“dictionary-app”), so everything else must be inferred from code structure.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Entry Point
    Main["Main.java"]:::entry

    %% UI Layer
    subgraph "UI Layer"
        MainMenu["MainMenu"]:::UI
        ManagementGUI["ManagementGUI"]:::UI
        AddGUI["AddGUI"]:::UI
        EditGUI["EditGUI"]:::UI
        DeleteGUI["DeleteGUI"]:::UI
        SearchGUI["SearchGUI"]:::UI
        SearchDefinitionsGUI["SearchDefinitionsGUI"]:::UI
        GameModeGUI["GameModeGUI"]:::UI
        RandomGUI["RandomGUI"]:::UI
        GuessDefinitionGUI["GuessDefinitionGUI"]:::UI
        GuessSlangGUI["GuessSlangGUI"]:::UI
        ResetGUI["ResetGUI"]:::UI
    end

    %% Application Logic Layer
    subgraph "Application Logic"
        FileOperations["FileOperations\n(I/O to resources/*.txt/.bin)"]:::logic
        KMPMatcher["KMPMatcher\n(string matching)"]:::logic
    end

    %% Domain Models
    subgraph "Domain Models"
        SlangWordList["SlangWordList"]:::domain
        History["History"]:::domain
        DefinitionsSearchHistory["DefinitionsSearchHistory"]:::domain
        SlangSearchHistory["SlangSearchHistory"]:::domain
    end

    %% Data Store
    subgraph "Data Store"
        slangTxt[(slang.txt)]:::data
        inputTxt[(input.txt)]:::data
        defHistTxt[(definitions_search_history.txt)]:::data
        slangHistTxt[(slang_search_history.txt)]:::data
        todayBin[(today_word.bin)]:::data
        manifest[(META-INF/MANIFEST.MF)]:::data
        jar[(dictionary-app.jar)]:::data
    end

    %% Connections
    Main --> MainMenu
    Main --> FileOperations
    Main --> SlangWordList

    MainMenu & ManagementGUI & AddGUI & EditGUI & DeleteGUI & SearchGUI & SearchDefinitionsGUI & GameModeGUI & RandomGUI & GuessDefinitionGUI & GuessSlangGUI & ResetGUI --> FileOperations

    FileOperations --> KMPMatcher
    FileOperations --> SlangWordList
    FileOperations --> History
    FileOperations --> DefinitionsSearchHistory
    FileOperations --> SlangSearchHistory

    FileOperations --> slangTxt
    FileOperations --> inputTxt
    FileOperations --> defHistTxt
    FileOperations --> slangHistTxt
    FileOperations --> todayBin

    SlangWordList --> slangTxt
    SlangWordList --> inputTxt

    History --> defHistTxt
    DefinitionsSearchHistory --> defHistTxt
    SlangSearchHistory --> slangHistTxt

    GameModeGUI --> SlangWordList

    %% Click Events
    click Main "https://github.com/danzgne/dictionary-app/blob/main/src/Main.java"
    click MainMenu "https://github.com/danzgne/dictionary-app/blob/main/src/MainMenu.java"
    click ManagementGUI "https://github.com/danzgne/dictionary-app/blob/main/src/ManagementGUI.java"
    click AddGUI "https://github.com/danzgne/dictionary-app/blob/main/src/AddGUI.java"
    click EditGUI "https://github.com/danzgne/dictionary-app/blob/main/src/EditGUI.java"
    click DeleteGUI "https://github.com/danzgne/dictionary-app/blob/main/src/DeleteGUI.java"
    click SearchGUI "https://github.com/danzgne/dictionary-app/blob/main/src/SearchGUI.java"
    click SearchDefinitionsGUI "https://github.com/danzgne/dictionary-app/blob/main/src/SearchDefinitionsGUI.java"
    click GameModeGUI "https://github.com/danzgne/dictionary-app/blob/main/src/GameModeGUI.java"
    click RandomGUI "https://github.com/danzgne/dictionary-app/blob/main/src/RandomGUI.java"
    click GuessDefinitionGUI "https://github.com/danzgne/dictionary-app/blob/main/src/GuessDefinitionGUI.java"
    click GuessSlangGUI "https://github.com/danzgne/dictionary-app/blob/main/src/GuessSlangGUI.java"
    click ResetGUI "https://github.com/danzgne/dictionary-app/blob/main/src/ResetGUI.java"
    click FileOperations "https://github.com/danzgne/dictionary-app/blob/main/src/FileOperations.java"
    click KMPMatcher "https://github.com/danzgne/dictionary-app/blob/main/src/KMPMatcher.java"
    click SlangWordList "https://github.com/danzgne/dictionary-app/blob/main/src/SlangWordList.java"
    click History "https://github.com/danzgne/dictionary-app/blob/main/src/History.java"
    click DefinitionsSearchHistory "https://github.com/danzgne/dictionary-app/blob/main/src/DefinitionsSearchHistory.java"
    click SlangSearchHistory "https://github.com/danzgne/dictionary-app/blob/main/src/SlangSearchHistory.java"
    click slangTxt "https://github.com/danzgne/dictionary-app/blob/main/resources/slang.txt"
    click inputTxt "https://github.com/danzgne/dictionary-app/blob/main/resources/input.txt"
    click defHistTxt "https://github.com/danzgne/dictionary-app/blob/main/resources/definitions_search_history.txt"
    click slangHistTxt "https://github.com/danzgne/dictionary-app/blob/main/resources/slang_search_history.txt"
    click todayBin "https://github.com/danzgne/dictionary-app/blob/main/resources/today_word.bin"
    click manifest "https://github.com/danzgne/dictionary-app/blob/main/resources/META-INF/MANIFEST.MF"
    click jar "https://github.com/danzgne/dictionary-app/blob/main/dictionary-app.jar"

    %% Styles
    classDef UI fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef logic fill:#90EE90,stroke:#000,stroke-width:1px
    classDef domain fill:#FFFFE0,stroke:#000,stroke-width:1px
    classDef data fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef entry fill:#DDA0DD,stroke:#000,stroke-width:1px
```
