# frijal/layarkosong architecture

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

- Interactive diagram: https://gitdiagram.com/frijal/layarkosong
- Repository: https://github.com/frijal/layarkosong

## Overview

Layar Kosong is an automated static-site publishing system for an Indonesian article site. Its principal workflow takes staged HTML through article cleanup, site-data and feed generation, image/schema/minification work, then D1 synchronization and Cloudflare Pages deployment. The deployed site also serves clean URLs, catalog data, and client-side search. The README documents pipeline relationships; source excerpts are limited, so the graph omits unverified internal calls and marks documented pipeline links with README evidence.

Main entry points: [`dapur/generator-pro.ts`](https://github.com/frijal/layarkosong/blob/main/dapur/generator-pro.ts) (Article data and feeds), [`artikel`](https://github.com/frijal/layarkosong/tree/main/artikel) (Published articles), [`functions/katalog.js`](https://github.com/frijal/layarkosong/blob/main/functions/katalog.js) (Article catalog API), [`dapur/Edit-Komponen-HTML.ts`](https://github.com/frijal/layarkosong/blob/main/dapur/Edit-Komponen-HTML.ts) (HTML preparation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_content["Article Processing"]
  node_staged["Staged HTML"]
  node_html_cleanup["HTML preparation"]
  node_seo["SEO processing<br/>[seo-fixer.ts]"]
  node_article_store["Published articles"]
end

subgraph group_generation["Site Generation"]
  node_generator["Article data and feeds<br/>[generator-pro.ts]"]
  node_category["Title categorization<br/>[titleToCategory.ts]"]
  node_images["Responsive images"]
  node_site_metadata["Sitemap and routing files<br/>[koki.ts]"]
  node_llms["AI-facing index<br/>[generate_llms.ts]"]
  node_schema["Structured data<br/>[inject-schema.ts]"]
  node_minify["Asset minification<br/>[minify-html.ts]"]
end

subgraph group_delivery["Search and Delivery"]
  node_search_index["Search index builder<br/>[build-d1.ts]"]
  node_d1_sync["D1 diff sync<br/>[sync-d1-diff.ts]"]
  node_d1[("Cloudflare D1")]
  node_deploy["Cloudflare Pages"]
end

subgraph group_site["Site Experience"]
  node_routes["Clean URL routing<br/>[&#91;&#91;path&#93;&#93;.ts]"]
  node_catalog_api["Article catalog API<br/>[katalog.js]"]
  node_search_ui["Client-side search"]
  node_static_site["Published site"]
end

node_author(("Article author"))
node_requester(("Site visitor"))

node_author -.->|"commits articles"| node_staged
node_staged -.->|"processes HTML"| node_html_cleanup
node_html_cleanup -.->|"updates assets"| node_seo
node_seo -.->|"moves articles"| node_article_store
node_article_store -.->|"generates data"| node_generator
node_generator -->|"categorizes titles"| node_category
node_generator -.->|"generates variants"| node_images
node_generator -.->|"updates site files"| node_site_metadata
node_generator -.->|"generates index"| node_llms
node_generator -.->|"injects schema"| node_schema
node_generator -.->|"minifies outputs"| node_minify
node_article_store -.->|"extracts article data"| node_search_index
node_search_index -->|"writes index"| node_d1
node_d1 -.->|"reads current state"| node_d1_sync
node_d1_sync -.->|"applies patch"| node_d1
node_minify -.->|"prepares deployment"| node_deploy
node_deploy -.->|"publishes site"| node_static_site
node_requester -.->|"requests page"| node_routes
node_routes -.->|"serves content"| node_static_site
node_requester -->|"requests catalog"| node_catalog_api
node_catalog_api -->|"queries articles"| node_d1
node_requester -.->|"uses search"| node_search_ui
node_search_ui -.->|"fetches catalog"| node_catalog_api

click node_staged "https://github.com/frijal/layarkosong/tree/main/artikel"
click node_html_cleanup "https://github.com/frijal/layarkosong/blob/main/dapur/Edit-Komponen-HTML.ts"
click node_seo "https://github.com/frijal/layarkosong/blob/main/dapur/seo-fixer.ts"
click node_article_store "https://github.com/frijal/layarkosong/tree/main/artikel"
click node_generator "https://github.com/frijal/layarkosong/blob/main/dapur/generator-pro.ts"
click node_category "https://github.com/frijal/layarkosong/blob/main/dapur/titleToCategory.ts"
click node_images "https://github.com/frijal/layarkosong/blob/main/dapur/srcset-generator.ts"
click node_site_metadata "https://github.com/frijal/layarkosong/blob/main/dapur/koki.ts"
click node_llms "https://github.com/frijal/layarkosong/blob/main/dapur/generate_llms.ts"
click node_schema "https://github.com/frijal/layarkosong/blob/main/dapur/inject-schema.ts"
click node_minify "https://github.com/frijal/layarkosong/blob/main/dapur/minify-html.ts"
click node_search_index "https://github.com/frijal/layarkosong/blob/main/search/build-d1.ts"
click node_d1_sync "https://github.com/frijal/layarkosong/blob/main/search/sync-d1-diff.ts"
click node_routes "https://github.com/frijal/layarkosong/blob/main/functions/%5B%5Bpath%5D%5D.ts"
click node_catalog_api "https://github.com/frijal/layarkosong/blob/main/functions/katalog.js"
click node_search_ui "https://github.com/frijal/layarkosong/blob/main/ext/halaman-pencarian.js"

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_staged,node_html_cleanup,node_seo,node_article_store toneBlue
class node_generator,node_category,node_images,node_site_metadata,node_llms,node_schema,node_minify toneAmber
class node_search_index,node_d1_sync,node_d1,node_deploy toneMint
class node_routes,node_catalog_api,node_search_ui,node_static_site toneRose
class node_author,node_requester toneIndigo
```

## Components

### Article Processing

- [Staged HTML](https://github.com/frijal/layarkosong/tree/main/artikel): `artikel`
- [HTML preparation](https://github.com/frijal/layarkosong/blob/main/dapur/Edit-Komponen-HTML.ts): `dapur/Edit-Komponen-HTML.ts`
- [SEO processing](https://github.com/frijal/layarkosong/blob/main/dapur/seo-fixer.ts): `dapur/seo-fixer.ts`
- [Published articles](https://github.com/frijal/layarkosong/tree/main/artikel): `artikel`

### Site Generation

- [Article data and feeds](https://github.com/frijal/layarkosong/blob/main/dapur/generator-pro.ts): `dapur/generator-pro.ts`
- [Title categorization](https://github.com/frijal/layarkosong/blob/main/dapur/titleToCategory.ts): `dapur/titleToCategory.ts`
- [Responsive images](https://github.com/frijal/layarkosong/blob/main/dapur/srcset-generator.ts): `dapur/srcset-generator.ts`
- [Sitemap and routing files](https://github.com/frijal/layarkosong/blob/main/dapur/koki.ts): `dapur/koki.ts`
- [AI-facing index](https://github.com/frijal/layarkosong/blob/main/dapur/generate_llms.ts): `dapur/generate_llms.ts`
- [Structured data](https://github.com/frijal/layarkosong/blob/main/dapur/inject-schema.ts): `dapur/inject-schema.ts`
- [Asset minification](https://github.com/frijal/layarkosong/blob/main/dapur/minify-html.ts): `dapur/minify-html.ts`

### Search and Delivery

- [Search index builder](https://github.com/frijal/layarkosong/blob/main/search/build-d1.ts): `search/build-d1.ts`
- [D1 diff sync](https://github.com/frijal/layarkosong/blob/main/search/sync-d1-diff.ts): `search/sync-d1-diff.ts`
- **Cloudflare D1**
- **Cloudflare Pages**

### Site Experience

- [Clean URL routing](https://github.com/frijal/layarkosong/blob/main/functions/%5B%5Bpath%5D%5D.ts): `functions/[[path]].ts`
- [Article catalog API](https://github.com/frijal/layarkosong/blob/main/functions/katalog.js): `functions/katalog.js`
- [Client-side search](https://github.com/frijal/layarkosong/blob/main/ext/halaman-pencarian.js): `ext/halaman-pencarian.js`
- **Published site**

### Other components

- **Article author**
- **Site visitor**

## Connections

- Article author → Staged HTML: commits articles
- Staged HTML → HTML preparation: processes HTML (evidence: `README.md`)
- HTML preparation → SEO processing: updates assets (evidence: `README.md`)
- SEO processing → Published articles: moves articles (evidence: `README.md`)
- Published articles → Article data and feeds: generates data (evidence: `README.md`)
- Article data and feeds → Title categorization: categorizes titles (evidence: `dapur/generator-pro.ts`)
- Article data and feeds → Responsive images: generates variants (evidence: `README.md`)
- Article data and feeds → Sitemap and routing files: updates site files (evidence: `README.md`)
- Article data and feeds → AI-facing index: generates index (evidence: `README.md`)
- Article data and feeds → Structured data: injects schema (evidence: `README.md`)
- Article data and feeds → Asset minification: minifies outputs (evidence: `README.md`)
- Published articles → Search index builder: extracts article data (evidence: `search/build-d1.ts`)
- Search index builder → Cloudflare D1: writes index (evidence: `search/build-d1.ts`)
- Cloudflare D1 → D1 diff sync: reads current state (evidence: `README.md`)
- D1 diff sync → Cloudflare D1: applies patch (evidence: `README.md`)
- Asset minification → Cloudflare Pages: prepares deployment (evidence: `README.md`)
- Cloudflare Pages → Published site: publishes site (evidence: `README.md`)
- Site visitor → Clean URL routing: requests page
- Clean URL routing → Published site: serves content (evidence: `README.md`)
- Site visitor → Article catalog API: requests catalog (evidence: `functions/katalog.js`)
- Article catalog API → Cloudflare D1: queries articles (evidence: `functions/katalog.js`)
- Site visitor → Client-side search: uses search (evidence: `README.md`)
- Client-side search → Article catalog API: fetches catalog
