frontend send data from react to flask switch state to prevent multiple input display data switch react boilerplate backend input data into db hosting switch localhost references to make it work on heroku setup postgresql on heroku