Skip to content

saurzv/weather-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Weather App

Live Page

How to use

Enter any location in the world and it should display a weather card containing the following information :

  • Temperature
  • Humidity
  • Weather Description

External APIs Used

  • OpenWeather Geocoder API : To retrieve the latitude and longitude of a location
  • OpenWeather Current Weather API: To retrieve the weather information for that location

Dependancy

This project consists of a frontend React application and a backend Django server. The dependencies for each are listed below:

Frontend

  • React
  • react-dom
  • react-scripts
  • @mui/material

Backend

  • Django
  • requests
  • python-dotenv

Run on local machine

1. Clone the git repository

git clone https://github.com/saurzv/weather-app.git

2. Install required packages for backend and frontend and run servers

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