Coder Social home page Coder Social logo

bhaden94 / covid19-tracker-v2-api Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 154 KB

Spring Boot API and backend for version 2 of Covid-19 tracker.

Home Page: https://covid-tracker-v2.herokuapp.com/

License: MIT License

Java 99.81% Procfile 0.19%
gradle java mongodb-atlas spring-boot

covid19-tracker-v2-api's People

Contributors

bhaden94 avatar

Stargazers

 avatar

Watchers

 avatar

covid19-tracker-v2-api's Issues

Route To Get Days Difference

Currently I calculate days difference on the frontend. I want to move this to the backend. The route needs to handle all states/countries in one GET.

There can also be a choice of how many days difference to get. For example we could get the difference in the last day for each state/country or we could get the difference in the last 7 days for each state/country.

One option: this would move all calculation to the BE which would be nice and fast

  • parameters sent to backend: State/Country object, days difference, property name(maybe, will start by just doing active)
    • State/Country object: This would come in as a LinkedHashMap(to keep order) that would look like this
      • {
           alabama: 'Alabama',
           alaska: 'Alaska',
           arizona: 'Arizona',
           etc...
        }
      • We could then build a map where the key is state/country name and the value is the difference
        • {
             Alabama: 1200,
             Alaska: 1000,
             Arizona: -500
          }

Another easier option: This would keep calculations on the FE, but the network data should still be pretty small.

  • Return the most recent DB entry and the one that is daysDifference away

Research Where To Deploy

I have scheduled tasks that run to populate our DB with the new data daily. This may pose a problem with Heroku's free tier since it will sleep after 30 minutes of inactivity. Maybe there is another site I can use or maybe Heroku has a way to set up scheduled tasks.

Recovered/active cases removed

In the source repo the recovered and active cases are no longer reported.

I need to calculate these now instead of relying on the numbers to be there.

https: //github .com/CSSEGISandData /COVID-19/issues/3773

DB Data Validation

During scheduled update time everyday I would like to perform some data validation on what is currently in the DB.

Often times there is data from the past that gets updated and I currently have no way of going back and including that data unless I clear the DB and restart the BE to populate it again with all the data.

Rates API Route

Take in rate name and state/country name as parameters.

Find the average of that rate on the respective state/country. If no state/country given then find average of rate on all.

example return for incident_rate:

{
  "incident_rate": 1107.56
}

The bar chart needs data like this:

[
    {
        rate: 'Incident Rate',
        state_country: 0,
        us_world: 2568
    },
    {
        rate: 'Mortality Rate',
        state_country: 0,
        us_world: 2.14,
    }
]

This issue needs to handle both the rates component and the bar chart. There may need to be a few different endpoints made for it.

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.