# joshualikaist/babdoduk architecture

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

- Interactive diagram: https://gitdiagram.com/joshualikaist/babdoduk
- Repository: https://github.com/joshualikaist/babdoduk

## Overview

Babdoduk is a KAIST-focused food platform: visitors check free-food opportunities and cafeteria menus, choose a meal, and explore its magazine, activities, food log, and history. Its main data workflow gathers notices and mail, sanitizes and parses candidates, validates and deduplicates events, stores them, then exports a static feed for the site. The README documents additional public features whose page implementations are not present in the supplied tree; those branches are represented without guessed source paths. Edges reflect documented flow and sampled calls.

Main entry points: [`scripts/ggongbab/pipeline.py`](https://github.com/joshualikaist/babdoduk/blob/main/scripts/ggongbab/pipeline.py) (Event processing), [`js/home.js`](https://github.com/joshualikaist/babdoduk/blob/main/js/home.js) (Home summaries), [`js/food-picker.js`](https://github.com/joshualikaist/babdoduk/blob/main/js/food-picker.js) (Menu picker UI), [`scripts/ggongbab/exporter.py`](https://github.com/joshualikaist/babdoduk/blob/main/scripts/ggongbab/exporter.py) (Public feed export)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Public site"]
  node_home["Home summaries<br/>[home.js]"]
  node_freefood_ui["Free-food feed<br/>[ggongbab.js]"]
  node_menu_ui["Cafeteria menu<br/>[kaist-menu.js]"]
  node_menu_data["Cafeteria snapshot"]
end

subgraph group_food["Food discovery"]
  node_food_picker["Menu picker UI<br/>[food-picker.js]"]
  node_food_engine["Recommendation engine<br/>[food-engine.js]"]
  node_slot["Slot animation<br/>[eat-slot.js]"]
  node_food_catalog["Food catalog"]
end

subgraph group_events["Free food pipeline"]
  node_gg_refresh["Free-food refresh"]
  node_collectors["Notice collectors"]
  node_source_services(("Notice sources"))
  node_pipeline["Event processing<br/>[pipeline.py]"]
  node_prefilter["Rule prefilter<br/>[prefilter.py]"]
  node_parser["AI extraction<br/>[ai_parser.py]"]
  node_validator["Event validation<br/>[validator.py]"]
  node_dedup["Event deduplication<br/>[dedup.py]"]
  node_repository["Event repository<br/>[repository.py]"]
  node_supabase[("Supabase store<br/>[supabase_client.py]")]
  node_exporter["Public feed export<br/>[exporter.py]"]
  node_freefood_data["Free-food snapshots"]
end

subgraph group_content["Community content"]
  node_magazine["Magazine"]
  node_community["Events and history"]
  node_food_log["Food spending log"]
  node_map(("Restaurant map"))
end

node_visitor(("Site visitor"))

node_visitor -->|"opens"| node_home
node_visitor -->|"views"| node_freefood_ui
node_visitor -->|"views"| node_menu_ui
node_visitor -->|"chooses with"| node_food_picker
node_visitor -->|"reads"| node_magazine
node_visitor -->|"reads"| node_community
node_visitor -->|"records spending"| node_food_log
node_visitor -.->|"opens link"| node_map
node_home -->|"fetches"| node_menu_data
node_home -->|"summarizes"| node_freefood_data
node_home -->|"summarizes"| node_magazine
node_freefood_ui -->|"fetches"| node_freefood_data
node_menu_ui -->|"fetches"| node_menu_data
node_food_picker -->|"requests picks"| node_food_engine
node_food_engine -->|"loads catalog"| node_food_catalog
node_food_picker -->|"mounts animation"| node_slot
node_gg_refresh -->|"runs"| node_pipeline
node_source_services -->|"provides notices"| node_collectors
node_pipeline -->|"collects from"| node_collectors
node_pipeline -->|"screens items"| node_prefilter
node_pipeline -->|"extracts events"| node_parser
node_pipeline -->|"validates candidates"| node_validator
node_pipeline -->|"deduplicates events"| node_dedup
node_pipeline -->|"reads and writes"| node_repository
node_repository -->|"persists records"| node_supabase
node_gg_refresh -->|"exports feed"| node_exporter
node_exporter -->|"reads publishable events"| node_repository
node_exporter -->|"writes snapshots"| node_freefood_data
node_food_picker -->|"records locally"| node_food_log

click node_home "https://github.com/joshualikaist/babdoduk/blob/main/js/home.js"
click node_freefood_ui "https://github.com/joshualikaist/babdoduk/blob/main/js/ggongbab.js"
click node_menu_ui "https://github.com/joshualikaist/babdoduk/blob/main/js/kaist-menu.js"
click node_food_picker "https://github.com/joshualikaist/babdoduk/blob/main/js/food-picker.js"
click node_food_engine "https://github.com/joshualikaist/babdoduk/blob/main/js/food-engine.js"
click node_slot "https://github.com/joshualikaist/babdoduk/blob/main/js/eat-slot.js"
click node_gg_refresh "https://github.com/joshualikaist/babdoduk/blob/main/scripts/refresh_ggongbab.py"
click node_collectors "https://github.com/joshualikaist/babdoduk/tree/main/scripts/ggongbab/collectors"
click node_pipeline "https://github.com/joshualikaist/babdoduk/blob/main/scripts/ggongbab/pipeline.py"
click node_prefilter "https://github.com/joshualikaist/babdoduk/blob/main/scripts/ggongbab/prefilter.py"
click node_parser "https://github.com/joshualikaist/babdoduk/blob/main/scripts/ggongbab/parsers/ai_parser.py"
click node_validator "https://github.com/joshualikaist/babdoduk/blob/main/scripts/ggongbab/parsers/validator.py"
click node_dedup "https://github.com/joshualikaist/babdoduk/blob/main/scripts/ggongbab/dedup.py"
click node_repository "https://github.com/joshualikaist/babdoduk/blob/main/scripts/ggongbab/db/repository.py"
click node_supabase "https://github.com/joshualikaist/babdoduk/blob/main/scripts/ggongbab/db/supabase_client.py"
click node_exporter "https://github.com/joshualikaist/babdoduk/blob/main/scripts/ggongbab/exporter.py"

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_home,node_freefood_ui,node_menu_ui,node_menu_data toneBlue
class node_food_picker,node_food_engine,node_slot,node_food_catalog toneAmber
class node_gg_refresh,node_collectors,node_source_services,node_pipeline,node_prefilter,node_parser,node_validator,node_dedup,node_repository,node_supabase,node_exporter,node_freefood_data toneMint
class node_magazine,node_community,node_food_log,node_map toneRose
class node_visitor toneIndigo
```

## Components

### Public site

- [Home summaries](https://github.com/joshualikaist/babdoduk/blob/main/js/home.js): `js/home.js`
- [Free-food feed](https://github.com/joshualikaist/babdoduk/blob/main/js/ggongbab.js): `js/ggongbab.js`
- [Cafeteria menu](https://github.com/joshualikaist/babdoduk/blob/main/js/kaist-menu.js): `js/kaist-menu.js`
- **Cafeteria snapshot**

### Food discovery

- [Menu picker UI](https://github.com/joshualikaist/babdoduk/blob/main/js/food-picker.js): `js/food-picker.js`
- [Recommendation engine](https://github.com/joshualikaist/babdoduk/blob/main/js/food-engine.js): `js/food-engine.js`
- [Slot animation](https://github.com/joshualikaist/babdoduk/blob/main/js/eat-slot.js): `js/eat-slot.js`
- **Food catalog**

### Free food pipeline

- [Free-food refresh](https://github.com/joshualikaist/babdoduk/blob/main/scripts/refresh_ggongbab.py): `scripts/refresh_ggongbab.py`
- [Notice collectors](https://github.com/joshualikaist/babdoduk/tree/main/scripts/ggongbab/collectors): `scripts/ggongbab/collectors`
- **Notice sources**
- [Event processing](https://github.com/joshualikaist/babdoduk/blob/main/scripts/ggongbab/pipeline.py): `scripts/ggongbab/pipeline.py`
- [Rule prefilter](https://github.com/joshualikaist/babdoduk/blob/main/scripts/ggongbab/prefilter.py): `scripts/ggongbab/prefilter.py`
- [AI extraction](https://github.com/joshualikaist/babdoduk/blob/main/scripts/ggongbab/parsers/ai_parser.py): `scripts/ggongbab/parsers/ai_parser.py`
- [Event validation](https://github.com/joshualikaist/babdoduk/blob/main/scripts/ggongbab/parsers/validator.py): `scripts/ggongbab/parsers/validator.py`
- [Event deduplication](https://github.com/joshualikaist/babdoduk/blob/main/scripts/ggongbab/dedup.py): `scripts/ggongbab/dedup.py`
- [Event repository](https://github.com/joshualikaist/babdoduk/blob/main/scripts/ggongbab/db/repository.py): `scripts/ggongbab/db/repository.py`
- [Supabase store](https://github.com/joshualikaist/babdoduk/blob/main/scripts/ggongbab/db/supabase_client.py): `scripts/ggongbab/db/supabase_client.py`
- [Public feed export](https://github.com/joshualikaist/babdoduk/blob/main/scripts/ggongbab/exporter.py): `scripts/ggongbab/exporter.py`
- **Free-food snapshots**

### Community content

- **Magazine**
- **Events and history**
- **Food spending log**
- **Restaurant map**

### Other components

- **Site visitor**

## Connections

- Site visitor → Home summaries: opens
- Site visitor → Free-food feed: views
- Site visitor → Cafeteria menu: views
- Site visitor → Menu picker UI: chooses with
- Site visitor → Magazine: reads
- Site visitor → Events and history: reads
- Site visitor → Food spending log: records spending
- Site visitor → Restaurant map: opens link
- Home summaries → Cafeteria snapshot: fetches
- Home summaries → Free-food snapshots: summarizes
- Home summaries → Magazine: summarizes
- Free-food feed → Free-food snapshots: fetches
- Cafeteria menu → Cafeteria snapshot: fetches
- Menu picker UI → Recommendation engine: requests picks
- Recommendation engine → Food catalog: loads catalog
- Menu picker UI → Slot animation: mounts animation
- Free-food refresh → Event processing: runs
- Notice sources → Notice collectors: provides notices
- Event processing → Notice collectors: collects from
- Event processing → Rule prefilter: screens items
- Event processing → AI extraction: extracts events
- Event processing → Event validation: validates candidates
- Event processing → Event deduplication: deduplicates events
- Event processing → Event repository: reads and writes
- Event repository → Supabase store: persists records
- Free-food refresh → Public feed export: exports feed
- Public feed export → Event repository: reads publishable events
- Public feed export → Free-food snapshots: writes snapshots
- Menu picker UI → Food spending log: records locally
