Enter any location in the world and it should display a weather card containing the following information :
- Temperature
- Humidity
- Weather Description
- OpenWeather Geocoder API : To retrieve the latitude and longitude of a location
- OpenWeather Current Weather API: To retrieve the weather information for that location
This project consists of a frontend React application and a backend Django server. The dependencies for each are listed below:
- React
- react-dom
- react-scripts
- @mui/material
- Django
- requests
- python-dotenv
git clone https://github.com/saurzv/weather-app.git
Go to the server directory
cd weather-app/server/
And run
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
This will install all the required packages for the backend.
Create a .env file and paste your OpenWeather API as
API_KEY=<YOUR_API_KEY>
Make migrations and start the backend server
python3 manage.py makemigrations
python3 manage.py migrate
python3 manage.py runserver localhost:8000
Similarly for frontend
cd weather-app/client/
yarn
or
cd weather-app/client/
npm install
After installing the required packages, start the frontend server
yarn start
or
npm start
The site should start running