Hey DEV Community! π
I'm excited to share a project I recently completed β a Weather Application built using HTML, CSS, and JavaScript.
This was my first real experience working with APIs, and I learned a lot about how to fetch and display real-time data dynamically on a webpage.
π Live Demo
Check it out here π https://weather-app-gaurav-s-projects-d25bef28.vercel.app
- π» GitHub Repository
Source code available here π https://github.com/Gaurav-creater317/Weather-App
- π About the Project
- The weather app allows users to:
- Search for any city π
- Get real-time temperature π‘οΈ
- View weather conditions with icons βοΈ
- See humidity and wind speed π§π¬οΈ
- Handle errors like "city not found" β
- π οΈ Technologies Used
- HTML β Structure
- CSS β Styling
- JavaScript β App Logic
- OpenWeatherMap API β Weather Data
- Vercel β Deployment
π§ͺ Key Features
β Fetch weather by city name
β Display weather icon, temperature, and description
β Shows humidity and wind speed
β Error handling for invalid inputs
β Responsive design
- π§ What I Learned
- This project helped me understand:
- Working with fetch() and async/await .
- Parsing and using JSON data .
- Dynamically updating the DOM .
- Handling API errors gracefully.
- Deploying projects using Vercel .
πΈ Screenshots
π Sample Code Snippet
async function getWeather(city) {
const response = await fetch(
`https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=YOUR_API_KEY&units=metric`
);
if (!response.ok) {
showError("City not found!");
return;
}
const data = await response.json();
updateUI(data);
}
- π¬ Final Thoughts
- Building this weather app really boosted my confidence with JavaScript and API integration. π
- If you're just starting out with web development, I highly recommend trying out a project like this. Itβs simple, useful, and gives you a hands-on experience working with real-world data.
- Feel free to check out the app, explore the code, and let me know what you think. Feedback and suggestions are always welcome! π
*- Want help with your first API project? Drop a comment! Letβs connect and grow together π
*
Top comments (0)