# romadlon-m/babelens architecture

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

- Interactive diagram: https://gitdiagram.com/romadlon-m/babelens
- Repository: https://github.com/romadlon-m/babelens

## Overview

Babelens is a browser-based platform for retrieving and filtering Bangka Belitung news for economic and PDRB analysis, with a separate operational workflow for staff labeling and administration. The main user flow is keyword/region/sector search into categorized article results; the dashboard supports date- and region-filtered summaries. Labelers claim and submit screener, Lapus, or Pengeluaran work, while administrators review labels and monitor ML shadow predictions. Edges are limited to relationships visible in excerpts or documented in the README; major unsampled capabilities are represented by their exact paths without speculative links.

Main entry points: [`labeling-common.js`](https://github.com/romadlon-m/babelens/blob/main/labeling-common.js) (Labeling pages), [`news-search.js`](https://github.com/romadlon-m/babelens/blob/main/news-search.js) (News search), [`dashboard.js`](https://github.com/romadlon-m/babelens/blob/main/dashboard.js) (Dashboard analytics), [`supabase/functions/submit-label/index.ts`](https://github.com/romadlon-m/babelens/blob/main/supabase/functions/submit-label/index.ts) (Label submission)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["News discovery"]
  node_search["News search<br/>[news-search.js]"]
  node_articles["News articles<br/>[news.html]"]
  node_onboarding["Interactive onboarding<br/>[onboarding-tour.js]"]
end

subgraph group_analysis["Economic analysis"]
  node_dashboard["Dashboard analytics<br/>[dashboard.js]"]
end

subgraph group_labeling["Labeling workflow"]
  node_labeler["Labeling pages<br/>[labeling-common.js]"]
  node_screener["Screener parser"]
  node_lapus["Lapus parser<br/>[labeling-lapus.js]"]
  node_pengeluaran["Pengeluaran parser"]
  node_submit["Label submission<br/>[index.ts]"]
end

subgraph group_administration["Administration"]
  node_review["Label review<br/>[admin-review.js]"]
  node_mlmonitor["ML shadow monitor"]
  node_users["User administration<br/>[admin-users.js]"]
  node_adminfn["Admin user function<br/>[index.ts]"]
  node_deletefn["Unregistered-user cleanup<br/>[index.ts]"]
end

subgraph group_platform["Identity and backend"]
  node_account["Sign-in and profile<br/>[auth.js]"]
  node_supabase[("Supabase services")]
end

node_visitor(("Platform user"))

node_visitor -->|"searches"| node_search
node_search -->|"shows results"| node_articles
node_search -.->|"queries articles"| node_supabase
node_visitor -.->|"explores summaries"| node_dashboard
node_dashboard -.->|"loads summaries"| node_supabase
node_visitor -->|"signs in"| node_account
node_account -->|"authenticates and logs"| node_supabase
node_visitor -.->|"labels articles"| node_labeler
node_labeler -->|"uses parser"| node_screener
node_labeler -->|"uses parser"| node_lapus
node_labeler -->|"uses parser"| node_pengeluaran
node_labeler -->|"claims and fetches prompts"| node_supabase
node_labeler -.->|"submits labels"| node_submit
node_submit -->|"writes labels"| node_supabase
node_visitor -.->|"reviews labels"| node_review
node_review -->|"loads and updates review"| node_supabase
node_visitor -.->|"monitors predictions"| node_mlmonitor
node_mlmonitor -->|"loads prediction queue"| node_supabase
node_visitor -.->|"manages users"| node_users
node_users -.->|"calls admin function"| node_adminfn
node_adminfn -->|"manages accounts"| node_supabase
node_deletefn -->|"checks and deletes user"| node_supabase
node_visitor -.->|"takes guided tour"| node_onboarding

click node_search "https://github.com/romadlon-m/babelens/blob/main/news-search.js"
click node_articles "https://github.com/romadlon-m/babelens/blob/main/news.html"
click node_dashboard "https://github.com/romadlon-m/babelens/blob/main/dashboard.js"
click node_account "https://github.com/romadlon-m/babelens/blob/main/auth.js"
click node_labeler "https://github.com/romadlon-m/babelens/blob/main/labeling-common.js"
click node_screener "https://github.com/romadlon-m/babelens/blob/main/labeling-screener.js"
click node_lapus "https://github.com/romadlon-m/babelens/blob/main/labeling-lapus.js"
click node_pengeluaran "https://github.com/romadlon-m/babelens/blob/main/labeling-pengeluaran.js"
click node_submit "https://github.com/romadlon-m/babelens/blob/main/supabase/functions/submit-label/index.ts"
click node_review "https://github.com/romadlon-m/babelens/blob/main/admin-review.js"
click node_mlmonitor "https://github.com/romadlon-m/babelens/blob/main/admin-ml-monitor.js"
click node_users "https://github.com/romadlon-m/babelens/blob/main/admin-users.js"
click node_adminfn "https://github.com/romadlon-m/babelens/blob/main/supabase/functions/admin-users/index.ts"
click node_deletefn "https://github.com/romadlon-m/babelens/blob/main/supabase/functions/delete-unregistered-user/index.ts"
click node_onboarding "https://github.com/romadlon-m/babelens/blob/main/onboarding-tour.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_search,node_articles,node_onboarding,node_visitor toneBlue
class node_dashboard toneAmber
class node_labeler,node_screener,node_lapus,node_pengeluaran,node_submit toneMint
class node_review,node_mlmonitor,node_users,node_adminfn,node_deletefn toneRose
class node_account,node_supabase toneIndigo
```

## Components

### News discovery

- [News search](https://github.com/romadlon-m/babelens/blob/main/news-search.js): `news-search.js`
- [News articles](https://github.com/romadlon-m/babelens/blob/main/news.html): `news.html`
- [Interactive onboarding](https://github.com/romadlon-m/babelens/blob/main/onboarding-tour.js): `onboarding-tour.js`

### Economic analysis

- [Dashboard analytics](https://github.com/romadlon-m/babelens/blob/main/dashboard.js): `dashboard.js`

### Labeling workflow

- [Labeling pages](https://github.com/romadlon-m/babelens/blob/main/labeling-common.js): `labeling-common.js`
- [Screener parser](https://github.com/romadlon-m/babelens/blob/main/labeling-screener.js): `labeling-screener.js`
- [Lapus parser](https://github.com/romadlon-m/babelens/blob/main/labeling-lapus.js): `labeling-lapus.js`
- [Pengeluaran parser](https://github.com/romadlon-m/babelens/blob/main/labeling-pengeluaran.js): `labeling-pengeluaran.js`
- [Label submission](https://github.com/romadlon-m/babelens/blob/main/supabase/functions/submit-label/index.ts): `supabase/functions/submit-label/index.ts`

### Administration

- [Label review](https://github.com/romadlon-m/babelens/blob/main/admin-review.js): `admin-review.js`
- [ML shadow monitor](https://github.com/romadlon-m/babelens/blob/main/admin-ml-monitor.js): `admin-ml-monitor.js`
- [User administration](https://github.com/romadlon-m/babelens/blob/main/admin-users.js): `admin-users.js`
- [Admin user function](https://github.com/romadlon-m/babelens/blob/main/supabase/functions/admin-users/index.ts): `supabase/functions/admin-users/index.ts`
- [Unregistered-user cleanup](https://github.com/romadlon-m/babelens/blob/main/supabase/functions/delete-unregistered-user/index.ts): `supabase/functions/delete-unregistered-user/index.ts`

### Identity and backend

- [Sign-in and profile](https://github.com/romadlon-m/babelens/blob/main/auth.js): `auth.js`
- **Supabase services**

### Other components

- **Platform user**

## Connections

- Platform user → News search: searches (evidence: `README.md`)
- News search → News articles: shows results (evidence: `README.md`)
- News search → Supabase services: queries articles
- Platform user → Dashboard analytics: explores summaries
- Dashboard analytics → Supabase services: loads summaries
- Platform user → Sign-in and profile: signs in (evidence: `auth.js`)
- Sign-in and profile → Supabase services: authenticates and logs (evidence: `auth.js`)
- Platform user → Labeling pages: labels articles
- Labeling pages → Screener parser: uses parser (evidence: `labeling-common.js`)
- Labeling pages → Lapus parser: uses parser (evidence: `labeling-common.js`)
- Labeling pages → Pengeluaran parser: uses parser (evidence: `labeling-common.js`)
- Labeling pages → Supabase services: claims and fetches prompts (evidence: `labeling-common.js`)
- Labeling pages → Label submission: submits labels
- Label submission → Supabase services: writes labels (evidence: `supabase/functions/submit-label/index.ts`)
- Platform user → Label review: reviews labels
- Label review → Supabase services: loads and updates review (evidence: `admin-review.js`)
- Platform user → ML shadow monitor: monitors predictions
- ML shadow monitor → Supabase services: loads prediction queue (evidence: `admin-ml-monitor.js`)
- Platform user → User administration: manages users
- User administration → Admin user function: calls admin function
- Admin user function → Supabase services: manages accounts (evidence: `supabase/functions/admin-users/index.ts`)
- Unregistered-user cleanup → Supabase services: checks and deletes user (evidence: `supabase/functions/delete-unregistered-user/index.ts`)
- Platform user → Interactive onboarding: takes guided tour
