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.
-
Clone the repository:
git clone <repo-url> cd weather-app
-
Install dependencies:
npm install
-
Run the frontend:
npm run build npm run dev
-
Run the backend:
node backend/server.js
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.
- 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.
- Frontend: React
- Backend: Node.js
- Charting: Chart.js
- APIs: