TGViewer
Web Development Web Development @webdevcoursefree ยท 79.7K subscribers
Post #3807 2.69K
Now, let's understand the next web development project:

๐Ÿš€ Project 3: Weather Application Beginner to Intermediate

A Weather Application is one of the best projects to learn how websites communicate with external services. It introduces you to APIs, asynchronous JavaScript, and working with JSON data.

By the end of this project, you'll build a responsive weather app that displays real-time weather information for any city.

๐ŸŽฏ Project Goal

Build a weather application where users can:

โ€ข ๐ŸŒ Search weather by city

โ€ข ๐ŸŒก๏ธ View current temperature

โ€ข ๐Ÿ’ง View humidity

โ€ข ๐ŸŒฌ๏ธ View wind speed

โ€ข โ˜๏ธ View weather condition

โ€ข ๐Ÿ“… View a 5-day forecast

โ€ข ๐Ÿ•’ View local date and time

โ€ข ๐Ÿ“ฑ Use the app on mobile devices

๐Ÿ›  Technologies Used

Frontend:

โ€ข HTML5

โ€ข CSS3

โ€ข JavaScript ES6

API:

โ€ข OpenWeather API or any free weather API

๐Ÿ“‚ Project Folder Structure

weather-app/

โ”œโ”€โ”€ index.html

โ”œโ”€โ”€ style.css

โ”œโ”€โ”€ script.js

โ”œโ”€โ”€ assets/

โ”‚ โ”œโ”€โ”€ clear.png

โ”‚ โ”œโ”€โ”€ cloudy.png

โ”‚ โ”œโ”€โ”€ rain.png

โ”‚ โ””โ”€โ”€ snow.png

โ””โ”€โ”€ README.md

๐ŸŽจ Application Layout

    Weather App


+--------------------------+

| Search City |

+--------------------------+

[ Search ]

๐Ÿ“ City Name

๐ŸŒก๏ธ Temperature

โ˜๏ธ Weather

๐Ÿ’ง Humidity

๐ŸŒฌ๏ธ Wind Speed

5-Day Forecast

Mon โ˜€๏ธ 30ยฐC

Tue ๐ŸŒง๏ธ 27ยฐC

Wed โ˜๏ธ 29ยฐC

Thu ๐ŸŒฆ๏ธ 28ยฐC

Fri โ˜€๏ธ 31ยฐC

๐Ÿ“Œ Features

โœ… Search Weather

Allow users to enter a city name.

Example HTML:

Search

โœ… Weather Display Section



City



Temperature



Humidity



Wind Speed



Weather Condition

โœ… Fetch Weather Data

Example JavaScript:

const apiKey = "YOUR_API_KEY";

async function getWeather(city) {

const response = await fetch(

https://api.openweathermap.org/data/2.5/weather?q=city appid={apiKey}&units=metric

);

const data = await response.json();

console.log(data);

}



Never hardcode real API keys in your project. Store them securely, for example, in environment variables if you later build a backend.



โœ… Search Button

const button = document.getElementById("searchBtn");

button.addEventListener("click", () => {

const city = document.getElementById("city").value;

getWeather(city);

});

โœ… Display Weather Data

Example:

document.getElementById("weather").innerHTML =

${data.name}

${data.main.temp} ยฐC

${data.main.humidity}%

${data.wind.speed} m/s

${data.weather[0].description}

;

โœ… Display Weather Icon

Use the icon code returned by the API.

const icon = data.weather[0].icon;

const image = https://openweathermap.org/img/wn/${icon}@2x.png;

Display it inside an tag.

โœ… Handle Errors

If the user enters an invalid city:

if(data.cod === "404") {

alert("City not found");

}

๐ŸŽจ CSS Example

body {

font-family: Arial;

background: #f5f5f5;

text-align: center;

}

input {

padding: 10px;

width: 250px;

}

button {

padding: 10px 20px;

cursor: pointer;

}

๐Ÿ“ฑ Responsive Design

@media(max-width:768px) {

input {

width: 90%;

}

}

๐ŸŒŸ Bonus Features

Take your project further by adding:
  • โค 8
More from @webdevcoursefree
  1. Oct 9, 2026Post #4079
  2. Oct 9, 2026Post #4078
  3. Oct 9, 2026Post #4077
  4. Oct 9, 2026Post #4076
  5. Oct 9, 2026Post #4075
  6. Oct 9, 2026๐Ÿ‡ฎ๐Ÿ‡ณ ๐—š๐—ข๐—ฉ๐—˜๐—ฅ๐—ก๐— ๐—˜๐—ก๐—ง ๐—ข๐—™ ๐—œ๐—ก๐——๐—œ๐—” โ€” ๐—”๐—œ๐—–๐—ง๐—˜ ๐—œ๐—ก๐—ง๐—˜๐—ฅ๐—ก๐—ฆ๐—›๐—œ๐—ฃ๐—ฆ ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ ๐Ÿš€โ€ฆ
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’