Skip to content

Implement dashboard with weather and financial widgets#310

Open
louiskyx213 wants to merge 1 commit into
Zeff01:mainfrom
louiskyx213:danlouie-villanueva/5-years-plus
Open

Implement dashboard with weather and financial widgets#310
louiskyx213 wants to merge 1 commit into
Zeff01:mainfrom
louiskyx213:danlouie-villanueva/5-years-plus

Conversation

@louiskyx213

Copy link
Copy Markdown

Architecture Overview

Component Structure

  • hooks/useWeather.ts — handles geocoding + weather fetch, abort controller, and 5-min client-side cache
  • hooks/useFinance.ts — handles market data fetching with same caching pattern
  • components/WeatherWidget.tsx — search input, loading/error/success states
  • components/FinanceWidget.tsx — stock/crypto list with change indicators

Key Decisions

  • Custom cache layer using a Map with TTL to avoid redundant API calls
  • AbortController in useWeather to cancel in-flight requests on new searches
  • Separation of concerns — hooks own data logic, components own rendering only
  • Open-Meteo for weather (free, no API key, no CORS issues)
  • Simulated market data on the client — in production, Finnhub would be called via a Next.js API route to keep the API key server-side and avoid CORS
  • Loading skeletons and per-widget error states for a polished UX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants