Skip to content

MRaysa/WeatherSphere

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WeatherSphere Logo

🌀️ WeatherSphere

Advanced Real-Time Weather Intelligence Platform

Production License: MIT React Vite Mapbox

Live Demo β€’ Documentation β€’ Report Bug β€’ Request Feature


πŸ“‹ Table of Contents


🌍 About

WeatherSphere is a cutting-edge weather intelligence platform that delivers hyperlocal, real-time meteorological data with advanced visualization capabilities. Built with modern web technologies, it provides comprehensive atmospheric insights through interactive maps, detailed forecasts, and air quality monitoring.

🎯 Mission

To democratize access to professional-grade weather intelligence through an intuitive, fast, and reliable web application.

✨ Highlights

  • πŸš€ Lightning Fast: Built with Vite for optimal performance
  • πŸ—ΊοΈ Interactive Maps: Powered by Mapbox GL JS with multiple weather layers
  • πŸ“± Responsive Design: Seamless experience across all devices
  • πŸŒ“ Theme Support: Dark and light modes for comfortable viewing
  • πŸ” Type Safe: Structured with modern JavaScript patterns
  • β™Ώ Accessible: WCAG 2.1 AA compliant

🎯 Key Features

🌑️ Core Weather Features

  • βœ… Real-Time Weather Data - Current conditions updated every 15 minutes
  • βœ… 24-Hour Forecast - Hourly temperature and precipitation predictions
  • βœ… 7-Day Extended Forecast - Weekly weather planning at a glance
  • βœ… Location Search - Search any city worldwide with autocomplete
  • βœ… Geolocation Support - Automatic detection of user's location

πŸ—ΊοΈ Advanced Visualizations

  • βœ… Temperature Maps - Global heat maps with gradient visualization
  • βœ… Wind Patterns - Real-time wind speed and direction analysis
  • βœ… Air Quality Index (AQI) - Pollution levels with health recommendations
  • βœ… Cloud Coverage - Satellite-based cloud layer visualization
  • βœ… Interactive Radar - Zoom and pan across detailed weather layers

πŸ“Š Data Analytics

  • βœ… Historical Trends - Average temperature analysis over time
  • βœ… Weather Alerts - Severe weather notifications
  • βœ… UV Index - Sun exposure safety guidelines
  • βœ… Humidity & Pressure - Detailed atmospheric metrics

πŸ› οΈ Tech Stack

Frontend

Technology Purpose Version
React UI Framework 18.3.1
Vite Build Tool 6.3.5
React Router Routing 7.1.3
Framer Motion Animations 11.20.0
TailwindCSS Styling 3.4.17

Maps & Visualization

Technology Purpose
Mapbox GL JS Interactive mapping engine
D3.js Data visualization library
Chart.js Chart rendering
Leaflet Alternative mapping solution

APIs & Data

  • WeatherAPI.com - Primary weather data provider
  • OpenWeatherMap - Air quality and supplementary data
  • Mapbox - Geocoding and map tiles

Development Tools

  • ESLint - Code linting
  • Prettier - Code formatting
  • Git - Version control

πŸ“ Project Structure

WeatherSphere/
β”œβ”€β”€ πŸ“‚ public/                  # Static assets
β”‚   β”œβ”€β”€ logo.png
β”‚   └── favicon.ico
β”‚
β”œβ”€β”€ πŸ“‚ src/                     # Source code
β”‚   β”œβ”€β”€ πŸ“‚ assets/              # Images, fonts, icons
β”‚   β”‚   └── react.svg
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“‚ components/          # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ Footer/
β”‚   β”‚   β”‚   └── Footer.jsx
β”‚   β”‚   └── πŸ“‚ Navbar/
β”‚   β”‚       └── Navbar.jsx
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“‚ contexts/            # React Context providers
β”‚   β”‚   └── ThemeContext.jsx   # Dark/Light theme management
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“‚ pages/               # Route-based page components
β”‚   β”‚   β”œβ”€β”€ AqiMap.jsx          # Air Quality Index visualization
β”‚   β”‚   β”œβ”€β”€ AverageTemperature.jsx  # Historical temp analysis
β”‚   β”‚   β”œβ”€β”€ CloudMap.jsx        # Cloud coverage maps
β”‚   β”‚   β”œβ”€β”€ ErrorPage.jsx       # 404 error handling
β”‚   β”‚   β”œβ”€β”€ HomePage.jsx        # Landing page
β”‚   β”‚   β”œβ”€β”€ Root.jsx            # Main layout wrapper
β”‚   β”‚   β”œβ”€β”€ TemperatureMap.jsx  # Temperature heatmaps
β”‚   β”‚   └── WindyMap.jsx        # Wind pattern visualization
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“‚ routes/              # Routing configuration
β”‚   β”‚   β”œβ”€β”€ PrivateRoute.jsx    # Protected route wrapper
β”‚   β”‚   └── router.jsx          # Main router setup
β”‚   β”‚
β”‚   β”œβ”€β”€ App.css                 # Global styles
β”‚   β”œβ”€β”€ App.jsx                 # Root application component
β”‚   β”œβ”€β”€ index.css               # Base CSS & Tailwind imports
β”‚   └── main.jsx                # Application entry point
β”‚
β”œβ”€β”€ πŸ“„ .env.example             # Environment variables template
β”œβ”€β”€ πŸ“„ .gitignore               # Git ignore rules
β”œβ”€β”€ πŸ“„ eslint.config.js         # ESLint configuration
β”œβ”€β”€ πŸ“„ index.html               # HTML template
β”œβ”€β”€ πŸ“„ package.json             # Dependencies & scripts
β”œβ”€β”€ πŸ“„ README.md                # Project documentation
β”œβ”€β”€ πŸ“„ tailwind.config.js       # Tailwind configuration
└── πŸ“„ vite.config.js           # Vite build configuration

