Welcome to my Weather App built utilizing TypeScript and React.
A user is able to input their ZIP code or click "Use Current Location" to pull location data by IP address. To see more advanced weather details, click "More Details" on the bottom of the page. This app will auto-update every 10 seconds to ensure the most accurate data is being displayed to a user.
From the initial file, I connected all components using React and made components functional. Here is a list of major additions.
-
Client class
- Added API freegeoip.app to pull a users location data based on their IP address
- Changed the interface to include weather icon data
-
Main React Components
- Homepage
- Stores the current weather state as well as any error messages we receive and need to display.
- Homepage
-
Header
-
Weather
-
AdvancedWeather (new component)
- shows additional weather information
-
CountDown (new component)
- keeps track of seconds using
useState,useEffect, andsetTimeoutthat will countdown until 0 where it will refresh the data with the current ZIP code.
- keeps track of seconds using
-
Styling
- removed table tag styling
- imported a new google font called "Jost"
- made the app responsive using
bootstrap.css
I've also included a Dockerfile with instructions on how to run using Docker. Thanks for checking out my app and my code!
git clone https://github.com/JordanRaleigh/ReactWeatherApp.git
cd ReactWeatherApp
npm install
npm start
Open http://localhost:9001 to view it in the browser.
npm run build
docker build . -t "image name"
docker image ls
docker run "image name"
NOTE: replace "image name" with your desired image name
docker ps
docker exec -it "CONTAINER ID" sh
npm start
NOTE: replace "CONTAINER ID" with the respective container id
I would have loved to implement the following to my weather app given more time
Testing
- Add Mocha and Chai testing frameworks
- Build out unit testing for all functions
- Build integration testing on each broken out component

