How sarahd-wu/bali-arcade-app works
BALI - ARCADE is an interactive indoor mall map backed by PostgreSQL/PostGIS. A visitor uses the React interface to view and filter mapped features, search and select stores, inspect nearby features, and edit store details; the map hook loads floor data through the map API and Leaflet renders it. Separate API routes expose store, floor, category, search, statistics, and health capabilities. The README documents these endpoints; some route implementations and UI components were not excerpted, so their internal interactions are not inferred here.
Main entry points: db.js Database pool · MapExperience.jsx Map experience · useMallMap.js Map state hook · leaflet-map.js Leaflet rendering
Components 21
Map interface
- App page
app/page.jsx - Map experience
app/components/MapExperience.jsx - Map header
app/components/MapHeader.jsx - Category sidebar
app/components/Sidebar.jsx - Map workspace
app/components/Workspace.jsx - Details panel
app/components/DetailsPanel.jsx - Store editor
app/components/StoreEditor.jsx
Map runtime
- Map state hook
app/components/useMallMap.js - Leaflet rendering
app/components/leaflet-map.js - Feature helpers
app/components/map-data.js
PostgreSQL API
- Floor map API
app/api/map/[floor]/route.js - Store API
app/api/stores/[id]/route.js - Floor stores API
app/api/stores/route.js - Search API
app/api/search/route.js - Floors API
app/api/floors/route.js - Categories API
app/api/categories/route.js - Statistics API
app/api/stats/route.js - Health API
app/api/health/route.js
Persistence
- Database pool
lib/db.js - PostgreSQL / PostGIS
Other components
- Map visitor
Connections 23
- Map visitor → App page: opens map
README.md - App page → Map experience: renders
app/page.jsx - Map experience → Map header: renders
app/components/MapExperience.jsx - Map experience → Category sidebar: renders
app/components/MapExperience.jsx - Map experience → Map workspace: renders
app/components/MapExperience.jsx - Map experience → Store editor: renders
app/components/MapExperience.jsx - Map workspace → Details panel: renders
app/components/Workspace.jsx - Map experience → Map state hook: uses state
app/components/MapExperience.jsx - Map state hook → Leaflet rendering: creates map
app/components/useMallMap.js - Leaflet rendering → Floor map API: fetches features
app/components/leaflet-map.js - Map state hook → Store API: saves edits
app/components/useMallMap.js - Map state hook → Feature helpers: uses helpers
app/components/useMallMap.js - Leaflet rendering → Feature helpers: uses helpers
app/components/leaflet-map.js - Map experience → Feature helpers: uses helpers
app/components/MapExperience.jsx - Floor map API → Database pool: queries
app/api/map/[floor]/route.js - Store API → Database pool: queries
app/api/stores/[id]/route.js - Floor stores API → Database pool: queries
app/api/stores/route.js - Search API → Database pool: queries
app/api/search/route.js - Floors API → Database pool: queries
app/api/floors/route.js - Categories API → Database pool: queries
app/api/categories/route.js - Statistics API → Database pool: queries
app/api/stats/route.js - Health API → Database pool: uses pool
app/api/health/route.js - Database pool → PostgreSQL / PostGIS: queries