← BACK

WeatherAPP

An flask weather app

HTML ⭐ 1

WeatherAPP

A simple weather application built with Flask that fetches real-time weather data using the OpenWeatherMap API.

Features

  • Search current weather by city name
  • Displays temperature (°C), weather description, humidity, and wind speed
  • Shows weather icon from OpenWeatherMap
  • Deployable to Vercel

Preview

image

Prerequisites

Setup

  1. Clone the repository

    git clone https://github.com/KunalGupta25/WeatherAPP.git
    cd WeatherAPP
    
  2. Create and activate a virtual environment

    python -m venv .venv
    # On Windows:
    .venv\Scripts\activate
    # On macOS/Linux:
    source .venv/bin/activate
    
  3. Install dependencies

    pip install -r requirements.txt
    
  4. Configure your API key

    Create a .env file in the project root:

    API_KEY=your_openweathermap_api_key_here
    
  5. Run the application

    python weather.py
    

    Open your browser and navigate to http://127.0.0.1:5000.

Deployment (Vercel)

This project includes a vercel.json configuration for easy deployment to Vercel.

  1. Install the Vercel CLI: npm i -g vercel
  2. Run vercel in the project directory and follow the prompts.
  3. Set the API_KEY environment variable in your Vercel project settings.

Project Structure

WeatherAPP/
├── weather.py          # Flask application
├── requirements.txt    # Python dependencies
├── vercel.json         # Vercel deployment configuration
├── templates/
│   └── weather.html    # HTML template
└── .env                # API key (not committed)

License

This project is open source and available under the MIT License.