# savire/dloc architecture

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

- Interactive diagram: https://gitdiagram.com/savire/dloc
- Repository: https://github.com/savire/dloc

## Overview

##### Main Components
- Command Line Interface (CLI) Module – This is the entry point to the application where the user’s commands or parameters are parsed.
- Core Logic (Source Code Counter) – Encapsulated primarily in app.dz, this component handles scanning through files or directories, counting source code lines, and applying any filtering logic.
- File System Helper – Although not a separate file, conceptually outline component(s) responsible for accessing directories and reading files.
- Output/Reporting Module – Represents how the final count and possibly additional outputs (e.g., statistics, error messages) are delivered back to the user.

##### Relationships and Interactions
- The CLI Module receives user input (e.g., file paths or options) and passes parameters to the Core Logic.
- The Core Logic invokes the File System Helper to scan directories and obtain file contents.
- After processing, the Core Logic calls the Output/Reporting Module, which displays results directly on the console.
- Optionally, if the program displays a logo or help information, it will reference the Assets folder.
- User Input → CLI Module → Core Logic → File System Helper
- Core Logic → Output Module (results back to the user)
- (Optionally) Assets are referenced by the CLI Module at startup.

##### Architectural Patterns and Design Principles
- Modular Design: Even though the implementation is in a single file (app.dz), conceptually separate the concerns (input handling, processing, file operations, output) into logical modules.
- Separation of Concerns: Clearly delineate responsibilities between parsing, processing, and reporting.
- Command Line Application Pattern: Emphasize how the system design adheres to typical CLI design approaches.

##### Relevant Technologies and Context
- The project uses the DoZe language/platform, which is highlighted in the README. Present the DoZe runtime or compiler as an underlying dependency that executes the app.dz file.
- Mention the pre-compiled binary option for end users, which suggests that the deployment and build process might eventually be more complex but for this project remains straightforward.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["User / Command Prompt"]:::user
    B["CLI Module (Input Parser)"]:::cli
    C["Source Counter (Core Logic)"]:::core
    D["File System Handler"]:::fs
    E["Output/Reporting Module"]:::cli
    F["Assets (DoZe.png)"]:::asset

    A -->|"sends_command"| B
    B -->|"passes_params"| C
    C -->|"scans_files"| D
    C -->|"outputs_results"| E
    B -->|"loads_resource"| F

    click B "https://github.com/savire/dloc/blob/main/app.dz"
    click C "https://github.com/savire/dloc/blob/main/app.dz"
    click D "https://github.com/savire/dloc/blob/main/app.dz"
    click E "https://github.com/savire/dloc/blob/main/app.dz"
    click F "https://github.com/savire/dloc/tree/main/assets"

    classDef user fill:#FAD7A0,stroke:#D35400,stroke-width:2px;
    classDef cli fill:#AED6F1,stroke:#3498DB,stroke-width:2px;
    classDef core fill:#A9DFBF,stroke:#27AE60,stroke-width:2px;
    classDef fs fill:#F9E79F,stroke:#F1C40F,stroke-width:2px;
    classDef asset fill:#D1F2EB,stroke:#16A085,stroke-width:2px;
```
