
Real-time Weather Forecast Web App
Overview
WeatherCast is a sleek and responsive web app that provides real-time weather updates for any city worldwide. Built using modern JavaScript and APIs, it features dynamic icons, temperature readings, and a clean user interface.
Tech Stack
Next.js 14React.js.TypeScriptReact Query.Tailwind CSSAxiosDate-fns
Key Highlights
- ✦Global Weather Search: Users can instantly find weather updates for any city around the world.
- ✦Real-time Data Fetching: Optimized API calls using React Query for seamless data synchronization.
- ✦Dynamic UI Components: Features a clean interface with dynamic icons and responsive layouts that adjust to current weather conditions.
- ✦Efficient State Management: Integrated Jotai for lightweight and scalable global state management across the application.
- ✦Date & Time Formatting: Professional-grade date and time display utilizing the date-fns library.
The Challenge
- —Managing Asynchronous API States: Handling loading, error, and success states for external weather API calls.
- —Global State Efficiency: Moving away from heavy state management tools to find a balance between performance and simplicity.
- —Responsive Styling: Ensuring the weather dashboard remains readable and visually appealing on all screen sizes.
Solution & Impact
- ✓React Query Integration: Simplified the data fetching logic and implemented automatic caching to reduce unnecessary API requests.
- ✓Atomic State with Jotai: Used Jotai to manage user preferences and city selections, ensuring minimal re-renders.
- ✓Tailwind CSS & clsx: Utilized Tailwind CSS combined with clsx and tailwind-merge to create a highly flexible and efficient styling system.