How isaismail322/global_data_dashboard works
This is a Next.js global market dashboard. The home-page server workflow fetches latest market data, news, and events from Supabase, then provides them to the interactive dashboard. The dashboard combines a symbol watchlist and historical/live chart with a news feed and event list/map; client components also subscribe to realtime database changes. The excerpts establish these main calls and data paths; details of some read-but-unsampled views are limited to the source index.
Main entry points: supabase.ts Supabase client · page.tsx Home page · Dashboard.tsx Dashboard layout · MarketChart.tsx Market chart
Components 16
Page and dashboard
- Home page
app/page.tsx - Dashboard layout
components/dashboard/Dashboard.tsx
Market intelligence
- Symbol watchlist
components/dashboard/SymbolSidebar.tsx - Market chart
components/dashboard/MarketChart.tsx - Market queries
lib/market.ts
Global events
- Events list
components/dashboard/EventsList.tsx - Events map
components/dashboard/EventsMap.tsx - Country centroids
components/dashboard/countryCentroids.ts - Events query
lib/events.ts
News feed
- News list
components/dashboard/NewsList.tsx - News query
lib/news.ts
Data access and contracts
- Supabase client
lib/supabase.ts - Domain data types
types
Other components
- Dashboard visitor
- Supabase backend
- OpenStreetMap tiles
Connections 21
- Dashboard visitor → Home page: opens
- Home page → Market queries: fetches latest
app/page.tsx - Home page → News query: fetches latest
app/page.tsx - Home page → Events query: fetches latest
app/page.tsx - Home page → Dashboard layout: renders with data
app/page.tsx - Dashboard layout → Symbol watchlist: renders
components/dashboard/Dashboard.tsx - Dashboard layout → Market chart: renders
components/dashboard/Dashboard.tsx - Dashboard layout → News list: renders
components/dashboard/Dashboard.tsx - Dashboard layout → Events list: renders
components/dashboard/Dashboard.tsx - Market chart → Market queries: loads history
components/dashboard/MarketChart.tsx - Market chart → Supabase client: subscribes realtime
components/dashboard/MarketChart.tsx - Symbol watchlist → Supabase client: reads realtime
components/dashboard/SymbolSidebar.tsx - News list → Supabase client: reads realtime
components/dashboard/NewsList.tsx - Events list → Supabase client: subscribes and polls
components/dashboard/EventsList.tsx - Events list → Events map: renders locations
components/dashboard/EventsList.tsx - Events map → Country centroids: looks up coordinates
components/dashboard/EventsMap.tsx - Market queries → Supabase client: queries market data
lib/market.ts - News query → Supabase client: queries news
lib/news.ts - Events query → Supabase client: queries events
lib/events.ts - Events map → OpenStreetMap tiles: loads map tiles
components/dashboard/EventsMap.tsx - Supabase client → Supabase backend: connects to