Skip to content

hassannajj/weather-app

Repository files navigation

Weather App

image

image

This is a weather app created using React. It integrates two different APIs to fetch city data and weather forecasts. The app displays a 7-day weather forecast with temperature and rain probabilities. When you click on a specific day, a chart is shown displaying temperature and rain chance throughout the day.

How To Run

  1. Clone the repository:

    git clone <repo-url>
    cd weather-app
  2. Install dependencies:

    npm install
  3. Run the frontend:

    npm run build
    npm run dev
  4. Run the backend:

    node backend/server.js

API Integration

This app uses two different APIs to gather data:

1. City API - API Ninjas

  • Takes a city name and returns the latitude and longitude.
  • Example:
    • Input: "San Francisco"
    • Output:
      {
        "latitude": 37.7562,
        "longitude": -122.443
      }

2. Weather API - Open-Meteo

  • Uses the latitude and longitude from the City API to fetch weather data for the next 7 days.
  • Returns a list of temperatures and rain probabilities for each day.

3. Chart Display

  • When you click on a specific day in the forecast, it displays a chart (using Chart.js) showing the temperature and rain probability throughout the day.

Technologies Used

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published