converting into flask app + javascript front end app