This Progressive Web App(PWA) is a revamp of a extension of my final project for CEIS110 Intro to Programming. The project involved using noaa_sdk and matplotlib to create a simple Python program that takes zipcode, country, and start/end date as parameters to pull weather data from NOAA sensors. After completing that project I attempted to take it a step further by making a app version of it for my phone. Because I do not know or have the time to learn how to create iOS/Android apps I opted for creating a PWA knowing it can be 'added to the home screen' as a sudo app.
My first attempt at this project got really complicated and I made the mistake of making changes to code without really keeping track of changes or documenting in the code. I think the part that really messed up the first attempt was that I took bits and pieces of code from suggestions online and just threw them into my code to try and resolve build issues.
For this attempt I spent about 8 hours reading/watching all the recources in Documents and Web Resources The plan this time is to build the PWA according to the recomended set up. I will attempt to use python where I can but wont compromise the project for it.
See the Wiki for the development process. I will make note all challenges and solutions found as well as all the people, documents and resources that helped me get this project started and running.
Talks to NOAA sensors. It is really simple since this is just a personal project..
/api/weather
Takes 3 inputs (zipcode, country, period) and returns weather stuff from NOAA.
// Basic fetch example
const response = await fetch(`/api/weather`, {
method: 'POST',
headers: {'Content-Type': 'application/json',},
body: JSON.stringify({weatherStuff: {zipcode,country,period}})
});
{resultsDiv.textContent = data.weatherData;
console.log('Temperature data:', data.temperatureData);
console.log('Humidity data:', data.humidityData);}
- If you forget something: "Missing input"
- If period isn't a number: "Period must be integer"
- If something breaks: You'll get the specific error
Check out the Wiki if you want to see how I built and tested this.
This project is licensed under the MIT License - see the LICENSE.md file for details.