I created this project to practice React, HTML forms and APIs. This project is done localy but isn't ready for production.
- React
- Vite
- HTML
- CSS
- API (https://openweathermap.org/api)
The app pulls up the weather for Denver as a default. The user can then search for any city in the world and see what the weather is like there. It will show the user the curent temperature, the high and low for the day as well as an icon for the weather condition. If the city is not in the database, the app will return an error message.
I used Vite since Create-React-App is now defunct. I connected to the API then decided what data I would show and how.
This was a great project to get back into React. I struggled a little with state management because I forgot that if you put anything in the dependency array, the app will update with any keystroke in the search box. But once I solved that, the rest of the app was smooth sailing. I look forward to working with more APIs in the future.
The app is pretty bare bones. I can imagine this being a little widget in a larger project. I still need to learn how to prepare projects for production. I put the API key in an .env file so the API is not being called in the live site.