πŸ“‚ Directory Breakdown

/src/components/

Reusable UI components that can be used across multiple pages.

  • Footer - Application footer with links and branding
  • Navbar - Navigation bar with theme toggle

/src/contexts/

React Context API providers for global state management.

  • ThemeContext - Manages dark/light theme preferences

/src/pages/

Page-level components mapped to specific routes.

  • HomePage - Main landing page with weather overview
  • TemperatureMap - Interactive temperature visualization
  • WindyMap - Wind speed and direction maps
  • AqiMap - Air quality index display
  • CloudMap - Cloud coverage visualization
  • AverageTemperature - Historical temperature trends

/src/routes/

Application routing configuration.

  • router.jsx - Defines all application routes
  • PrivateRoute.jsx - Authentication wrapper for protected routes

πŸš€ Getting Started

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v18.0.0 or higher) - Download
  • npm (v9.0.0 or higher) or yarn (v1.22.0 or higher)
  • Git - Download

API Keys Required

  1. WeatherAPI - Get Free API Key
  2. Mapbox - Get Free API Key
  3. OpenWeatherMap (Optional) - Get Free API Key

πŸ“¦ Installation

  1. Clone the repository

    git clone https://github.com/MRaysa/WeatherSphere.git
    cd WeatherSphere
  2. Install dependencies

    npm install
    # or
    yarn install
  3. Set up environment variables

    Create a .env file in the root directory:

    cp .env.example .env

    Add your API keys:

    VITE_WEATHER_API_KEY=your_weatherapi_key_here
    VITE_MAPBOX_TOKEN=your_mapbox_token_here
    VITE_OPENWEATHER_API_KEY=your_openweather_key_here
  4. Start the development server

    npm run dev
    # or
    yarn dev
  5. Open your browser

    Navigate to http://localhost:5173


βš™οΈ Configuration

Environment Variables

Variable Description Required Default
VITE_WEATHER_API_KEY WeatherAPI.com API key Yes -
VITE_MAPBOX_TOKEN Mapbox GL JS access token Yes -
VITE_OPENWEATHER_API_KEY OpenWeatherMap API key No -

Build Configuration

The project uses Vite for building. Configuration can be modified in vite.config.js:

export default defineConfig({
  plugins: [react()],
  server: {
    port: 5173,
    host: true
  },
  build: {
    outDir: 'dist',
    sourcemap: true
  }
})

πŸ“– Usage

Development

# Start development server
npm run dev

# Run with specific port
npm run dev -- --port 3000

# Open in browser automatically
npm run dev -- --open

Production Build

# Create production build
npm run build

# Preview production build locally
npm run preview

# Analyze bundle size
npm run build -- --mode analyze

Code Quality

# Run ESLint
npm run lint

# Fix ESLint issues automatically
npm run lint:fix

# Format code with Prettier
npm run format

πŸ”Œ API Integration

WeatherAPI.com

const fetchWeather = async (location) => {
  const response = await fetch(
    `https://api.weatherapi.com/v1/forecast.json?key=${API_KEY}&q=${location}&days=7`
  );
  return response.json();
};

Mapbox GL JS

mapboxgl.accessToken = 'YOUR_MAPBOX_TOKEN';
const map = new mapboxgl.Map({
  container: 'map',
  style: 'mapbox://styles/mapbox/streets-v11',
  center: [lng, lat],
  zoom: 9
});

🀝 Contributing

We welcome contributions from the community! Here's how you can help:

How to Contribute

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/AmazingFeature
  3. Commit your changes
    git commit -m 'Add some AmazingFeature'
  4. Push to the branch
    git push origin feature/AmazingFeature
  5. Open a Pull Request

Development Guidelines

  • Follow the existing code style
  • Write meaningful commit messages
  • Add comments for complex logic
  • Update documentation as needed
  • Test your changes thoroughly

Reporting Bugs

Found a bug? Open an issue with:

  • Clear description
  • Steps to reproduce
  • Expected vs actual behavior
  • Screenshots (if applicable)
  • Environment details

πŸ“œ License

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

MIT License

Copyright (c) 2025 WeatherSphere

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...

πŸ“§ Contact

Project Maintainer - MRaysa


πŸ™ Acknowledgments


⭐ Star this repo if you find it helpful!

Made with ❀️ by MRaysa

Back to Top

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages