# ay2425s2-cs2103t-t13-1/tp architecture

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

- Interactive diagram: https://gitdiagram.com/ay2425s2-cs2103t-t13-1/tp
- Repository: https://github.com/ay2425s2-cs2103t-t13-1/tp

## Overview

##### Main Components
- Frontend/UI Module: Located in the “src/main/java/seedu/address/ui” package and supported by FXML files under “src/main/resources/view”. This component includes all the visual elements (e.g., MainWindow, CommandBox, ResultDisplay) which handle user interactions.
- Business Logic Layer: Found in “src/main/java/seedu/address/logic” along with command classes (like AddCommand, EditCommand, DeleteCommand) and parsers. This module processes user commands and orchestrates the flow of data between the UI and the model.
- Domain/Model Layer: Provided by “src/main/java/seedu/address/model” which represents the underlying data structures such as Person, AddressBook, Schedule, and related exceptions; these capture the business data and rules.
- Storage Module: Evident in “src/main/java/seedu/address/storage”, responsible for persisting data (using JSON files, for example). This includes file handling and the management of user preferences.
- Configuration/Supporting Modules: There are configuration files such as “build.gradle”, checkstyle configurations in “config/checkstyle”, and Gradle wrapper files to support building, coding standards, and project management.

##### Relationships and Interactions
– From the UI module to the Logic module: representing user input and command processing.
– From the Logic to Model: showing how commands interact with domain objects.
– From the Model to Storage: illustrating saving/loading of data.
- The Logic module also interacts with utility classes (e.g., in the “commons/util” package), so include a link or note for these helper components.

##### Architectural Patterns and Design Principles
- MVC/Separation of Concerns: Clearly demarcate the UI, logic, and model layers.
- Command Pattern: Within the logic layer, note how various Command classes encapsulate user actions.
- Exception Handling and Utility Classes: Point out that dedicated exceptions and utility classes are available to support the core functionality.
- Use of Gradle build scripts for dependency management and automation.

##### Deployment/Build Aspects
- Although not the focus of system design, the existence of continuous integration (CI) workflows (e.g., GitHub Actions in “.github/workflows/gradle.yml”) should be noted as part of the overall project architecture so that future maintainers understand the build and deployment pipeline.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interface Layer
    subgraph "User Interface Layer"
        UI_Controller["UI Manager (JavaFX Code)"]:::ui
        UI_View["UI View (FXML/Styles)"]:::ui
    end

    %% Business Logic Layer
    subgraph "Business Logic Layer"
        Logic_Manager["Business Logic (Commands, Parsers)"]:::logic
        Utilities["Utility Classes (commons/util)"]:::logic
    end

    %% Domain/Model Layer
    subgraph "Domain/Model Layer"
        Model_Manager["Domain Model (Person, AddressBook, Schedule)"]:::model
    end

    %% Data Persistence Layer
    subgraph "Data Persistence Layer"
        Storage_Manager["Storage Manager (Persistence, File Handling)"]:::storage
    end

    %% Configuration & Build Tools
    subgraph "Configuration & Build Tools"
        Build_Script["Gradle Build Script"]:::config
        Code_Style["Code Style Config (Checkstyle)"]:::config
        Gradle_Wrapper["Gradle Wrapper"]:::config
        CI_CD["CI/CD Workflow"]:::config
    end

    %% Connections between Main Layers
    UI_Controller -->|"UserInput"| Logic_Manager
    UI_View -->|"UserInteraction"| Logic_Manager
    Logic_Manager -->|"Uses"| Utilities
    Logic_Manager -->|"ProcessCommand"| Model_Manager
    Model_Manager -->|"PersistenceCall"| Storage_Manager

    %% Styles for different layers
    classDef ui fill:#AED6F1,stroke:#34495E,color:#2C3E50,stroke-width:2px;
    classDef logic fill:#A9DFBF,stroke:#1E8449,color:#145A32,stroke-width:2px;
    classDef model fill:#F9E79F,stroke:#B9770E,color:#7D6608,stroke-width:2px;
    classDef storage fill:#D7BDE2,stroke:#6C3483,color:#4A235A,stroke-width:2px;
    classDef config fill:#F5B7B1,stroke:#922B21,color:#641E16,stroke-width:2px;

    %% Click Events for Component Mappings
    click UI_Controller "https://github.com/ay2425s2-cs2103t-t13-1/tp/tree/master/src/main/java/seedu/address/ui"
    click UI_View "https://github.com/ay2425s2-cs2103t-t13-1/tp/tree/master/src/main/resources/view"
    click Logic_Manager "https://github.com/ay2425s2-cs2103t-t13-1/tp/tree/master/src/main/java/seedu/address/logic"
    click Model_Manager "https://github.com/ay2425s2-cs2103t-t13-1/tp/tree/master/src/main/java/seedu/address/model"
    click Storage_Manager "https://github.com/ay2425s2-cs2103t-t13-1/tp/tree/master/src/main/java/seedu/address/storage"
    click Build_Script "https://github.com/ay2425s2-cs2103t-t13-1/tp/blob/master/build.gradle"
    click Code_Style "https://github.com/ay2425s2-cs2103t-t13-1/tp/tree/master/config/checkstyle"
    click Gradle_Wrapper "https://github.com/ay2425s2-cs2103t-t13-1/tp/tree/master/gradle/wrapper"
    click CI_CD "https://github.com/ay2425s2-cs2103t-t13-1/tp/blob/master/.github/workflows/gradle.yml"
```
