Design and Implementation of a Real-Time Weather Forecast Web Application Using HTML, CSS, JavaScript, and OpenWeatherMap API
DOI:
https://doi.org/10.64751/ajmimc.2026.v5.n2(2).358Abstract
Access to timely and accurate weather information has become an indispensable requirement across virtually every sector of modern society, from agriculture, transportation, and disaster management to everyday travel planning. This paper presents the complete design and implementation of a lightweight, client-side Weather Forecast Web Application that delivers real-time meteorological data for any city worldwide without requiring dedicated backend infrastructure. The system is built entirely on foundational open web standards — HTML5, CSS3, and JavaScript (ES6+) — and integrates the OpenWeatherMap Current Weather Data REST API to fetch and display seven live parameters: current temperature, feels-like temperature, humidity, wind speed, atmospheric pressure, weather condition description, and a condition icon. Asynchronous communication is implemented via the Fetch API with full Promise-based error handling, ensuring no-reload updates and graceful degradation under network failure. A CSS Flexbox and media-query-driven responsive layout adapts seamlessly across viewports from 320 px smartphones to 1920 px widescreen desktops. An in-memory response cache with a five-minute TTL reduces redundant API calls by 62 percent in load tests. Ten structured functional and performance test cases all passed, with API response times averaging 320 ms on broadband and 780 ms on simulated 3G. The paper details the five-layer system architecture, iterative four-phase development methodology, eight key features, security considerations, and a prioritized eightitem future-enhancement roadmap covering a server-side API proxy, GPS-based detection, 7- day forecasting, user authentication, weather alerts, progressive web app capabilities, machine-learning-based on-device prediction, and multi-language support.







