In this post, I will be introducing three strategies that can help Node developers who wish to loosen their code. First, we’ll cover microservices with Moleculer. Then, we’ll through Inversion of Control with InversifyJS. Finally, we’ll discuss N-Tier Architecture and why it’s helpful.
If you’ve been writing code for a significant amount of time, you’re sure to have seen the—anything but godly—“God Method.” It’s a method that performs way too many processes in the system and has grown beyond all realistic logic to become “The Method That Does Everything.”
This single unsightly method can span dozens, if not hundreds, of lines. Sometimes even over 1,000! This type of “ugly code” is an unbearable beast to maintain. This is why it’s considered a “code smell” or anti-pattern.
Earlier this year I blogged about creating a Lean Mean Vue Machine called Quotes on Demand. The application was a fully featured CRUD application served from a NodeJS server and had a self contained VueJS front end.
But wouldn’t it be a nice test to see if that same Vue application could switch over to another API, say something like a Python web server powered by Flask?
In this post, we will create a Python web application that will have 100% parity to an existing NodeJS web application. This will enable an existing VueJS front end to connect to the application with no additional code changes in the user interface code.
Part of the Solid Foundations Learning Series
Throughout this series, we have touched on adding navigation, content and single-page applications, but we haven’t touched on the security of the application yet.
In this article, we’re going to add a simple security model to the application which will accept a login, validate a user, redirect to a secure page, enable a logout, and catch any errors which occur during the process. Let’s get started.
In my previous blog post, I showed running a Spring Boot Java application in AWS Lambda. I discussed the pros and cons of using Java and Spring with Lambda. In this blog post, I’ll cover another Lambda option with NestJS. NestJS provides a framework that is not too different from a typical Spring application. It also addresses some of the negatives of using Java and Spring in a Lambda function.
To recap, AWS Lambda provides low cost compute with zero maintenance. Lambda runs your code on demand, without provisioned and managed servers. Lambda automatically runs and scales your code. You are charged for every 100ms your code executes and the number of times your code is triggered. Lambda has clear cost and maintenance benefits over typical on-premise or EC2 deployments. What does it take to run a Nest application as a Lambda? Does NestJS provide benefits over a Java Spring application?