As someone with a non-technical background, I stumbled on the concept of deployment in the same way as I did data science — out of a desire for greater efficiency. While the training of machine learning models was interesting in and of itself, I started to wonder if there might be easier ways to access my model beyond firing off a bunch of commands on the terminal. How could I make my model more accessible, or even mobile-friendly?
Deployment, as I would eventually learn, is the term for what I was pursing, and by golly was it harder than it looks. I hosted both the backend and frontend on separate Heroku apps, which in retrospect was probably not a good idea because Heroku unloads inactive apps from server memory, so the latency is quite high.
Flask
If you stare into the abyss, the abyss stares back at you — Friedrich Nietzsche
The backend scares me. Unlike the frontend, where feedback is almost rude in its immediacy, the backend is eerie in its silence. Luckily for me, Flask makes it almost easy to set up my REST API. The only thing that really tripped me up was the issue with CORS, which caused me a lot of grief as I was trying to test my app locally.
Amazingly, if you deploy your app with Heroku, prefixing your url with a simple “https://cors-anywhere.herokuapp.com/” will do the trick.
Vue.js
Coming from the Techladies Bootcamp where we are building a CRUD app with the PEVN stack, Vue.js was my natural weapon of choice.