How to easily bootstrap a side-project on the cloud

Written by tommycarpi | Published 2018/07/03
Tech Story Tags: side-project | firebase | entrepreneurship | web-development | bootstrap

TLDRvia the TL;DR App

Side-Project

Job hunting is really hard nowadays, mostly because job offers are distributed across job boards, aggregators and companies career pages. So I decided to create Job Buddy , a web app that tracks all your digital job applications. You can either use the chrome extension or simply paste the url of the job description in Job Buddy to save it.In this way you can manage from a single admin page all the career opportunities you are interested in.

In this post I wanted to share the tech stack behind Job Buddy to show that you can quickly bootstrap a complete Web App at almost 0 cost. I developed Job Buddy really fast, spending just 18,5€:

  • 14€ for the jobbuddy.app domain from Google Domains
  • 4,5€ for the Chrome Web Store subscription

Stack

Job Buddy is almost entirely deployed on top of Google Cloud platform, since they offer a complete suite of products with a “generous” (mmmh) free plan. I had to create 3 different products:

so I decided to go with ReactJS for the Web App and the Chrome Extension and NodeJS for the Backend, to have minimum context switch while developing.

Database

Then I had to pick a database because I needed to save the job offers for each registered users. Maintaining a database is a huge pain, especially if you are a not database guru (I’m not). You need to setup and manage your instances (redundancy, availability, backups … do they ring a bell?), or you can go with cloud solutions (like Mongodb Atlas), but they can be costly for a side-project. So I decided to go with Firebase.Firestore, a service of the Firebase suite which offers a flexible and scalable database on the cloud with a “fair” (again, fair?) free plan. It is a document-based solution (NO-SQL) and can be tricky to get right at the beginning, but the trade off is that you have no hassle; Firestore has you covered for almost anything. Therefore, even if it’s still in Beta and has its flaws, it was more than perfect for my use case.

Authentication

One last delicate missing part was authentication, I wanted users to sign in/up to the service, but building an auth system from scratch was not (and probably will never be) an option. Luckily the Firebase suite offers Firebase.Authentication, which is basically a few-lines code implementation for a robust auth system, supporting a long list of providers.The best part of Authentication (imho) is that they automagically handle email confirmation and password reset, which are a must have, but a pain to develop. Let’s be honest, everything which is not a “core feature” and takes you more than 15 min to develop is just a pain in the a**.

So, here is the stack of Job Buddy:

  • Web App — Built with ReactJS
  • Backend — Built with NodeJS
  • Chrome Extension — Built with ReactJS
  • Database — Built with Firebase.Firestore

Job Buddy flow

Hosting — Web App

The database is done, handled by Firebase, and the Chrome Extension done too, being managed by the Chrome Web Store. I just needed to figure out where to put the Web App and the Backend, possibly for free.Exploring other Firebase services I discovered Firebase.Hosting, it basically hosts your web app with a free 1GB storage and 10GB/month of data transfer, plus Custom domain & SSL support. 10GB/month is not that much (really), but it’s a good start, especially if all you have to do is

yarn build && firebase deploy

from your local repository. Amazing. Note (also to myself): In the first day of launch Job Buddy burned almost 1GB of transfer data, at this pace in 9 days I’ll have to open my wallet! So be careful with all these “free” plans.

I now had a randomised url web app on the internet, so I needed a domain name. I checked both Namecheap and Google Domains: the first one is probably cheaper (don’t know if it has “hidden costs”), but I wanted to stick with Google. I bought jobbuddy.app for 14€ and in 1h I could reach https://jobbuddy.app (note the httpS part), all you have to do is to follow the instructions given in the Firebase.Hosting console.Web App done, time for the backend.

Hosting — Backend

While I was in this Google services killing spree, I decided to look into Google Cloud Functions. It’s similar to AWS Lambda, it basically hosts a NodeJS app that responds to http events, so you are billed for the “actual” (always be careful) usage of the service, if no one uses your app you pay 0. Furthermore they offer a free plan with a 300$ (fair enough) gift cards when you sign up.The service is still in beta and has flaws, for example it’s kinda slow on the first invocation after sleep (do you need a warm up?) and it only supports Node v6 at the time of writing, so I had to convert some part of the code to be compliant. Anyway it seemed a good fit for Job Buddy, I used the console to create the function: you simply zip the NodeJS code (be careful to zip the content of your git repository, not the folder of the repository!) and upload it in the web interface (there is also a CLI available to do this programmatically). At the end you are given an endpoint to invoke the function with a simple http request.

The backend is done too, Job Buddy is now live at https://jobbuddy.app. It’s automatically scalable and fast, I don’t have to worry about anything (except costs).Here is Job Buddy

Job Buddy

Cloudflare

After talking with some IndieHackers, I discovered that, in order to reduce costs, you can put Cloudflare in front of Firebase.Hosting. It handles SSL for free and it’s really good for caching, in this way you will reduce the interactions with Firebase.Hosting, saving money.The setup is fast and straightforward and I got JobBuddy up and running in around 5 to 10 minutes.I’ll see in the next weeks what the Cloudflare.Analytics shows, but it looks promising.

Cloudflare console

Conclusions

If you are starting to develop a fantastic side-project and wish to deploy it somewhere on the internet, possibly at 0 cost, you can copycat the stack of Job Buddy.

  • Web App — ReactJS — hosted on Firebase.Hosting
  • Backend — NodeJS — hosted on Google Cloud Functions
  • Chrome Extension — ReactJS — hosted on Chrome Web Store
  • Database — Firebase.Firestore — hosted on Firebase
  • CDN — Cloudflare

The only costs I sustained were 18,5€:

  • 14€ for the jobbuddy.app domain from Google Domains
  • 4,5€ for the Chrome Web Store subscription

I’m not saying this IS the best approach, this is simply the one that I used. There could be many more solutions out there better than this one :DFeel free to leave comments, feedbacks or suggestions on how to improve this.


Published by HackerNoon on 2018/07/03