1
INDIRA GANDHI ENGINEERING COLLEGE
SAGAR (M.P.)
A
MINOR PROJECT REPORT ON
“Weather App”
SESSION 2021-22
Submitted to
Rajiv Gandhi Proudyogiki Vishwavidyalaya, Bhopal (M.P.)
In partial fulfilment of the degree
Of
Bachelor of Technology
In
Information Technology
Guided By: Submitted To:
Ms. Pragati Rajput Prof. Amy Alice Kujur Mrs.
Shalu Jain (Head of Department) (Faculty)
Department of Information Technology Department of Information Technology
I.G.E.C Sagar (M.P.) I.G.E.C Sagar (M.P.)
Submitted By:
Vikalp Dubey : 0601IT191066
Ankit Mishra : 0601IT191007
2
INDIRA GANDHI ENGINEERING COLLEGE
SAGAR (M.P.)
CERTIFICATE
This is to Certify that Vikalp Dubey and Ankit Mishra of B.Tech. 6th Semester,
Information Technology Engineering have completed Minor Project report on “Weather App”
towards the partial fulfilment of the requirement for the award of the degree of Bachelor of
Technology in Information Technology of Rajiv Gandhi Proudyogiki Vishwavidyalaya,
Bhopal (M.P.) for the session 2021-22.
The work presented in this report has been carried out by them under our guidance and
supervision.
Co-Guided By: Submitted To:
Ms. Pragati Rajput Prof. Amy Alice Kujur
Mrs. Shalu Jain (Head of Department)
(Faculty)
Department of Information Technology, Department of Information Technology,
I.G.E.C Sagar (M.P.) I.G.E.C Sagar (M.P.)
Prof. Amy Alice Kujur Dr Anurag Trivedi
(Head of Department) (Principal)
Department of Information Technology, Department of Information Technology,
I.G.E.C Sagar (M.P.) I.G.E.C Sagar (M.P.)
3
ACKNOWLEDGEMENT
It is with great reverence that we express our gratitude to our guides “Ms. Pragati
Rajput, Mrs. Shalu Jain”, Department of Information Technology Engineering,
Indira Gandhi Engineering College for their precious guidance and help in this
project work. The credit for the successful completion of this project goes to their
keen interest, timing guidance and valuable suggestion otherwise our endeavour
would have been futile.
We owe to “Prof. Amy Alice Kujur”, Head of Department of Information
Technology Engineering for his persistent encouragement and blessing which were
bestowed upon us.
We owe our sincere thanks to honourable Principal “Dr Anurag Trivedi”, for his
kind support which he rendered us in the envisage for great success of our project.
Vikalp Dubey : 0601IT191066
Ankit Mishra : 0601IT191007
4
INDIRA GANDHI ENGINEERING COLLEGE
SAGAR (M.P.)
DECLARATION
We hereby declare that the following Minor Project on “Weather App” is an
authentic work done by us. We undertake the project as a part of the course
curriculum of Bachelor of Technology in Information Technology of Indira Gandhi
Engineering College, Sagar (M.P.) affiliated to Rajiv Gandhi Proudyogiki
Vishwavidyalaya, Bhopal (M.P.).
Vikalp Dubey : 0601IT191066
Ankit Mishra : 0601IT191007
5
Table of Contents
Sr.No Title Page No
1 Introduction 6
1.1 Background 7
1.2 Objectives 8
1.3 Purpose and Scope 9
2 Survey of Technology 10
3 Requirement and Analysis 12
3.1 Feasibility study
12
3.2 Hardware and Software Requirements
13
4 System Design 14
4.1 ER Diagram 14
4.2 Activity Diagram 15
4.3 Use Case Diagram 16
4.4 Sequence Diagram 17
4.5 Snapshot 18
4.6 Data Flow Diagram 20
4.7 Source Code 21
Reference and Bibliography 23
6
Weather App
1. INTRODUCTION
Weather forecasting is the application of science and technology to predict the conditions of the
atmosphere for a given location and time.
Human beings have attempted to predict the weather informally for millennia and formally since
the 19th century. Weather forecasts are made by collecting quantitative data about the current
state of the atmosphere at a given place and using meteorology to project how the atmosphere
will change.
Once a human-only endeavor based mainly upon changes in barometric pressure, current
weather conditions, and sky condition or cloud cover, weather forecasting now relies on
computer-based models that take many atmospheric factors into account. Human input is still
required to pick the best possible forecast model to base the forecast upon, which involves
pattern recognition skills, tele-connections, knowledge of model performance, and knowledge of
model biases. The inaccuracy of forecasting is due to the chaotic nature of the atmosphere, the
massive computational power required to solve the equations that describe the atmosphere, the
error involved in measuring the initial conditions, and an incomplete understanding of
atmospheric processes. Hence, forecasts become less accurate as the difference between current
time and the time for which the forecast is being made (the range of the forecast) increases. The
use of ensembles and model consensus help narrow the error and pick the most likely outcome.
There are a variety of end uses to weather forecasts. Weather warnings are important forecasts
because they are used to protect life and property. Forecasts based on temperature and
precipitation are important to agriculture, and therefore to traders within commodity markets.
Temperature forecasts are used by utility companies to estimate demand over coming days. On
an everyday basis, people use weather forecasts to determine what to wear on a given day. Since
outdoor activities are severely curtailed by heavy rain, snow and wind chill, forecasts can be
used to plan activities around these events, and to plan ahead and survive them. In 2009, the US
spent $5.1 billion on weather forecasting.
1.1 BACKGROUND
There are numerous apps and websites available on the Internet to get accurate weather
radar data. However, many require a fee, either to purchase the app or to subscribe to the radar
data itself. While most of these paid options will give you real-time live radar data, a few free
radar websites and apps offer user-friendly radar imagery with minimal delay. A few examples
of both free to download and use sites available in market are discussed in this section along with
the tasks they can provide and their drawbacks.
7
National Weather Service
Website: https://radar.weather.gov
The National Weather Service offers radar data free from its website and is relatively easy to use,
and the site was recently updated, making it easier to use than before. A new user interface
allows users to zoom in and out easily, and it’s usable on both desktops and mobile phones. You
can view animations and view other radar products that show wind velocity and rainfall as well.
The site also layers warning boxes over the imagery so you can see which storms have severe
warnings.
Despite the drastically improved interface, many of the old negatives remain. The radar
resolution is still a bit grainy, and it isn’t as quick to update as some other apps. There’s still no
app either, but that’s due to a non-compete clause with the private industry in Federal law. So
you won’t get notifications of severe weather for your area.
Pros
Offers a full suite of radar products for free
Much improved user interface which is easy to navigate on a mobile device
Cons
Resolution is grainy
AccuWeather
Website: https://www.accuweather.com/en/us/national/weather-radar
AccuWeather is another app that does a whole lot more than just radar. Along with radar, you
also have access to AccuWeather’s 15-day forecasts and a host of other weather data. The radar
also has a future radar option, but unlike the Weather Channel’s, it only goes out three hours in
advance. Zooming in and out is easy too.
While it doesn’t smooth the radar images to the degree The Weather Channel’s app does, it is
still enough that it may cause some inaccuracy. The user interface is not as intuitive as others on
our list, but in terms of the amount of data available, it is one of the more feature-rich.
8
Pros
Access to AccuWeather content
Lots of data options
Cons
Radar images aren’t the best resolution
Future radar only goes out 3 hours
1.2 OBJECTIVES
Weather forecasting is very necessary for our daily lives. It helps us to prepare and make plans
depending on the expectations. Many weather stations are placed around the world fetching real-
time weather elements’ data.
This data includes three components namely
Today’s weather
Hourly weather
Weekly weather
Where we will get to know temperature, sunrise-sunset timing, weather details through icons
and weeklong weather forecast. With these, you can analyze trends and know the prediction of
tomorrow’s data or forecast the weather.
Most of these large chunks of data are processed at base stations using powerful and
sophisticated systems. They then share this data, (either analyzed over a long time or real-time
data) through APIs. Companies that do this includes OpenWeatherMap and Dark Sky.
9
1.3 PURPOSE AND SCOPE
Purpose
The purpose of developing weather app is to fetch the weather data from all over the world and
to provide it to people at their fingertips with simple and easy to use interface. Another purpose
for developing this site is to reduce the risk of distorting daily plans and arrangements which can
be ruined if we don’t know the weather around us since nobody really knows for certain what is
likely to happen in the nearest minute.
Scope
In ancient times, forecasting was mostly based on weather pattern observation. Over the years,
the study of weather patterns has resulted in various techniques for rainfall forecasting. Present
rainfall forecasting embodies a combination of computer models, interpretation, and an
acquaintance of weather patterns. Now days we use many advanced technologies for weather
forecasting such as Ensemble Forecasting, Radar, Weather Satellites and Weather Maps and
in future we will evolve more. The scope of the project is the system on which the Node.js is
installed, i.e. the project is developed as a desktop application, and it will work for a particular.
But later on the project can be modified to operate it online.
2. SURVEY OF TECHNOLOGY
Next Js
10
Created by Vercel, a cloud company for hosting frontends and serverless functions , Next.js is
a React framework capable of creating applications that run both on the client and the server,
otherwise known as Universal JavaScript applications. This framework helps you build
universal apps faster by streamlining basic features like client-side routing and page layout
while simplifying advance features like server-side rendering and code splitting.
Node Js
Node Js is a Java Runtime Environment. A Java Runtime Environment (JRE) is software that is
made to execute other software. A JRE often contains three of the following elements: A Java
Virtual Machine, a Java Classloader, and a Java Class Library. The ClassLoader is used to load
everything needed to execute a program. The Java Class Library contains a set (or library) of
reusable code that can be used to make programs, and the Java Virtual Machine allows a
computer to execute programs and applications written in Java.
Node JS contains all these elements thanks to Chrome’s V8, which was the engine used to build
it. In short, Node Js is a Javascript Runtime Environment, and it’s used to execute JavaScript
code outside of a browser.
Npm
npm is the package manager for the Node JavaScript platform. It puts modules in place so that
node can find them, and manages dependency conflicts intelligently.
It is extremely configurable to support a wide variety of use cases. Most commonly, it is used to
publish, discover, install, and develop node programs.
Javascript
JavaScript is a text-based programming language used both on the client-side and server-side
that allows you to make web pages interactive. Where HTML and CSS are languages that give
structure and style to web pages, JavaScript gives web pages interactive elements that engage a
user. Common examples of JavaScript that you might use every day include the search box on
Amazon, a news recap video embedded on The New York Times, or refreshing your Twitter
feed.
React
React. js is an open-source JavaScript library that is used for building user interfaces specifically
for single-page applications. ... React allows developers to create large web applications that can
change data, without reloading the page. The main purpose of React is to be fast, scalable, and
simple.
OpenWeatherMap
11
OpenWeatherMap is an online service, owned by OpenWeather Ltd, that provides
global weather data via API, including current weather data, forecasts, nowcasts and historical
weather data for any geographical location. The company provides a minute-by-minute
hyperlocal precipitation forecast for any location.
3. REQUIREMENT AND ANALYSIS
3.1 Feasibility Study
Feasibility study can help you determine whether or not you should proceed with your
project. It is essential to evaluate cost and benefit. It is essential to evaluate cost and benefit of
the proposed system. Five types of feasibility study are taken into consideration.
12
Technical feasibility: It includes finding out technologies for the project, both hardware and
software. For weather app user must stable internet connection. While using weather app, make
sure you have a steady internet connection. It is also not an issue in this era where almost every
home or office has Wi-Fi.
Operational feasibility: It is the ease and simplicity of operation of proposed system.
System does not require any special skill set for users to operate it. In fact, it is designed to be
used by almost everyone. Kids who still don’t know to write can read out problems for system
and get answers.
Economical feasibility: Here, we find the total cost and benefit of the proposed system
over current system. For this project, the main cost is documentation cost. User just needs to pay
for their internet charge.
This project is technically feasible with no external hardware requirements. Also it is
simple in operation and does not cost training or repairs. Overall feasibility study of the
project reveals that the goals of the proposed system are achievable. Decision is taken to
proceed with the project.
3.2 HARDWARE AND SOFTWARE REQUIREMENTS
The software is designed to be light-weighted so that it doesn’t be a burden on the
machine running it. This system is being build keeping in mind the generally available hardware
and software compatibility. Here are the minimum hardware and software requirement for
virtual assistant.
Hardware:
13
Pentium-pro processor or later.
RAM 512MB or more.
Web-Browse
Software:
Windows 7(32-bit) or above.
IDE (vs-code)
Chrome
Node Js
4. SYSTEM DESIGN
4.1 ER DIAGRAM
14
4.2 ACTIVITY DIAGRAM
15
4.3 USE CASE DIAGRAM
16
4.4 SEQUENCE DIAGRAM
17
4.5 SNAPSHOT
18
19
20
4.6 DATA FLOW DIAGRAM
4.7 SOURCE CODE
21
CITY.JS
import React from "react";
import cities from "../../lib/city.list.json";
import Head from "next/head";
import moment from "moment-timezone";
import TodaysWeather from "../../components/TodaysWeather";
import HourlyWeather from "../../components/HourlyWeather";
import WeeklyWeather from "../../components/WeeklyWeather";
import SearchBox from "../../components/SearchBox";
import Link from "next/link";
export async function getServerSideProps(context) {
const city = getCity(context.params.city);
if (!city) {
return {
notFound: true,
};
}
const res = await fetch(
`https://api.openweathermap.org/data/2.5/onecall?lat=${city.coord.lat}&lon=$
{city.coord.lon}&appid=${process.env.API_KEY}&units=metric&exclude=minutely`
);
const data = await res.json();
if (!data) {
return {
notFound: true,
};
}
const hourlyWeather = getHourlyWeather(data.hourly, data.timezone);
return {
props: {
city: city,
timezone: data.timezone,
currentWeather: data.current,
weeklyWeather: data.daily,
hourlyWeather: hourlyWeather,
},
};
}
const getCity = (param) => {
const cityParam = param.trim();
// get id of city
22
const splitCity = cityParam.split("-");
const id = splitCity[splitCity.length - 1];
if (!id) {
return null;
}
const city = cities.find((city) => city.id.toString() == id);
if (city) {
return city;
} else {
return null;
}
};
const getHourlyWeather = (hourlyData, timezone) => {
const endOfDay = moment().tz(timezone).endOf("day").valueOf();
const eodTimeStamp = Math.floor(endOfDay / 1000);
const todaysData = hourlyData.filter((data) => data.dt < eodTimeStamp);
return todaysData;
};
export default function City({
hourlyWeather,
currentWeather,
weeklyWeather,
city,
timezone,
}) {
return (
<div>
<Head>
<title>{city.name} Weather App Project</title>
</Head>
<div className="page-wrapper">
<div className="container">
<Link href="/">
<a className="back-link"> ← Home</a>
</Link>
<SearchBox placeholder="Search for another city"/>
<TodaysWeather city={city}
weather={weeklyWeather[0]}
timezone={timezone} />
<HourlyWeather hourlyWeather={hourlyWeather} timezone={timezone} />
23
<WeeklyWeather weeklyWeather={weeklyWeather} timezone={timezone} />
</div>
</div>
</div>
);
}
INDEX.JS
import Head from "next/head";
import SearchBox from "../components/SearchBox";
import FamousPlaces from "../components/FamousPlaces";
export default function Home() {
return (
<div>
<head>
<title>Weather App</title>
</head>
<div className="home">
<div className="container">
<SearchBox placeholder="Search for a city..." />
<FamousPlaces />
</div>
</div>
</div>
);
}
24
REFERENCE AND BIBLIOGRAPHY
Websites referred
▪ www.stackoverflow.com
▪ www.pythonprogramming.net
▪ www.codecademy.com
▪ www.tutorialspoint.com
▪ www.google.co.in
THANK YOU
www.stackoverflow.comTHANK YOU