How I learned a lot from deploying an app that does nothing
Tags: webdev, showdev, codenewbie
Published: 2020-05-08 07:33:43

I did it! Frontend, backend, database, deployment. It was all me!

![app_screenshot](https://dev-to-uploads.s3.amazonaws.com/i/vnec0rgig27wzdjb1jz6.png)

...aaaand it's empty.

Today I want to share my journey on a personal project with a huge disclaimer that it's not exciting nor groundbreaking. My intention was not to please anybody with this project, but what I truly wanted when the idea came to me was just to create a password-free authentication stack then deploy. It's that simple. Or so I thought.

## Quick backstory...

Hello! I've been on DEV for just less than a month but I already consider it my new Twitter. Not that my DEV feed is filled with sarcastic comments or witty retorts (which my Twitter unfortunately became), but what I enjoy is the streamlined feed of user-created tutorials intertwined with their own personal stories. Dreading to open Twitter just to quench my thirst for 'social life', DEV quickly transformed from a mere alternative to my go-to medium for online interaction.

As a young developer, it's exciting to dabble in the newest and hippest technologies. Jumping on the ReactJS bandwagon when I was just starting out a little more than 2 years ago, the concept of reactive components and seeing your page automagically update without refreshing was apple to my eyes. About a year after, my radar picked up VueJS. It steadily gained its reputation for having a flatter learning curve than React. Decided to try it out and much to my suprise, Vue components proved to be easily digestible. Without hesitation, I turned my back on React and picked up this young, shining, Vuetiful framework.

![distracted_boyfriend](https://dev-to-uploads.s3.amazonaws.com/i/k8rbrshq3yfqykl0d5v0.jpg)

## Anyway, the app

About a week ago I was laying on my bed getting ready to sleep when the idea came to me: create a template to bootstrap my process and do the heavy lifting every time I want to create a new web app. In other words, a boilerplate. If I do it right, I will effectively skip several forks-in-the-road such as choosing a frontend framework and a corresponding CSS library, what language to code the server in, which database to use, and what authentication method to implement. If I do it wrong, we'll, at least I'll learn.

## Action-first mindset

![procrastination](https://dev-to-uploads.s3.amazonaws.com/i/xbtij7oc4g5w0p4pcje9.gif)

When learning something for the first time, my manager used to say "first, make it work, then understand it later." This mindset is perfect for lazy people like me who digress from crafting attack strategies and making burndown charts. Just do it! What could go wrong! Break things but only just before reaching the point of no return. Break things then fix them.

So I took it upon myself to learn the basic devops workflow. No more procrastinating by reading one tutorial after another.

One of my favorite productivity YouTubers [said](https://youtu.be/lSXbNQV2UTQ) "...with an action-first mindset, you're going to get burned. But the lessons you get by getting burned are the ones you remember." After several days of getting entrapped by the vicious cycle of installing packages, learning how to use them, breaking a previously installed dependency, and copy-pasting stackoverflow answers, I was able to duct-tape the following technologies together:

||Technologies I learned|notes|
|:---|:---|:---|
|Frontend|NuxtJS, Vuetify, Vuex|The trickiest part was binding the port in the host machine's IP.<br>Also, Vuetify is magical :fireworks:|
|Backend|ExpressJS, NodeJS|Created public and protected RESTful APIs|
|Authentication|JWT, OTP|JWT was pretty straight forward: generate a token from a secret + the given email, then saving in the browser storage and/or cookies was automatically handled by Nuxt. Had to use a simple random string generator for the OTP|
|Database|MongoDB|First time to use MongoDB, let alone a NoSQL db|
|Caching service|Redis|Storing OTPs for a certain duration|
|operations|Docker|Learned how to build my app into an image and peform proper tagging. Push it to Docker Hub for later use in a cloud VM|
|deployment|AWS|Provisioning an AWS Lightsail instance and create a startup script. Also, deploying in GKE incurred about $5 for just one night. True story!|

![system_diagram](https://dev-to-uploads.s3.amazonaws.com/i/4a645ocu0dbp8g0fr5ol.png)

I'll spare you the implementation choices because they're all personal and highly opinionated. What I'm excited to share is that I was able to put everything together! Definitely still a newbie in this industry, but there's not a single strand of doubt in my mind that I leveled up! Sure, if we take a deep dive into the code, it's still rough on the edges. But hey, how many people can say they deployed their code on the public internet? :wink:

If you're still reading and want to check it out, visit the [app here](http://3.1.243.203/) and the [code here](https://github.com/reiallenramos/nuxtjs-otp-boilerplate). Please be gentle, the VM I provisioned only has 512MB RAM :laughing:.

What do you think? Did I achieve my goal of creating a password-free authentication? I'd be delighted to hear your thoughts.

Thanks for reading!