Architecture
For detailed data specifications and loading implementation, see DATAS.md in the root directory.
Overview
dure.one uses a progressive loading architecture with postcode-based organization for efficient data delivery.
Data Pipeline
3-Stage Generation
Stage 1: Static Classifications (Build Time)
- Business categories: KSIC, Hometax, Sanjae, Goyong (6 systems)
- Product categories: Google taxonomy
- Postcode data: UTM-K coordinates for 34,363 postcodes
Stage 2: Business Data Processing
- Google Sheets → Rust validation → JSONL output
- Organized by postcode and category
- Shard metadata embedded in records
Stage 3: Aggregation
- Copy all outputs to
public/data/ - Ready for static deployment
Frontend Architecture
Progressive Loading
Design Principles:
- Postcode-centric: Organize by 5-digit Korean postcodes
- Distance-based: Load nearest postcodes first
- On-demand: Fetch JSONL only when needed
- Cached: Keep loaded data in memory
Key Components
dataLoader.js - Main orchestration
- Loads indices at startup
- Coordinates progressive loading
postcodeLoader.js - Postcode-based loading
- Fetches
/data/postcodes/{postcode}.jsonl - Caches loaded postcodes
- Deduplicates by bizno
categoryLoader.js - Category filtering
- Uses category_index for relevance
- Delegates to postcodeLoader
postcodeDistance.js - Distance calculations
- Haversine distance between postcodes
- Cached distance matrix
Embedded Shard Optimization
Each business record includes _shard metadata for direct detail view loading:
json
{
"bizno": "1234567890",
"name": "Example Business",
"_shard": {
"category": "HT11000",
"shard_id": 18
}
}Benefits:
- Eliminated 2.9MB search_index.json
- Eliminated 859KB coordinate_index.json
- O(1) shard lookup from record
- Faster detail view rendering
Data Flow
User selects postcode
↓
postcodeLoader fetches /data/postcodes/{postcode}.jsonl
↓
Business list rendered with _shard metadata
↓
User clicks business
↓
Direct shard fetch: /data/shards/biz/{category}/shard_{id}.jsonl
↓
Detail view renderedFile Organization
public/data/
├── KR_KSIC11TH.json # Classification metadata
├── KR_HTCODE26.json
├── KR_SJCODE.json
├── KR_GYCODE.json
├── KR_prdcat.json
├── postcode_index.json # Dropdown data
├── index/
│ ├── postcode_index.json # Postcode metadata
│ └── category_index.json # Category distribution
├── postcodes/
│ └── {postcode}.jsonl # Business records by postcode
└── shards/
├── biz/{category}/shard_*.jsonl
└── prd/{category}/shard_*.jsonlPerformance
Bundle Size:
- JS: ~8KB (~3.4KB gzipped)
- CSS: ~10KB (~2.7KB gzipped)
- Total: ~6KB gzipped
Loading Strategy:
- Indices: ~8MB loaded at startup
- Business data: Loaded on-demand per postcode
- Detail data: Loaded on-click per business
Caching:
- Postcode data cached in memory
- Distance calculations cached
- No duplicate fetches