# jellanarta/daftar-wilayah-indonesia architecture

> Architecture diagram of the GitHub repository jellanarta/daftar-wilayah-indonesia, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jellanarta/daftar-wilayah-indonesia
- Repository: https://github.com/jellanarta/daftar-wilayah-indonesia

## Overview

This package provides Indonesia’s administrative-area dataset and query API. A consumer calls the public functions to list areas by level, look up a code, build hierarchy breadcrumbs, or search names. The API uses shared helpers for code normalization and indexed access; village records are parsed and indexed lazily, while province, regency/city, and district data are imported as datasets. README documents all four levels, dotted or undotted codes, global search, and TypeScript types. The village and district data files were not sampled, so their contents are represented by their indexed roles, not inspected details.

Main entry points: [`src/index.ts`](https://github.com/jellanarta/daftar-wilayah-indonesia/blob/main/src/index.ts) (Public Queries), [`src/helpers.ts`](https://github.com/jellanarta/daftar-wilayah-indonesia/blob/main/src/helpers.ts) (Normalization and Indexes), [`src/data/provinsi.data.ts`](https://github.com/jellanarta/daftar-wilayah-indonesia/blob/main/src/data/provinsi.data.ts) (Province Data), [`src/data/kabupaten.data.ts`](https://github.com/jellanarta/daftar-wilayah-indonesia/blob/main/src/data/kabupaten.data.ts) (Regency Data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Query API"]
  node_public_api["Public Queries<br/>[index.ts]"]
end

subgraph group_catalog["Area Catalog"]
  node_province_data["Province Data<br/>[provinsi.data.ts]"]
  node_regency_data["Regency Data<br/>[kabupaten.data.ts]"]
  node_district_data["District Data<br/>[kecamatan.data.ts]"]
  node_village_data["Village Data<br/>[desa.data.ts]"]
end

subgraph group_core["Shared Runtime"]
  node_helpers["Normalization and Indexes<br/>[helpers.ts]"]
  node_types["Type Contracts<br/>[types.ts]"]
end

node_consumer(("Library Consumer"))

node_consumer -->|"calls"| node_public_api
node_public_api -->|"returns results"| node_consumer
node_public_api -->|"calls"| node_helpers
node_public_api -->|"reads"| node_province_data
node_public_api -->|"reads"| node_regency_data
node_public_api -->|"reads"| node_district_data
node_helpers -->|"indexes"| node_province_data
node_helpers -->|"indexes"| node_regency_data
node_helpers -->|"indexes"| node_district_data
node_helpers -->|"parses lazily"| node_village_data
node_public_api -->|"uses contracts"| node_types
node_helpers -->|"uses contracts"| node_types

click node_public_api "https://github.com/jellanarta/daftar-wilayah-indonesia/blob/main/src/index.ts"
click node_province_data "https://github.com/jellanarta/daftar-wilayah-indonesia/blob/main/src/data/provinsi.data.ts"
click node_regency_data "https://github.com/jellanarta/daftar-wilayah-indonesia/blob/main/src/data/kabupaten.data.ts"
click node_district_data "https://github.com/jellanarta/daftar-wilayah-indonesia/blob/main/src/data/kecamatan.data.ts"
click node_village_data "https://github.com/jellanarta/daftar-wilayah-indonesia/blob/main/src/data/desa.data.ts"
click node_helpers "https://github.com/jellanarta/daftar-wilayah-indonesia/blob/main/src/helpers.ts"
click node_types "https://github.com/jellanarta/daftar-wilayah-indonesia/blob/main/src/types.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_public_api toneBlue
class node_province_data,node_regency_data,node_district_data,node_village_data toneAmber
class node_helpers,node_types toneMint
class node_consumer toneIndigo
```

## Components

### Query API

- [Public Queries](https://github.com/jellanarta/daftar-wilayah-indonesia/blob/main/src/index.ts): `src/index.ts`

### Area Catalog

- [Province Data](https://github.com/jellanarta/daftar-wilayah-indonesia/blob/main/src/data/provinsi.data.ts): `src/data/provinsi.data.ts`
- [Regency Data](https://github.com/jellanarta/daftar-wilayah-indonesia/blob/main/src/data/kabupaten.data.ts): `src/data/kabupaten.data.ts`
- [District Data](https://github.com/jellanarta/daftar-wilayah-indonesia/blob/main/src/data/kecamatan.data.ts): `src/data/kecamatan.data.ts`
- [Village Data](https://github.com/jellanarta/daftar-wilayah-indonesia/blob/main/src/data/desa.data.ts): `src/data/desa.data.ts`

### Shared Runtime

- [Normalization and Indexes](https://github.com/jellanarta/daftar-wilayah-indonesia/blob/main/src/helpers.ts): `src/helpers.ts`
- [Type Contracts](https://github.com/jellanarta/daftar-wilayah-indonesia/blob/main/src/types.ts): `src/types.ts`

### Other components

- **Library Consumer**

## Connections

- Library Consumer → Public Queries: calls (evidence: `README.md`)
- Public Queries → Library Consumer: returns results (evidence: `README.md`)
- Public Queries → Normalization and Indexes: calls (evidence: `src/index.ts`)
- Public Queries → Province Data: reads (evidence: `src/index.ts`)
- Public Queries → Regency Data: reads (evidence: `src/index.ts`)
- Public Queries → District Data: reads (evidence: `src/index.ts`)
- Normalization and Indexes → Province Data: indexes (evidence: `src/helpers.ts`)
- Normalization and Indexes → Regency Data: indexes (evidence: `src/helpers.ts`)
- Normalization and Indexes → District Data: indexes (evidence: `src/helpers.ts`)
- Normalization and Indexes → Village Data: parses lazily (evidence: `src/helpers.ts`)
- Public Queries → Type Contracts: uses contracts (evidence: `src/index.ts`)
- Normalization and Indexes → Type Contracts: uses contracts (evidence: `src/helpers.ts`)
