Skip to content

A modern, responsive weather application built with React, TypeScript, and Tailwind CSS. Get real-time weather information for any location worldwide with an intuitive and beautiful interface.

Notifications You must be signed in to change notification settings

Yukikaze-coder/Weather

Repository files navigation

🌀️ Global Weather App

A modern, responsive weather application built with React, TypeScript, and Tailwind CSS. Get real-time weather information for any location worldwide with an intuitive and beautiful interface.

Weather App Preview

✨ Features

🏠 Dashboard

  • Current Location Weather: Automatic geolocation-based weather display
  • Detailed Weather Information: Temperature, humidity, wind speed, pressure, and more
  • Hourly Temperature Chart: Interactive temperature trends for the next 24 hours
  • 5-Day Forecast: Extended weather outlook with daily highs/lows

πŸ” Smart City Search

  • Real-time Search: Search for cities worldwide with auto-suggestions
  • Search History: Keep track of recently searched locations
  • Favorites System: Save and quickly access your favorite cities
  • Advanced Command Dialog: Intuitive search interface with keyboard navigation

πŸŒ™ User Experience

  • Dark/Light Theme: Seamless theme switching with system preference detection
  • Responsive Design: Optimized for desktop, tablet, and mobile devices
  • Loading States: Smooth loading animations and skeleton screens
  • Error Handling: Graceful error handling with user-friendly messages

πŸ“Š Data Visualization

  • Interactive Charts: Temperature trends using Recharts
  • Weather Icons: Dynamic weather condition icons from OpenWeatherMap
  • Gradient Backgrounds: Beautiful weather-themed gradients

πŸ› οΈ Tech Stack

Frontend

  • React 19 - Modern React with latest features
  • TypeScript - Type-safe development
  • Vite - Lightning-fast build tool
  • React Router - Client-side routing

Styling & UI

  • Tailwind CSS 4 - Utility-first CSS framework
  • Radix UI - Headless UI components
  • Lucide React - Beautiful SVG icons
  • shadcn/ui - Component library built on Radix UI

State Management & Data Fetching

  • TanStack Query (React Query) - Powerful data synchronization
  • Local Storage - Persistent favorites and search history

Charts & Visualization

  • Recharts - Composable charting library
  • date-fns - Date utility library

Developer Experience

  • ESLint - Code linting
  • TypeScript - Static type checking
  • Prettier - Code formatting

πŸš€ Getting Started

Installation

  1. Clone the repository

    git clone https://github.com/Yukikaze-coder/Global-Weather.git
    cd Global-Weather
  2. Install dependencies

    npm install
  3. Set up environment variables

    cp .env.example .env

    Add your OpenWeatherMap API key to .env:

    VITE_OPENWEATHER_API_KEY=your_api_key_here
  4. Start the development server

    npm run dev
  5. Open your browser Navigate to http://localhost:5173

Get Your API Key

  1. Visit OpenWeatherMap
  2. Sign up for a free account
  3. Navigate to API keys section
  4. Copy your API key to the .env file

πŸ“ Available Scripts

# Development
npm run dev          # Start development server

# Production
npm run build        # Build for production
npm run preview      # Preview production build

# Code Quality
npm run lint         # Run ESLint

πŸ—οΈ Project Structure

src/
β”œβ”€β”€ api/              # API configuration and services
β”‚   β”œβ”€β”€ config.ts     # API endpoints and configuration
β”‚   β”œβ”€β”€ types.ts      # TypeScript type definitions
β”‚   └── weather.ts    # Weather API service
β”œβ”€β”€ components/       # Reusable UI components
β”‚   └── ui/           # UI component library
β”œβ”€β”€ context/          # React context providers
β”œβ”€β”€ hooks/            # Custom React hooks
β”œβ”€β”€ lib/              # Utility functions
└── pages/            # Page components

🎯 Key Features Explained

Geolocation Integration

  • Automatic location detection using browser's geolocation API
  • Fallback options for users who deny location access
  • Reverse geocoding to display location names

Favorites System

  • Add/remove cities to favorites
  • Persistent storage using localStorage
  • Quick access from search dialog
  • Real-time weather data for favorite cities

Search History

  • Tracks recently searched locations
  • Persistent across browser sessions
  • Easy clearing of search history
  • Timestamps for search entries

Weather Data

  • Current weather conditions
  • 5-day forecast
  • Hourly temperature trends
  • Detailed metrics (humidity, pressure, wind, etc.)
  • Sunrise/sunset times

🎨 Design System

Colors

  • Support for light and dark themes
  • Consistent color palette
  • Weather condition-specific colors

Typography

  • Clean, readable fonts
  • Consistent sizing scale
  • Proper contrast ratios

Components

  • Modular, reusable components
  • Consistent styling with Tailwind CSS
  • Responsive design patterns

🌐 API Integration

OpenWeatherMap API

  • Current weather data
  • 5-day weather forecast
  • Geocoding for city search
  • Reverse geocoding for coordinates

Endpoints Used

  • /weather - Current weather
  • /forecast - 5-day forecast
  • /geo/direct - Forward geocoding
  • /geo/reverse - Reverse geocoding

πŸ“± Responsive Design

  • Mobile First: Optimized for mobile devices
  • Tablet Support: Adapted layouts for tablets
  • Desktop: Full-featured desktop experience
  • Touch Friendly: Large touch targets for mobile

πŸ”§ Configuration

Environment Variables

VITE_OPENWEATHER_API_KEY=your_api_key_here

Tailwind CSS

Custom configuration for:

  • Color scheme
  • Spacing system
  • Component variants
  • Dark mode support

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘¨β€πŸ’» Author

Morandini Luigi

πŸ™ Acknowledgments


Made with ❀️ by Morandini Luigi © 2025

About

A modern, responsive weather application built with React, TypeScript, and Tailwind CSS. Get real-time weather information for any location worldwide with an intuitive and beautiful interface.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published