# otniel113/tugasbesardap architecture

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

- Interactive diagram: https://gitdiagram.com/otniel113/tugasbesardap
- Repository: https://github.com/otniel113/tugasbesardap

## Overview

##### Project type and purpose
- This is a single-executable, command-line, educational Pascal program (“dinas_kesehatan.pas”) for managing and analyzing a fixed-size array of health-agency records.
- It is *not* a multi-tier web app or service, but a monolithic procedural application: the user enters data via the console; the program stores it in an in-memory array; then it performs various computations, searches, sorts, and prints results.

##### File structure
- Top-level directory “Dinas Kesehatan” contains:
- dinas_kesehatan.pas (the sole source code)
- dinas_kesehatan.o / dinas_kesehatan.exe (compiled artifacts)
- README.md describes the data model, user workflow, and features; no separate modules, libraries, or external services are present.
- No network, no database—just Pascal’s runtime and standard I/O.

##### README for additional insights
- The core data type is a record `Kesehatan` with fields: Name, Asuhan (case count), Tenaga_Kesehatan (staff count), Rasio (ratio).
- The main workflow steps:
1) Read N (1–10) agencies
2) Read each agency’s details
3) Print initial table
4) Search by name & display record if found
5) Find agency with max Asuhan
6) Compute average Tenaga_Kesehatan
7) Compute and sort by Rasio ascending
8) Print sorted by Rasio
9) Sort by Tenaga_Kesehatan ascending
10) Print sorted by Tenaga_Kesehatan

##### Detail without over-engineering
- Because there is only one source file, break it into logical subcomponents rather than physical ones.
- Major routines and data transformations—this ensures completeness even in a small procedural codebase.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "I/O Modules"
        Input["Console Input Module"]:::io
        Output["Console Output Module"]:::io
    end

    subgraph "Data Model"
        DataModel["Data Model\n(record & array)"]:::data
    end

    subgraph "Processing Services"
        Search["SearchService"]:::service
        Stats["StatsService"]:::service
        Ratio["RatioService"]:::service
        Sort["SortService"]:::service
    end

    subgraph "Artifacts & Docs"
        Runtime["Runtime Environment\n(Executable)"]:::artifact
        Obj["Build Artifact\n(Object file)"]:::artifact
        Doc["Project Documentation\n(README)"]:::doc
    end

    Input -->|"read N & records (1)"| DataModel
    DataModel -->|"provide data"| Search
    Search -->|"found record (4)"| Output
    DataModel -->|"provide data"| Stats
    Stats -->|"max & avg (5-6)"| Output
    DataModel -->|"provide data"| Ratio
    Ratio -->|"computed Rasio (7)"| DataModel
    DataModel -->|"updated Rasio"| Sort
    Sort -->|"sorted array (8-10)"| Output
    Runtime -.-> Input

    click Input "https://github.com/otniel113/tugasbesardap/blob/main/Dinas Kesehatan/dinas_kesehatan.pas"
    click Output "https://github.com/otniel113/tugasbesardap/blob/main/Dinas Kesehatan/dinas_kesehatan.pas"
    click DataModel "https://github.com/otniel113/tugasbesardap/blob/main/Dinas Kesehatan/dinas_kesehatan.pas"
    click Search "https://github.com/otniel113/tugasbesardap/blob/main/Dinas Kesehatan/dinas_kesehatan.pas"
    click Stats "https://github.com/otniel113/tugasbesardap/blob/main/Dinas Kesehatan/dinas_kesehatan.pas"
    click Ratio "https://github.com/otniel113/tugasbesardap/blob/main/Dinas Kesehatan/dinas_kesehatan.pas"
    click Sort "https://github.com/otniel113/tugasbesardap/blob/main/Dinas Kesehatan/dinas_kesehatan.pas"
    click Runtime "https://github.com/otniel113/tugasbesardap/blob/main/Dinas Kesehatan/dinas_kesehatan.exe"
    click Obj "https://github.com/otniel113/tugasbesardap/blob/main/Dinas Kesehatan/dinas_kesehatan.o"
    click Doc "https://github.com/otniel113/tugasbesardap/blob/main/README.md"

    classDef io fill:#add8e6,stroke:#000,stroke-width:1px
    classDef data fill:#90ee90,stroke:#000,stroke-width:1px
    classDef service fill:#ffa500,stroke:#000,stroke-width:1px
    classDef artifact fill:#d3d3d3,stroke:#000,stroke-width:1px
    classDef doc fill:#ffffe0,stroke:#000,stroke-width:1px
```
