# neykandre/kpo-2025 architecture

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

- Interactive diagram: https://gitdiagram.com/neykandre/kpo-2025
- Repository: https://github.com/neykandre/kpo-2025

## Overview

##### Overall Repository Structure
– The root-level configuration/build scripts (build.gradle.kts, gradle/ wrapper files, etc.) which are common for managing builds.
– The “practice” directory that contains three independent projects: practise-1, practise-2, and practise-3.

##### Diagramming Each Practise Project
For each practise project, you want to capture its layered architecture. Although all three follow a similar domain (cars, engines, customers) theme, they evolve in complexity:

► Practise-1:
– Components:
- Application Entry (e.g., Main.java located in the “studying” package).
- Domain Classes (Car, Customer, Engine, FactoryAF, etc.).
– Interaction: The Main class orchestrates the creation and use of domain objects. The design is simple, focusing on basic instantiation and interaction among these objects.

► Practise-2:
– New Layers Introduced:
- Domain Layer: Now organized with subpackages like “domains” (Car, Customer, HandEngine, PedalEngine).
- Factory Layer: Separate packages for “factories” (HandCarFactory, PedalCarFactory) and “interfaces” (ICarFactory, IEngine, etc.) that illustrate the use of abstraction.
- Service Layer: Classes such as CarService, CustomerStorage, HseCarService encapsulate business logic.
- Parameter Classes: “params” package for engine configurations.
– Interaction: The Main class initiates processes that flow into the service layer, which in turn calls upon factory methods and interacts with domain objects.

► Practise-3:
– Added Complexity:
- Similar layered structure as practise-2 but includes configuration files (in the “config” directory) and resource management (under src/main/resources).
- Testing Support: A dedicated test directory with tests for the main application.
- Likely evolution towards a more production-like setup (e.g., the presence of an application.properties file and checkstyle configuration).
– Interaction: Beyond the standard layers (entry, domain, service, factory, params), indicate that configuration settings and tests play a role in the application’s behavior and quality assurance.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Overall Repository Structure
    BuildConfig("Overall Build Configuration"):::config
    PractiseContainer("Practise Projects Container"):::general
    BuildConfig -->|"manages"| PractiseContainer

    %% Practise-1 Subgraph
    subgraph "Practise-1"
        P1_App("Presentation Layer – Main (Practise-1)"):::presentation
        P1_Dom("Domain Layer – Car,Customer,Engine,etc. (Practise-1)"):::domain
        P1_App -->|"calls"| P1_Dom
    end
    PractiseContainer --> P1_App

    %% Practise-2 Subgraph
    subgraph "Practise-2"
        P2_App("Presentation Layer – Main (Practise-2)"):::presentation
        P2_Service("Service Layer (Practise-2)"):::service
        P2_Factories("Factory Layer – Factories (Practise-2)"):::factory
        P2_Interfaces("Factory Layer – Interfaces (Practise-2)"):::factory
        P2_Dom("Domain Layer (Practise-2)"):::domain
        P2_Params("Parameter Classes (Practise-2)"):::params

        P2_App -->|"initiates"| P2_Service
        P2_Service -->|"delegates"| P2_Factories
        P2_Service -->|"delegates"| P2_Interfaces
        P2_Factories -->|"creates"| P2_Dom
        P2_Interfaces -->|"abstracts"| P2_Dom
        P2_Service -->|"configures"| P2_Params
    end
    PractiseContainer --> P2_App

    %% Practise-3 Subgraph
    subgraph "Practise-3"
        P3_App("Presentation Layer – KpoApplication (Practise-3)"):::presentation
        P3_Service("Service Layer (Practise-3)"):::service
        P3_Factories("Factory Layer – Factories (Practise-3)"):::factory
        P3_Interfaces("Factory Layer – Interfaces (Practise-3)"):::factory
        P3_Dom("Domain Layer (Practise-3)"):::domain
        P3_Params("Parameter Classes (Practise-3)"):::params
        P3_Config("Configuration & Resources (Practise-3)"):::config
        P3_Test("Testing (Practise-3)"):::test

        P3_App -->|"triggers"| P3_Service
        P3_Service -->|"uses"| P3_Factories
        P3_Service -->|"uses"| P3_Interfaces
        P3_Factories -->|"builds"| P3_Dom
        P3_Interfaces -->|"abstracts"| P3_Dom
        P3_Service -->|"provides"| P3_Params
        P3_App -->|"reads"| P3_Config
        P3_Test -->|"validates"| P3_App
    end
    PractiseContainer --> P3_App

    %% Click Events for Overall Build Configuration and Practise Container
    click BuildConfig "https://github.com/neykandre/kpo-2025/blob/main/build.gradle.kts"
    click PractiseContainer "https://github.com/neykandre/kpo-2025/tree/main/practice/"

    %% Click Events for Practise-1
    click P1_App "https://github.com/neykandre/kpo-2025/blob/main/practice/practise-1/src/main/java/studying/Main.java"
    click P1_Dom "https://github.com/neykandre/kpo-2025/tree/main/practice/practise-1/src/main/java/studying/"

    %% Click Events for Practise-2
    click P2_App "https://github.com/neykandre/kpo-2025/blob/main/practice/practise-2/src/main/java/studying/Main.java"
    click P2_Dom "https://github.com/neykandre/kpo-2025/tree/main/practice/practise-2/src/main/java/studying/domains/"
    click P2_Factories "https://github.com/neykandre/kpo-2025/tree/main/practice/practise-2/src/main/java/studying/factories/"
    click P2_Interfaces "https://github.com/neykandre/kpo-2025/tree/main/practice/practise-2/src/main/java/studying/interfaces/"
    click P2_Service "https://github.com/neykandre/kpo-2025/tree/main/practice/practise-2/src/main/java/studying/services/"
    click P2_Params "https://github.com/neykandre/kpo-2025/tree/main/practice/practise-2/src/main/java/studying/params/"

    %% Click Events for Practise-3
    click P3_App "https://github.com/neykandre/kpo-2025/blob/main/practice/practise-3/src/main/java/hse/kpo/KpoApplication.java"
    click P3_Dom "https://github.com/neykandre/kpo-2025/tree/main/practice/practise-3/src/main/java/hse/kpo/domains/"
    click P3_Factories "https://github.com/neykandre/kpo-2025/tree/main/practice/practise-3/src/main/java/hse/kpo/factories/"
    click P3_Interfaces "https://github.com/neykandre/kpo-2025/tree/main/practice/practise-3/src/main/java/hse/kpo/interfaces/"
    click P3_Service "https://github.com/neykandre/kpo-2025/tree/main/practice/practise-3/src/main/java/hse/kpo/services/"
    click P3_Params "https://github.com/neykandre/kpo-2025/tree/main/practice/practise-3/src/main/java/hse/kpo/params/"
    click P3_Config "https://github.com/neykandre/kpo-2025/tree/main/practice/practise-3/config/"
    click P3_Test "https://github.com/neykandre/kpo-2025/tree/main/practice/practise-3/src/test/"

    %% Styles
    classDef presentation fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef domain fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef service fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef factory fill:#d1ecf1,stroke:#0c5460,stroke-width:2px;
    classDef params fill:#e2e3e5,stroke:#6c757d,stroke-width:2px;
    classDef config fill:#f8d7da,stroke:#721c24,stroke-width:2px;
    classDef test fill:#f5c6cb,stroke:#721c24,stroke-width:2px;
    classDef general fill:#eaffea,stroke:#28a745,stroke-width:2px;
```
