Welcome to Node.js: Part 9 – Summary
August 19, 2014
I hope this series has helped you as much as it has helped me. Aside from the disappointing AngularJS tutorial, I feel I’ve learned great deal about Node.js and its place in the MEAN stack. As this is my final post for MPA, I think it a good idea to recap what I’ve learned, the mistaken assumptions I was forced to un-think, and the steps I took to do it.
Part 0 — LAMP & MEAN
In regards to web development, I really only had a rudimentary introduction to html, css, and Javascript before beginning this project. So it made sense to summarize the past and current industry de rigueur, the LAMP stack. I knew what Linux was, but Apache, MySQL, and server-side scripting languages (php, perl, python, etc) were a mystery. I certainly fell short of an exhaustive study, but it helped my understanding of how and why the modern web works the way it works. Using a database (MySQL) run on a Web server (Apache) and accessed through methods available with dynamic software components (Perl, Python, PHP), a large amount of data can be parsed quickly and precisely, and can be displayed in a useful manner.
Part 1 — Install Node.js
There really are dozens of ways to download and install Node.js. I found even more of them after the Part 1 post. Other than some confusion with what went where during installation, this was probably one of the most straightforward exercises I tackled. Modulus offers many more Node.js tutorials, and I really wish I could have gone through all of them, too.
Part 2 — More on Node.js and MongoDB
This explanation really helped clear up for me the main functions that Node.js performs. The author, Capan, also linked to a related article by Alejandro Hernandez that is also extremely helpful in explaining how the components of the MEAN stack work together. Both of these articles straightened me out on my mistaken assumption that Node and the MEAN stack would completely replace older technologies. Capan writes that:
Node.js is not a silver-bullet new platform that will dominate the web development world. Instead, it’s a platform that fills a particular need.
MongoDB is, for me, conceptually easier to digest. Instead of column/row data arrangements, data are held in “pages”—document objects—using JSON notation, which is much easier to read. When used with other JS-based components, it also helps cut down on the number and complexity of language and logic conversions.
Part 3 — More on Express and AngularJS
I’m glad I took the time to familiarize myself with the idea of frameworks. I hadn’t had hardly any exposure to them before this project. I finally realized the difference between libraries and frameworks. A library is a bit of specific functionality you can inject into a project, and a framework is (cough) a frame of patterns and functions that make sure your project can behave in certain ways. Express and AngularJS both fit the definition of a framework (mostly).
Part 4 — Buecheler’s 1st Tutorial
So I worked my way through the Modulus beginner’s tutorial, and then I found Christopher Buecheler’s wonderful guide. Because I was running on a different system, I ran into a few problems. First off—and this is probably obvious to everyone but me—make sure your using the correct location syntax in your commands. DO NOT COPY/PASTE without understanding what is going where and which system is used in an example. Second: don’t expect the installation process on one system (Windows) to work the same way on a different system (*nix). The MongoDB install on my Ubuntu VM created a running instance of the database, whereas Buecheler indicated that users would need to start an instance. It sounds simple, and it is, but it ran me around in circles trying to figure out what went wrong. I attempted to ignore his instructions in redirecting database manipulations, which worked for some reason, but it cause a lot of problems in the next part when I tried the same shortcut.
Part 5 — Buecheler’s 2nd Tutorial
Running through this second guide was mostly simple. That is, except for the five or six hours I spent trying to figure out the MongoDB daemon running in the background. Once I figured out it needed to be stopped and redirected to the project folder, things became much easier. I learned to constantly check my assumptions.
Part 6 — Extending Buecheler’s Tutorials
It wasn’t until I started summarizing this part that I realized the code was not properly displaying! Sorry about that. It’s been fixed now, thanks to the Crayon plug-in.
For me, this was certainly the most challenging exercise (except, of course, the Angular tutorial that defeated me in Part 7). It taught me a few things I had only ever hear/seen in a classroom.
Christopher Buecheler had led us through two very simple, very helpful exercises that built on each other, and ended them with an invitation to add one more function to the rudimentary site we had set up. I had been introduced to the idea of the Model-View-Controller pattern that is used quite often in app development. I don’t think these exercises explicitly adhered to this pattern, but I recognized similarities in the distinctions between setting up the information the site needs, the bits to be displayed to the user, and wiring them together.
The “wiring” is what remains the most difficult part for me. In trying to figure it out, I found garilla’s adventure through the same exercise. I came up against yet another mistaken assumption: that garilla, having written his instructions at an earlier date, had worked through an earlier version of Buecheler’s guide. This obviously causes issues for anyone trying to work through Buecheler’s current/updated guide. Though I did not delve into the issues of version control and testing, I can only imagine (and now have much greater appreciation for) the need of such things on larger projects when a project this small can offer so many potential hazards to programmers coming at it after its development.
Part 7 — I Read a Whole Lot of AngularJS Documentation
Yep. That’s what I did. I hope to develop this kind of thorough, accessible documentation when I work on large products.
I also hope that any tutorials I design go better than this one…
Part 8 — Crash and Burn on the Angular Phone Catalogue Tutorial, and MEAN.io
I really wish I could have completed this tutorial. I wish I could have started it, too. I never even made it to Step 0. I tried every answer I could find on Google, and even got some tips here in the office, and still no luck. In the process of trying to set it up, the unit and end-to-end testing tools Angular provided never gave me the all clear. I spent two days trying to figure out what went wrong. I tried every answer I could find on Google, and even got some tips here in the office. Alas, I learned only that sometimes you have to move on. Perhaps I’ll one day go back and try again, but I ran out of time.
In any case, we did learn quite a bit about what AngularJS is and why it’s helpful. There’s a reason the folks at MEAN.io included it. Installing MEAN.io proved to be simple enough once I accounted for a few missing components.
FIN
This summer has blurred by. The generally beautiful weather was great, but it was a particular pleasure working here at MPA. I’m grateful for the opportunity to learn about Node.js, and I hope sharing the process helped you.
Post your comment