This application was developed for internship assignment.
You can use the links below to see the UI design at Figma and related GitHub repository.
Environment variables must be set for the application to run properly.
First, copy the .env.example
file and paste it as .env.local
.
Then, obtain API keys from the following websites:
- VITE_WEATHER_API_KEY: You can obtain your api key from Weatherapi. This api provides weather forecasts and current conditions based on the given latitude and longitude coordinates.
- VITE_OPENWEATHER_API_KEY: You can obtain your api key from Openweathermap. Use this api to accurately locate the given location from the user with their Geocoding API.
Note: If the user chooses a suggestion, the Geocoding API won't be utilized because suggestions already contain latitude and longitude information in the places.json file.
git clone emirhansirkeci/iWeather
cd iWeather
npm install
Run the application in development mode.
npm run dev
Preview command can be used to run the application in production mode. Before running the preview command, it is necessary to build the project. Once the build process is complete, you can run the preview command.
npm run build
npm run preview
You can add new locations to src/utils/places.json
to work with the autocomplete feature.
- name (required): The name of the city.
- country (required): The name of the country.
- lat (required): The latitude coordinate.
- lon (required): The longitude coordinate.
For example, let's add Berlin to the list.
[
{
"name": "osmaniye",
"country": "turkey",
"lat": 37.06805,
"lon": 36.261589
},
{
"name": "berlin",
"country": "germany",
"lat": 52.520008,
"lon": 13.404954
}
]
Now, Berlin will appear as a suggestion like Berlin - Germany
.