How ardkyer/seoul-startup-planner works
Purpose and Runtime
Seoul Startup Navigator is a client-side React application for exploring Seoul commercial-area indicators and startup-support policies. It boots from src/index.js, composes the experience in src/App.js, and serves static assets/data from public/, notably public/updated_commercial_areas.json. The documented deployment target is Vercel.
Application Composition
src/App.js is the top-level orchestration boundary: it presents the introductory experience, main map, and chatbot. src/components/Intro/IntroSequence.js gates or enhances initial entry, while src/components/Map/Map.js and src/components/Chat/ChatWindow.js provide the two substantive user workflows.
Commercial-Area Data Pipeline
Map data is loaded and normalized through src/data/api/dataFetcher.js and src/data/api/dataProcessor.js, with map-oriented state encapsulated by src/hooks/useMapData.js. The primary source is the bundled commercial-area dataset at public/updated_commercial_areas.json; development/debug GeoJSON alternatives exist under src/data/geojson/. This creates a browser-side boundary between raw public-data-derived records and display-ready geographic features/metrics.
Map Visualization System
src/components/Map/Map.js hosts Mapbox GL and user interaction with Seoul’s map. Map defaults, token-related settings, view configuration, and metric definitions are centralized in src/data/constants/mapSettings.js. Specialized layer modules render distinct geometries and visual encodings:
• district/administrative context: src/components/Map/layers/DistrictLayer.js
• commercial-area fills: src/components/Map/layers/FillLayer.js
• density/intensity rendering: src/components/Map/layers/HeatmapLayer.js
The user selects among population, sales, rent, and closure-rate perspectives; selection drives the active metric and corresponding Mapbox layer styling/popup content.
Filtering and Derived Metrics
src/hooks/useDataFilters.js owns filtering behavior over map data, separating user-selected constraints from fetching and rendering. Shared metric calculations and presentation formatting reside in src/utils/calculators.js and src/utils/formatters.js. This is the main transformation boundary for converting raw area attributes into comparable values, labels, and visual weights.
Policy Advisor / Chat Flow
The chatbot UI is split into launch control, conversation window, and message rendering at src/components/Chat/ChatButton.js, src/components/Chat/ChatWindow.js, and src/components/Chat/ChatMessage.js. src/components/Chat/ChatService.js is the external-service boundary for policy-oriented responses. Curated startup-policy context is bundled in src/data/constants/startupPolicies.json; OpenAI GPT-3.5 is the documented optional LLM provider, configured through REACT_APP_OPENAI_API_KEY. Since this is a React client app, that integration places API-key handling and model calls at the browser boundary unless deployment adds a proxy not represented in this tree.
External Dependencies and Infrastructure
The material runtime is Node.js 18+ for build/development and React 19 in the browser. Map rendering depends on Mapbox GL and REACT_APP_MAPBOX_ACCESS_TOKEN. Axios is the documented HTTP client. Data originates from Seoul public-data sources and Korean real-estate statistics but is consumed here primarily as prepared static JSON. updateClosureRateData.js is a root-level data-maintenance script for updating closure-rate content outside the interactive runtime.
Main entry points: Map.js Interactive map · App.js App orchestration · ChatWindow.js Chat window · useDataFilters.js Data filters
Components 22
React client
Browser application runtime.
- Application entry
src/index.js - App orchestration · Composes intro, map, and chat.
src/App.js - Intro sequence
src/components/Intro/IntroSequence.js
Commercial data pipeline
Static records become map-ready metrics.
- Commercial-area dataset · Prepared public-data-derived area records.
public/updated_commercial_areas.json - Data fetcher
src/data/api/dataFetcher.js - Data processor · Produces display-ready geographic records and metrics.
src/data/api/dataProcessor.js - Map data state
src/hooks/useMapData.js - Data filters · Applies user-selected constraints to map data.
src/hooks/useDataFilters.js - Metric calculations
src/utils/calculators.js - Metric formatting
src/utils/formatters.js
Map visualization
Mapbox-based geographic views.
- Map settings · Map defaults, metric definitions, and Mapbox settings.
src/data/constants/mapSettings.js - Interactive map · Handles map interaction and selected metric view.
src/components/Map/Map.js - District context
src/components/Map/layers/DistrictLayer.js - Commercial-area fills
src/components/Map/layers/FillLayer.js - Density heatmap
src/components/Map/layers/HeatmapLayer.js
Policy advisor
Policy-focused chat workflow.
- Chat window
src/components/Chat/ChatWindow.js - Chat launcher
src/components/Chat/ChatButton.js - Message renderer
src/components/Chat/ChatMessage.js - Policy chat service · Calls the optional OpenAI GPT-3.5 provider from the browser.
src/components/Chat/ChatService.js - Startup policy context
src/data/constants/startupPolicies.json
Other components
- OpenAI GPT-3.5 · Configured with REACT_APP_OPENAI_API_KEY.
- Closure-rate updater · Updates closure-rate content outside the interactive runtime.
updateClosureRateData.js
Connections 21
- Application entry → App orchestration: boots
- App orchestration → Intro sequence: presents
- App orchestration → Interactive map: hosts
- App orchestration → Chat window: hosts
- Commercial-area dataset → Data fetcher: loads
- Data fetcher → Data processor: raw records
- Data processor → Map data state: normalized features
- Map data state → Data filters: map data
- Metric calculations → Data filters: derived metrics
- Metric formatting → Interactive map: labels and popups
- Data filters → Interactive map: filtered features
- Map settings → Interactive map: view and metric config
- Interactive map → District context: renders
- Interactive map → Commercial-area fills: renders
- Interactive map → Density heatmap: renders
- Chat launcher → Chat window: opens
- Chat window → Message renderer: renders
- Chat window → Policy chat service: sends prompts
- Startup policy context → Policy chat service: policy context
- Policy chat service → OpenAI GPT-3.5: optional model call
- Closure-rate updater → Commercial-area dataset: updates closure-rate data