# julian-florez/oliso architecture

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

- Interactive diagram: https://gitdiagram.com/julian-florez/oliso
- Repository: https://github.com/julian-florez/oliso

## Overview

##### Project Type and Purpose
- The README reveals that Oliso is a modern variation of Tic Tac Toe with enhanced gameplay mechanics, developed as part of a university project.
- Key features include unique gameplay mechanics, cross-platform compatibility (Java-based), and an intuitive UI, with different win conditions (Same Size, Ascending Order, Stacked Win).

##### File Structure
- The top-level structure includes configuration and project files (.gitignore, .iml, META-INF) along with the README.
- All source code lives under the “src” directory which is divided into distinct subdirectories for:
- assets – containing multimedia elements (audio files, font files, and graphical bases for markers).
- controller – holding the game logic controllers such as GameController.java and SoundManager.java.
- model – featuring the business logic and game data (e.g., Board, GameModel, Player, Pieces, Turn, Square, etc.) along with exception handling (InvalidMoveException.java).
- view – covering the graphical user interface (GUI) classes including the main game window (GameWindow.java), graphical management (GraphicalManager.java), and custom UI elements (RoundJTextField.java).

a. Main Components to Include:
- Frontend/UI Layer: Represent the view (GameWindow, GraphicalManager, and custom UI widgets like RoundJTextField) which renders the game interface.
- Application Logic: Capture the controller(s) like GameController and SoundManager that manage user input, game flow, and sound effects.
- Data/Model Layer: Include core game logic components (GameModel, Board, Piece, Player, Turn, etc.) and error handling (InvalidMoveException).
- Assets: Show resource management (audio clips, fonts, and visual assets in assets folder) that support UI and gameplay.
- External/Configuration Components: Note build configurations (META-INF, .gitignore), which are environment-related supporting files.

b. Relationships and Interactions:
- The View (UI) sends user inputs to the Controller (GameController) and receives updates for rendering.
- The Controller manipulates the Model (GameModel and related classes) to update game state based on user actions.
- The Model computes game logic (valid moves, win/tie conditions, board state) and informs the Controller of any state changes.
- The Controller also interacts with the SoundManager to play audio cues, pulling media from the assets folder.

c. Architectural Patterns & Design Principles:
- The project is structured in an MVC-like pattern:
- Model: Represents the domain/business logic.
- View: Handles all UI rendering.
- Controller: Manages game flow and orchestrates actions between the model and view.
- Points such as dependency management (controller accessing both model and assets) and custom exception handling used for invalid moves.

d. Relevant Technologies, Frameworks, or Libraries:
- Core language: Java (JDK 21 or later).
- No external libraries are explicitly mentioned but the project’s structure implies standard Java GUI components.
- Assets include audio files (WAV format) and a custom font (SaedaBold.otf).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External/Configuration Components
    subgraph "External/Configuration"
        ext1[".gitignore"]:::external
        ext2["META-INF"]:::external
        ext3["Oliso.iml"]:::external
        ext4["src/META-INF"]:::external
    end

    %% Assets and Resources
    subgraph "Assets and Resources"
        asset_audio["Audio Assets: correct.wav, wrong.wav"]:::assets
        asset_menu["Menu Assets: SaedaBold.otf"]:::assets
        asset_bases["Image/Base Assets"]:::assets
    end

    %% Data/Model Layer
    subgraph "Data/Model Layer"
        model1["GameModel (Model)"]:::model
        model2["Board (Model)"]:::model
        model3["ColorPiece (Model)"]:::model
        model4["Piece (Model)"]:::model
        model5["Player (Model)"]:::model
        model6["Square (Model)"]:::model
        model7["Turn (Model)"]:::model
        model8["InvalidMoveException (Exception)"]:::model
    end

    %% Application Logic (Controllers)
    subgraph "Application Logic"
        ctrl1["GameController (Controller)"]:::controller
        ctrl2["SoundManager (Controller)"]:::controller
    end

    %% Frontend/UI Layer
    subgraph "Frontend/UI Layer"
        view1["GameWindow (View)"]:::view
        view2["GraphicalManager (View)"]:::view
        view3["RoundJTextField (View)"]:::view
    end

    %% Connections between layers
    view1 -->|"userInputs"| ctrl1
    view1 -->|"coordinates"| view2
    ctrl1 -->|"updateGameState"| model1
    model1 -->|"stateUpdate"| ctrl1
    ctrl1 -->|"renderUpdate"| view1
    ctrl1 -->|"triggerSound"| ctrl2
    ctrl2 -->|"playAudio"| asset_audio
    view2 -->|"loadVisuals"| asset_bases

    %% External/Configuration influencing system
    ext2 -->|"loadConfig"| ctrl1
    ext2 -->|"loadConfig"| model1

    %% Class definitions for styling
    classDef view fill:#a1d8f0,stroke:#0294a5,stroke-width:2px;
    classDef controller fill:#f9d5e5,stroke:#e5383b,stroke-width:2px;
    classDef model fill:#d3f8e2,stroke:#2d6a4f,stroke-width:2px;
    classDef assets fill:#fff3b0,stroke:#f4d35e,stroke-width:2px;
    classDef external fill:#e0d3f1,stroke:#6c5ce7,stroke-width:2px;

    %% Click Events for Frontend/UI Layer
    click view1 "https://github.com/julian-florez/oliso/blob/main/src/view/GameWindow.java"
    click view2 "https://github.com/julian-florez/oliso/blob/main/src/view/GraphicalManager.java"
    click view3 "https://github.com/julian-florez/oliso/blob/main/src/view/RoundJTextField.java"

    %% Click Events for Application Logic (Controllers)
    click ctrl1 "https://github.com/julian-florez/oliso/blob/main/src/controller/GameController.java"
    click ctrl2 "https://github.com/julian-florez/oliso/blob/main/src/controller/SoundManager.java"

    %% Click Events for Data/Model Layer
    click model1 "https://github.com/julian-florez/oliso/blob/main/src/model/GameModel.java"
    click model2 "https://github.com/julian-florez/oliso/blob/main/src/model/Board.java"
    click model3 "https://github.com/julian-florez/oliso/blob/main/src/model/ColorPiece.java"
    click model4 "https://github.com/julian-florez/oliso/blob/main/src/model/Piece.java"
    click model5 "https://github.com/julian-florez/oliso/blob/main/src/model/Player.java"
    click model6 "https://github.com/julian-florez/oliso/blob/main/src/model/Square.java"
    click model7 "https://github.com/julian-florez/oliso/blob/main/src/model/Turn.java"
    click model8 "https://github.com/julian-florez/oliso/blob/main/src/model/InvalidMoveException.java"

    %% Click Events for Assets and Resources
    click asset_audio "https://github.com/julian-florez/oliso/tree/main/src/assets/audio"
    click asset_menu "https://github.com/julian-florez/oliso/tree/main/src/assets/menu"
    click asset_bases "https://github.com/julian-florez/oliso/tree/main/src/assets/bases"

    %% Click Events for External/Configuration Components
    click ext1 "https://github.com/julian-florez/oliso/blob/main/.gitignore"
    click ext2 "https://github.com/julian-florez/oliso/tree/main/META-INF"
    click ext3 "https://github.com/julian-florez/oliso/blob/main/Oliso.iml"
    click ext4 "https://github.com/julian-florez/oliso/tree/main/src/META-INF"
```
