# soheyb-roukas/topographix architecture

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

- Interactive diagram: https://gitdiagram.com/soheyb-roukas/topographix
- Repository: https://github.com/soheyb-roukas/topographix

## Overview

##### Project Type and Purpose
- Topographix is a single-process Windows desktop application built in Delphi (Pascal) with the VCL framework.
- Its goal is to match 3D coordinate points to axis profiles, compute distances, and show the results in an ordered list.

##### File Structure
- Top-level files:
- Topographix.dpr / .dproj – your main Delphi project.
- Unit1.pas/.dfm and Unit2.pas/.dfm – VCL forms handling the user interface and user interactions.
- “Test Assets” folder – sample input files (text data).

##### README for Extra Clues
- It calls out key features (coordinate matching, distance calculations, neat outputs) and warns about locale decimal settings.
- Technologies: Pascal, VCL, Windows 32/64-bit. No external web services or microservices—just a local, monolithic app.

a. Main Components
- User Interface Layer (VCL Forms)
- Domain Logic Layer (coordinate matching + distance computation)
- Data Access Layer (file readers for axis profiles and point lists)
- Windows OS & File System (external environment)
b. Relationships & Data Flow
1. User enters or loads point data via the UI.
2. UI calls into the Domain Logic to match coordinates and calculate distances.
3. Domain Logic reads axis definitions and point files from disk (using the Data Access layer).
4. Domain Logic returns an ordered list of results back to the UI.
5. UI renders the list for the user.
c. Architectural Patterns
- Layered / “Onion” style: Presentation → Business Logic → Data Access
- Monolithic, event-driven desktop app
d. Key Technologies
- Delphi Pascal units (Unit1.pas, Unit2.pas)
- VCL Forms (.dfm) for UI components
- Windows API / File I/O
- Localization concern (decimal separator)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Environment
    OS["Windows OS & File System"]:::external
    NoteLocale(["Note: Locale decimal separator setting"]):::external
    OS --> NoteLocale

    %% Data Access Layer
    subgraph "Data Access Layer"
        direction TB
        FileReader["FileReaderService"]:::dataaccess
        TestAssets["Test Assets"]:::dataaccess
    end

    OS -->|"reads sample files"| FileReader
    FileReader --> TestAssets

    %% Domain Logic Layer
    subgraph "Domain Logic Layer"
        direction TB
        CoordService["CoordinateMatchingService"]:::logic
    end

    FileReader -->|"provides data"| CoordService

    %% User Interface Layer
    subgraph "User Interface Layer"
        direction TB
        MainForm["Main Form (Unit1)"]:::ui
        SecondaryForm["Secondary Form (Unit2)"]:::ui
    end

    CoordService -->|"returns results"| MainForm
    MainForm -->|"opens dialogs"| SecondaryForm
    MainForm -->|"invokes matching"| CoordService

    %% Project Entry & Resources
    subgraph "Project & Resources"
        direction TB
        EntryPoint["Topographix.dpr"]:::project
        ProjectFiles["Project Settings (.dproj)"]:::project
        Resources["Resources (.res)"]:::project
        Docs["README.md"]:::project
    end

    EntryPoint --> MainForm
    EntryPoint --> SecondaryForm
    EntryPoint --> CoordService

    %% Click Events
    click EntryPoint "https://github.com/soheyb-roukas/topographix/blob/main/Topographix.dpr"
    click MainForm "https://github.com/soheyb-roukas/topographix/blob/main/Unit1.pas"
    click MainForm "https://github.com/soheyb-roukas/topographix/blob/main/Unit1.dfm"
    click SecondaryForm "https://github.com/soheyb-roukas/topographix/blob/main/Unit2.pas"
    click SecondaryForm "https://github.com/soheyb-roukas/topographix/blob/main/Unit2.dfm"
    click CoordService "https://github.com/soheyb-roukas/topographix/blob/main/Unit2.pas"
    click TestAssets "https://github.com/soheyb-roukas/topographix/tree/main/Test Assets/"
    click Resources "https://github.com/soheyb-roukas/topographix/blob/main/Topographix.res"
    click Resources "https://github.com/soheyb-roukas/topographix/blob/main/PointFixer.res"
    click ProjectFiles "https://github.com/soheyb-roukas/topographix/blob/main/Topographix.dproj"
    click ProjectFiles "https://github.com/soheyb-roukas/topographix/blob/main/Topographix.dproj.local"
    click Docs "https://github.com/soheyb-roukas/topographix/blob/main/README.md"

    %% Styles
    classDef ui fill:#AED6F1,stroke:#1B4F72,color:#1B2631;
    classDef logic fill:#ABEBC6,stroke:#145A32,color:#1B2631;
    classDef dataaccess fill:#F9E79F,stroke:#7D6608,color:#1B2631;
    classDef external fill:#D5DBDB,stroke:#424949,color:#1B2631;
    classDef project fill:#E8DAEF,stroke:#4A235A,color:#1B2631;
```
