Timestamp Microservice Retrospective


The timestamp microservice project is a Node/Express app that takes either a human-readable date or a unix datetime and converts it to the other. This was my first project using Node and Express, so there was a lot to learn for this fairly simple application. This was also the first time I had used Heroku to host an application so there was some setup required so that I could easily push my changes to the Heroku server using git push heroku master.

To get my feet wet with Node and Express, I took the Server-side Development with NodeJS course on Coursera and strongly recommend it. It covers Node, Express, MongoDB, and Mongoose, so you can use it to learn everything you might need for the M, E, and N parts of the MEAN stack.

Code Review

I had three different sets of problems while working on this project. The first set of problems was that I was setup to this point doing very little with git. So I had to wrestle with git and learning how to create and update projects using git on the command line. I'm glad that I was forced to do this because it's made my life since then so much easier. That said, I still think git is unintuitive and unnecessarily complex. Perhaps, as I learn more of I will see why it does things the way it does. I still have lots to learn with git.

The second set of problems was just learning how to set up an Express app and get it working. There are a lot of app.use() lines that don't make a lot of sense to a beginner. I also wish that when I created an Express app it wouldn't assume that I want to use some sort of templating language. For each of my Express apps I had to go in after creating it and delete all the Jade files and set my app to use standard HTML. There must be some command in the CLI to do that upfront, I just don't know what it is.

The third set of problems was just working with time in JavaScript. It's surprising how something so ubiquitous and so seemingly simply can be so difficult to work with. I ended up using the MomentJS npm package to utilize some built-in methods for handling time and for checking that the user passed in a valid time.

Future Improvements

As far as improvements go, I don't think I will rewrite any of these first stabs at Node/Express apps. I view them as much more learning experiences rather than applications that should be maintained. That said, I'm happy to have done them and gotten my first steps into the scary back-end!