About three years ago, Ruby on Rails was all the rage. In order to familiarize myself with it, I took the step of converting this website to Ruby on Rails. It was previously implemented in ASP.NET. I was frankly unimpressed with Rails. The Ruby language was nothing special, and I found the integration between the Rails commands and the database to be annoying, rather than helpful.
Recently I got an email from Google announcing the imminent deprecation of their old captcha API. But I could not force myself to even find an updated captcha gem and get it working. Now the excitement that was formerly focused on Ruby on Rails has largely shifted to Node.js. So I decided to "kick the tires" of Node.js, by again converting the website.
As of about a week ago, this website is powered by Node.js. I'm using the Express web framework, and a mysql database. I'm using the WebStorm development environment. Many Node.js developers are using MongoDB but, my data was already in mysql, and I know SQL pretty well. The website is hosted by A2 Hosting. A2 does a pretty good job, and at least for now, I am getting very good performance and support, especially considering the small price that they charge. I'm on the "Swift" hosting plan, in case you're curious.
Here are the major components that were used in this website's Node.js / Express incarnation:
Component | Used For |
---|---|
forever | By default, your Node.js app will stop right after the first uncaught exception occurs. In this situation, forever will quickly restart my web application. |
passport, passport-local | Passport provides user authentication for my "admin" user, who has access to ericbt.com's administrative functions. |
ejs, ejs-locals | Express allows one to use whatever template engine one wants. I started out with Handlebars and abandoned it after I realized that the template language was too limited for my purposes. It can be tedious inserting Javascript code inside of ejs templates, but at least the Javascript programming language is sufficiently powerful to handle basic content formatting issues. ejs-locals provide layouts, which are useful for imposing a standard look-and-feel on multiple pages. |
emailjs | I use emailjs to generate email notifications to me. (This website does not send emails to anyone else). |
formidable | Parsing form data for image uploads |
morgan | HTTP Request Logging |
log4js | Logging |
mysql | Database queries |
async | When I implemented pages that required multiple data items, I found myself writing deeply nested code that didn't exploit concurrency opportunities. async allowed me to replace my code with more elegant, readable, and efficient code. |
fs-extra | File manipulation |
line-reader | Log file filtering |
pretty-data | XML pretty-printing |
bootstrap | HTML styling, navigation bar, pagination, image styling, "glyphicons" |
yuicompressor, html-minifier | Minification of CSS, Javascript, and HTML content |
compression | Gzip compression of website content |
Google reCAPTCHA service | .Reducing nuisance data posted to public forms. |
heapdump | Memory leak troubleshooting |
I was really surprised by two things during this conversion effort:
Surprise #1 was due to the fact that Node.js and Express don't get in the say of rapid development. It is a real pleasure to implement a new page, or new feature, in minutes rather than hours.
As for surprise #2, I've never been a big fan of Javascript, but I suppose taking a class previously in the Scala programming language made me more receptive to the functional aspects of Javascript. And WebStorm caught many of my Javascript errors before runtime, offered usable "intellisense", and a good debugger for finding and fixing issues that made it all the way to runtime.
Take a little time each day to play, even if it's just with new software development technologies.
Title | Date |
.NET Public-Key (Asymmetric) Cryptography Demo | July 20, 2025 |
Raspberry Pi 3B+ Photo Frame | June 17, 2025 |
EBTCalc (Android) Version 1.53 is now available | May 19, 2024 |
Vault 3 Security Enhancements | October 24, 2023 |
Vault 3 is now available for Apple OSX M2 Mac Computers! | September 18, 2023 |
Vault (for Desktop) Version 0.77 Released | March 26, 2023 |
EBTCalc (Android) Version 1.44 is now available | October 12, 2021 |