This Weather Application is a simple yet comprehensive tool that allows users to register, log in and access weather information for their location, search for specific cities or locations using latitude and longitude, view recent searches and mark favorite cities for quick access. The application relies on external APIs for weather data.
- Weather Data: Weather information is fetched from the WeatherAPI. Obtain the necessary data here.
- Collects user information with mandatory fields including country, state, city, latitude, and longitude.
- Secure login functionality using valid credentials, with user sessions stored in Redis.
- Displays the weather of the user's location on the dashboard.
- Enables users to search for weather based on city or latitude and longitude.
- Displays the user's five most recent searches on the dashboard.
- Allows users to mark search results as favorites for quick access to weather information on the dashboard.
-
Clone the repository and navigate to the project directory.
git clone https://github.com/sthsuyash/Weather-application.git && cd Weather-application
-
Install the dependencies.
npm install
-
Create a new account on WeatherAPI and obtain the API key.
-
Create a new database in MySQL.
CREATE DATABASE weatherapp;
-
Copy the
.env.example
file to.env
and update the environment variables as per your requirements.cp .env.example .env
-
Start redis server in docker container.
docker run -p 6379:6379 --name redis -d redis
-
Migrate the database.
npm run migrate
-
Start the application.
npm start
-
Open the application in your browser. http://localhost:3000