weatherify

Weatherify

A modern, responsive weather application built with vanilla HTML, CSS, and JavaScript that displays current weather conditions and a 5-day forecast for any city worldwide.

REQUEST- The project requires refinement and there are several features that can be added, therefore you can contribute to the project and make it more efficient.

Features

Live Demo

View the live demo here//Currently not working)

Note: GitHub Pages serves static files only. The app expects a small local (or hosted) Node server that proxies OpenWeatherMap so the API key stays on the server. For the public Pages demo to keep working, maintainers need either a deployed proxy (for example Cloudflare Worker, Vercel serverless, or this server.js on a host) or a separate demo URL that runs behind that proxy.

It is requested that users go for local development in order to access the app

Local development

  1. Install Node.js 18 or newer.
  2. From the project root, run npm install.
  3. Copy .env.example to .env and set OPENWEATHER_API_KEY to your OpenWeatherMap API key.
  4. Run npm start and open http://localhost:3000 (or the port shown in the terminal).

Opening index.html directly in the browser (file://) will not work for weather requests, because the UI calls same-origin /api/* routes that are provided by server.js.

Key rotation (security)

If an API key was ever committed to the frontend, revoke it in the OpenWeatherMap dashboard and create a new key. Only store the new key in .env (and in your host’s environment variables), never in script.js or other tracked client files.

Technologies Used

API Integration

This app uses the OpenWeatherMap API for weather data. The browser only talks to same-origin routes:

The server adds appid from the OPENWEATHER_API_KEY environment variable. The key is not shipped in script.js.

Project Structure

weatherify/
β”œβ”€β”€ index.html          # Main HTML structure
β”œβ”€β”€ style.css           # All styling and responsive design
β”œβ”€β”€ script.js           # JavaScript functionality (calls /api/* only)
β”œβ”€β”€ server.js           # Static files + OpenWeatherMap proxy
β”œβ”€β”€ package.json
β”œβ”€β”€ .env.example        # Example env vars (copy to .env)
└── README.md           # This file

Usage

  1. Search for a city: Type the city name in the search box
  2. Autocomplete suggestions: As you type, city suggestions will appear
  3. View weather data: Current weather displays immediately
  4. 5-day forecast: Scroll horizontally to see upcoming weather

Key Features Explained

Weather Data Display

5-Day Forecast

Search & Autocomplete

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Future Enhancements

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project Link: (https://ashujsrfox.github.io/weatherify/)