Giter Site home page Giter Site logo

duffylaura / particle-problems Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 378 KB

An easy-to-use app that shows the user pollen count and air quality in entered location; user can also save their asthma action plan to app.

License: MIT License

HTML 45.55% JavaScript 53.24% CSS 1.21%
bulma bulma-css-framework html-css-javascript leaflet-map local-storage mobile-first open-weather-api third-party-api breeze-o-meter-api

particle-problems's Introduction

PARTICLE SOLUTIONS

Got Particle Problems? We got Particle Solutions!

https://duffylaura.github.io/Particle-Problems/

Description

pollution-description

We want a reliable, easy/enjoyable to use app that tells the user the pollen count and the air quality in their location (or the location they choose to search).

Like light coming through a window in a dusty room, we want to illuminate how many particles are in the air in a simple way for anyone, but especially for those with asthma, allergies, and other conditions in which high particle count in the air is a struggle.

Our application will provide a solution to those with Particle Problems in one click, instead of several Googles per day.

image

Table of Contents

Installation

Our team came together to decide how to create an application that is easy to use and useful for users who are interest about the air quality and pollen count. Our Workflow: image

Technologies Used

  • GitHub
  • Apple Photos “MarkUp” feature
  • MarkDown
  • HTML
  • CSS
  • JavaScript
  • APIs: Breeze-O-Meter and Open Weather Map
  • Libraries: Bulma, Leaflet, jQuery, jQuery widgets

Usage

todaymap 3dayforecast aap

Breakdown of how to use Particle Solutions!

  1. Enter a city on the landing page.
  2. Select if you want to see Today or a Three-Day Forecast, then click submit.
    • Today's Forecast will show you a map and as a user, you can move the map around.
    • The user has options to select either one of the buttons to display: air pollution, grass pollen, tree pollen, or weed pollen.
    • 3-Day Forecast will display easily readable data of the current and the following 2 days about levels of pollen and air quality.
    • The user may click on the "Link for info on AQI" to access more information about AQI levels.
  3. On the landing page, the user can select My Asthma Action Plan or the Access & Giving Back buttons.
    • The My Asthma Action Plan page allows the user to input their data and save it all in one place so they can refer to it or make changes to it.
    • The Giving Back page is still in progress but the goal there is to allow the user to access more data if they want to donate to organizations that provde resources to the community who has asthma and/or struggles to get the proper care for their severe allergies.

API calls

When the user clicks the submit button on the landing page after inputing their city of choice and selecting the radio option of today's or 3-day forecast, there will be api call(s). These api calls allow us to use data from other websites and select to show what content to show the user. This can be seen in the console of the web browser.

consoleapi

Here are code snippets of how we used server-side API:

function geoCode5day (){
    var geocodeKey = "f4ac9ae98ce232f81e1a8c7e3fd76a5a";
    var url = "https://api.openweathermap.org/geo/1.0/direct?q="+saveCity+"&limit=1&appid="+geocodeKey
    fetch(url).then(function(response){
        return response.json()
    }).then(function(data){
        var lat = data[0].lat;
        var lon = data[0].lon;
        breezometer(lat,lon)
        localStorage.setItem("lat", lat);
        localStorage.setItem("lon", lon);
    })
}
function breezometer(lat,lon){
    var breezokey = "f7ef38aba28849b8819220ae11e4b3e3";
    url= "https://api.breezometer.com/pollen/v2/forecast/daily?lat="+lat+"&lon="+lon+"&key="+breezokey+"&days=3"
    fetch(url).then(function(response){ 
        console.log(response)
        return response.json()
    }).then(function(data){
        console.log(data)
        
    var apiKey = "aa3ac1aee36fc947283c79786b233621";
    var oneweatherairurl = `https://api.openweathermap.org/data/2.5/air_pollution/forecast?lat=${lat}&lon=${lon}&appid=${apiKey}`
    fetch(oneweatherairurl).then(function(pollutants){
        console.log(pollutants)
        return pollutants.json()
    }).then(function(pollutants){
        console.log(pollutants)

CSS Framework

We used BULMA to style our webpage!

Here is how our application functions on a smaller screen size.

Particles Solutions

Learning Objectives

  • We definitely learned how to dynamically work with each other to avoid merging repo conflicts.
  • We also have learned about server-apis on how to use them, use new libraries like BULMA to style our webspage, and use library like Leaflet to provide us a map so we can present it to our users.
  • Most importantly we collarative with each other to test out what failed and what works!

Credits

Collaborators:

License

MIT License

  • Please refer to the LICENSE file in the Repository.

particle-problems's People

Contributors

duffylaura avatar ncguan avatar philiphuang2 avatar skywalkermm26 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

skywalkermm26

particle-problems's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.