Name: Rishabh Das
Company: CODTECH IT SOLUTIONS
ID: CT08PD733
Domain: WEB DEVELOPMENT
Duration: 4 weeks
Mentor: G.SRAVANI
A simple weather application built using React.js and the Visual Crossing Weather API from RapidAPI. This app allows users to get current weather information for any city.
- Fetch current weather data for any city
- Display temperature, weather conditions, humidity, and wind speed
- User-friendly interface with input for city names
- Error handling for invalid city names or API errors
- Clone the repository:
git clone https://github.com/rishabhdas1006/sky-guard-weather-app.git
- Install the dependencies:
npm install
- Create a .env file in the root directory and add your RapidAPI key:
REACT_APP_RAPIDAPI_KEY = your-rapidapi-key
- Start the development server:
npm start
- Open your browser and navigate to http://localhost:3000.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
Builds the app for production to the build
folder.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
Note: this is a one-way operation. Once you eject
, you can't go back!
If you aren't satisfied with the build tool and configuration choices, you can eject
at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject
will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
You don't have to ever use eject
. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
##Usage
-
Enter the name of the city you want to get weather information for.
-
Click the "Search city" button.
-
The app will display the current weather information for the specified city.
This app uses the Visual Crossing Weather API from RapidAPI. To use this API, you need an API key from RapidAPI. You can sign up and get your API key from RapidAPI.
const options = {
method: 'GET',
url: 'https://visual-crossing-weather.p.rapidapi.com/forecast',
params: {location: 'city-name', aggregateHours: '24', contentType: 'json', unitGroup: 'metric'},
headers: {
'X-RapidAPI-Key': process.env.REACT_APP_RAPIDAPI_KEY,
'X-RapidAPI-Host': 'visual-crossing-weather.p.rapidapi.com'
}
};
axios.request(options).then(response => {
console.log(response.data);
}).catch(error => {
console.error(error);
});
Contributions are welcome! Please feel free to submit a Pull Request.