Let’s Learn Deployment with Firebase and Heroku Today

Joshycsm
2 min readJun 7, 2020

Deploying with Firebase and Heroku doesn’t have to be so difficult. Once you get it to work once, it only gets easier, and well… maybe harder, but then, it gets easier once more.

Heroku | Firebase

Currently, I’ve learned and thus recommend deploying your frontend code base with Firebase. I’d recommend deploying your backend code base with Heroku.

Firebase works well for static sites (i.e. HTML and JavaScript remain static things while handling these files). Heroku works well for dynamic sites (i.e. databases or being an API).

Heroku truly appears to be much more server-side friendly.

Heroku also seems to have add-ons that work well with various database technologies such as MySQL, PostgreSQL, and MongoDB.

It’s great that when using Heroku, data is stored separately. This can allow the ability to perform backend and frontend tasks independently.

It’s possible to consider Heroku as more expensive but offering more functionality when compared to Firebase in certain aspects. If you’re able to take advantage of the extra functionality Heroku has to offer, it can definitely be worth it.

If you’re interested in learning more specifics about the differences between Heroku and Firebase, tons of search results pop up with a quick Google search.

Here is a quick run through attempt if you’d like to try and follow along to deploy with Firebase (hold off on this if these lines of code in terminal look confusing):

271  mkdir 1stfirebase
272 cd 1stfirebase/
273 ls
274 touch firstFirebase.html
275 ls
276 code .
277 npm install -g firebase-tools
278 ls
279 cd ..
280 ls
281 cd 1stfirebase/
282 ls
283 firebase login
284 firebase init
285 firebase deploy -m "deploying"
286 cd ..
287 ls

Here is a quick run through attempt if you’d like to try and follow along to deploy with Heroku (hold off on this if these lines of code in terminal look confusing):

288  rails new first_heroku --api -d=postgresql
289 ls
290 cd first_heroku/
291 rails g scaffold Snowflake shape
292 code .
293 git remote add origin git@github.com:joshycsm/first_heroku.git
294 git add .
295 git push -u origin master
296 git commit -m "first commit"
297 git push -u origin master
298 brew tap heroku/brew && brew install heroku
299 heroku login
300 heroku git:remote -a first-heroku-joshycsm
301 git remote -v
302 git status
303 git push heroku master
304 heroku run rails db:migrate
305 heroku run rails db:seed
306 rails db:{create,migrate}
307 rails db:seed
308 rails c
309 lite-server

With practice, learning the art of deployment can become much easier to achieve.

--

--