Some hands-on examples, and a couple of important basic architectural principles
For me, it’s always hard to start a new application from scratch.
It’s especially hard when coming from frameworks like Ruby on Rails or Symphony, where you get your initial application structure out of the box.
In the world of TypeScript, we tend to refrain from the idea of sometimes opinionated frameworks. It’s up to us to come up with something great from scratch and it usually takes several iterations to get it right. That’s why I decided to write a small practical guide from my personal experiences on how you can structure your TypeScript Node.js app.
This article will include some hands-on examples, and I will touch on a couple of important basic architectural principles. We are going to use a simplified version of the ports and adapters architecture.
It’s useful if you are already familiar with the following concepts:
I will first introduce the concepts and then go through a hands-on example of how you can apply those while designing your application.
The idea of Ports and Adapters got quite popular over the past decade. It’s a simple but powerful idea on how you can structure your application:
The idea of Ports and Adapters is that the application is central to your system. All the inputs and outputs reach or leave the core of the application through a port. This port isolates the application from external technologies, tools and delivery mechanics. — __https://www.thinktocode.com/2018/07/19/ports-and-adapters-architecture/
Let’s look at a simple use case to understand what this means:
A user would like to print a document.
Let’s forget about the real complexity of the problem for a moment and only look at the essential parts: The first thing we need is a printing device that prints the document. We also need the driver that translates your virtual document into low-level and device-specific messages/commands that your printer can understand.
Multi-paradigm, Functional, Generic, Imperative, Object-Oriented. In this article, I have shared the essential information about TypeScript programming language. This article contains a basic overview, brief history, features and applications of TypeScript. TypeScript is getting more popular in Full-stack development. In terms of popularity, in the last two years TypeScript pulled ahead of Ruby, Shell, and C.
Functional Programming: Exploring the Functor type class and its use cases