This project is a real-time weather monitoring application that retrieves weather data for any city using the OpenWeatherMap API. The application allows users to search for weather information by entering a city name and provides real-time weather conditions, such as temperature, perceived temperature, and weather description.
Live Project Link
GitHub Repository
- Search for real-time weather data for any city globally
- Displays key weather data, including:
- Main weather condition (e.g., Rain, Clear, Snow)
- Temperature in Celsius
- Feels like temperature in Celsius
- Weather description
- Time of data retrieval (Unix timestamp)
- Simple and user-friendly interface
-
Install Docker and Docker Compose on your system.
-
Clone the repository:
git clone https://github.com/DHANUNJAY965/weather-Application.git cd weather-Application
-
Build and run the Docker containers:
docker-compose up --build
-
The application will be available at http://localhost:3000.
-
Install Node.js (v14 or later) on your system.
-
Clone the repository:
git clone https://github.com/DHANUNJAY965/weather-Application.git cd weather-Application
-
Install dependencies:
npm install
-
Run the development server:
npm run dev
-
The application will be available at http://localhost:3000.
-
Open your browser and navigate to http://localhost:3000.
-
In the search bar, enter the name of any city to retrieve real-time weather data for that location.
-
The application will display:
- Main weather condition (e.g., Rain, Clear, Snow)
- Current temperature (in Celsius)
- Feels like temperature (in Celsius)
- Weather description
- Time of the data retrieval
The application uses the OpenWeatherMap API to retrieve real-time weather data. To run the project, you'll need to:
- Sign up for a free API key from OpenWeatherMap here.
- Add the API key to the environment variables as follows:
NEXT_PUBLIC_OPENWEATHER_API_KEY=your_api_key
A Dockerfile
and docker-compose.yml
are included to run the application in a containerized environment.
-
Dockerfile: Defines the Node.js environment and serves the Next.js application.
-
docker-compose.yml: Builds the application container and starts the service.
To build and run the application using Docker, follow these steps:
docker-compose up --build
The application will be available at http://localhost:3000.
-
Search not returning results:
- Ensure the OpenWeatherMap API key is valid.
- Verify internet connectivity.
- Ensure the city name is spelled correctly.
-
Docker containers not starting:
- Ensure Docker is installed and running.
- Check the
docker-compose.yml
configuration for errors.
For any further issues or questions, please feel free to open an issue on the GitHub repository.