Project report

lily33
CMSC495-Phase1Sourcecode.docx

CMSC 495 Phase I Source Code Phase I Source Code

Cover Page

Project Title: Weather Application Project

Team Members:

-

Introduction

This project is a weather application designed to fetch and display weather information based on a user's zip code. It incorporates various modern technologies and methodologies, including Spring Boot for the backend, HTML, CSS, and JavaScript for the frontend, and integration with the OpenWeatherMap API.

Objective

· Develop a weather application to fetch and display real-time weather data for user-specified locations.

· Provide a detailed weather forecast for the upcoming week.

· Enable users to set alerts for specific weather conditions such as rain, snow, and high temperatures.

Review the Phase I Project Scope

Deliverables:

· A functional weather application with a user-friendly GUI.

· Ability for users to search for weather updates by location.

· Detailed weather forecasts and weather alerts.

Boundaries:

· The application will only support locations that are accessible via the chosen weather API.

· The application will be developed for Java-compatible operating systems only.

Limitations:

· Real-time data accuracy is dependent on the reliability of the weather API service.

· The application will not include advanced features such as radar or satellite imagery.

3. Project Requirements

Functional Requirements:

· Select location and display weather information.

· Set and manage weather alerts.

· Display current weather conditions and forecasts.

Non-functional Requirements:

· The application must have a responsive and intuitive GUI.

· The application should perform data fetching and display updates promptly.

Technical Requirements:

· Operating System: Windows or any Java-compatible OS.

· Application Software: Java JRE.

· Tools: Java Development Kit (JDK), Integrated Development Environment (IDE) such as IntelliJ IDEA or Eclipse, access to a weather API (e.g., OpenWeatherMap).

2. Design the Software Architecture

Architecture Overview

Frontend

· Technologies: HTML, CSS, JavaScript

· Description: This layer is responsible for the user interface and user experience. It consists of HTML for structure, CSS for styling, and JavaScript for interactivity. The frontend communicates with the backend through RESTful APIs.

· Components:

· HTML files for the structure of the web pages

· CSS files for styling and layout

· JavaScript files for handling user interactions and making API requests

· Static images for weather icons based on temperature conditions

Backend

· Technologies: Spring Boot, Java 17, RestTemplate

· Description: This layer handles the business logic of the application. It processes requests from the frontend, interacts with external APIs, and returns the appropriate responses.

· Components:

· WeatherService: A service class that fetches weather data from the OpenWeatherMap API using RestTemplate.

· WeatherController: A REST controller that handles HTTP requests from the frontend and uses WeatherService to get the required data.

Data Layer

· Technologies: H2 Database (in-memory database for simplicity during development)

· Description: This layer is responsible for data storage and retrieval. It stores user preferences, such as saved zip codes, and caches weather data if necessary.

· Components:

· Entities representing the data model, such as WeatherRecord.

· Repositories for CRUD operations on the data.