Skip to content

Sauhard04/live-weather

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Weather Dashboard

A simple weather dashboard that displays current weather information for a searched city using the OpenWeatherMap API with a Node.js backend for secure API key handling.

Features

  • Search for weather by city name
  • Display current temperature in Celsius
  • Show weather condition (clear, rain, clouds, etc.)
  • Display humidity percentage
  • Secure API key handling through backend proxy

Setup and Usage

  1. Clone or download this repository
  2. Get an API key from OpenWeatherMap (free tier is sufficient)
  3. Create a .env file in the root directory and add: OPENWEATHER_API_KEY=your_api_key_here
  4. Install dependencies:
    npm install
    
  5. Start the server:
    npm start
    
  6. Open your browser and navigate to http://localhost:3000

Technologies Used

  • Frontend:
    • HTML
    • CSS
    • JavaScript
  • Backend:
    • Node.js
    • Express
    • dotenv (for environment variables)
    • cors (for handling cross-origin requests)

Project Structure

weather-dashboard/
β”œβ”€β”€ .env                # Environment variables (API key)
β”œβ”€β”€ .gitignore          # Git ignore file
β”œβ”€β”€ package.json        # Node.js dependencies
β”œβ”€β”€ server.js           # Express server and API proxy
└── public/             # Static files
    β”œβ”€β”€ index.html      # HTML structure
    β”œβ”€β”€ style.css       # CSS styles
    └── script.js       # Frontend JavaScript

Security

This application uses a backend proxy to secure the API key. The key is stored in a .env file which is not committed to the repository. API requests are made through the backend, keeping the API key secure.

Note

To use this application, you must obtain your own API key from OpenWeatherMap. The free tier allows up to 1,000 API calls per day, which is sufficient for personal use.

About

a simple dashboard that gives the weather insight of the current location

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published