Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
TypeScript Microservices
TypeScript Microservices

TypeScript Microservices: Build, deploy, and secure Microservices using TypeScript combined with Node.js

eBook
$27.98 $39.99
Paperback
$48.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

TypeScript Microservices

Gearing up for the Journey

After learning the theory about microservices, we will now move on to hands-on implementation. This chapter will lay the foundation for the journey ahead and will revisit Node.js and TypeScript concepts essential to the book. It will tell you about the trends and adoption rates of both languages. We will go through all the required installations, and we will prepare our development environment. We will test the development environment by implementing the customary Hello World microservice. In this chapter, we will focus on the following topics:

  • Setting up the primary development environment: We will set up a primary environment with all the prerequisites needed. We will understand all aspects required for microservice development.
  • Primer to TypeScript: In this section, we are going to walk through some of the major TypeScript topics that we...

Setting up primary environment

In this section, we will set up our environment required for our journey ahead. You already installed Node.js and TypeScript globally. At the time of writing, the available version of Node.js was 9.2.0 and TypeScript was 2.6.2.

Visual Studio Code (VS Code)

VS Code is one of the best available editors right now for TypeScript. By default, VS Code TypeScript displays warnings on incorrect code, which helps us to write better code. Linters, debugging, build issues, errors, and so on are provided out of the box by VS Code. It has supports for JSDoc, sourcemaps, setting different out-files for files that are generated, hiding derived JavaScript files, and so on. It has support for auto-imports...

Primer to TypeScript

TypeScript originated from shortcomings in JavaScript development with the advent of using JavaScript for large-scale applications. TypeScript introduced a JavaScript compiler with presets of syntactical language extensions, class-based programming, and ways to convert extensions into regular JavaScript. TypeScript became extremely popular as it introduced type safety in JavaScript, which happens to be one of the most flexible languages ever. This enables JavaScript to be a more object-oriented and compile safe language. TypeScript is more of a superset of ES standards, which enables developers to write cleaner, easy-to-refactor, and upgradable code. In this section, we will go through various primary topics of TypeScript, which are essential for our journey ahead. TypeScript is JavaScript with type annotations. TypeScript has a transpiler and type checker...

Primer to Node.js

Node.js has evolved over the years and has now become the go-to technology for anyone who wants to embrace microservices. Node.js was created to solve the massive I/O scaling problem, which when applied to our microservice design will result in a match made in heaven. The package manager for Node.js has more modules than Maven, RubyGems, and NuGet, which can be used directly and save lots of productive hours. Characteristics such as an asynchronous nature, event-driven I/O, and non-blocking mode make it one of the best solutions for creating high-end, efficient performance, real-time applications. When applied to microservices, it will be able to handle an extreme amount of load with low response times and low infrastructure. Let's look at one of the success stories of Node.js and microservices.

PayPal, seeing the trending Node.js, decided to go with Node...

Writing your first Hello World microservice

Let's start by writing our first microservice. Based on the previous topics, we will construct our first microservice with best practices and the widely used node_modules. We will use:

CORS (https://www.npmjs.com/package/cors)

Adds CORS headers, so that cross applications can access it.

Routing Controllers (https://www.npmjs.com/package/routing-controllers)

Beautiful decorators provided in this module, which help us to write our API's and routes easily.

Winston (https://www.npmjs.com/package/winston)

Perfect logging module with many advanced features.

So, open up a Terminal and create one Node project with a default package.json. Follow these steps. The full source code for reference is available in the first-microservice folder in the extracted source:

  1. First of all, we will download the preceding...

Summary

In this chapter, we had a primary introduction to some of the most fundamental concepts of Node.js and TypeScript that are essential for making scalable applications suitable for enterprise needs. We set up our primary environment and learned about Docker, PM2, and NGINX. At the end, we created our traditional Hello World microservice the TypeScript way in Node.js.

In the next chapter, we are going to learn the fundamentals of reactive programming, the advantages of reactive programming, and how you can do reactive programming in Node.js. We will see various operators available in reactive programming, which shorten and streamline our day-to-day development. We will see a combination of traditional SOA-based orchestration and reactive processes, and go through various situations to see which approach fits where.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • • Learn to build message-driven services for effective communication
  • • Design microservices API using Reactive programming design patterns
  • • Deploy, scale and monitor microservices for consistent high performance

Description

In the last few years or so, microservices have achieved the rock star status and right now are one of the most tangible solutions in enterprises to make quick, effective, and scalable applications. The apparent rise of Typescript and long evolution from ES5 to ES6 has seen lots of big companies move to ES6 stack. If you want to learn how to leverage the power of microservices to build robust architecture using reactive programming and Typescript in Node.js, then this book is for you. Typescript Microservices is an end-to-end guide that shows you the implementation of microservices from scratch; right from starting the project to hardening and securing your services. We will begin with a brief introduction to microservices before learning to break your monolith applications into microservices. From here, you will learn reactive programming patterns and how to build APIs for microservices. The next set of topics will take you through the microservice architecture with TypeScript and communication between services. Further, you will learn to test and deploy your TypeScript microservices using the latest tools and implement continuous integration. Finally, you will learn to secure and harden your microservice. By the end of the book, you will be able to build production-ready, scalable, and maintainable microservices using Node.js and Typescript.

Who is this book for?

This book is for JavaScript developers seeking to utilize their Node.js and Typescript skills to build microservices and move away from the monolithic architecture. Prior knowledge of TypeScript and Node.js is assumed.

What you will learn

  • • Get acquainted with the fundamentals behind microservices.
  • • Explore the behavioral changes needed for moving from monolithic to microservices.
  • • Dive into reactive programming, Typescript and Node.js to learn its
  • fundamentals in microservices
  • • Understand and design a service gateway and service registry for your
  • microservices.
  • • Maintain the state of microservice and handle dependencies.
  • • Perfect your microservice with unit testing and Integration testing
  • • Develop a microservice, secure it, deploy it, and then scale it

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : May 30, 2018
Length: 404 pages
Edition : 1st
Language : English
ISBN-13 : 9781788836852
Languages :
Concepts :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : May 30, 2018
Length: 404 pages
Edition : 1st
Language : English
ISBN-13 : 9781788836852
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 158.97
TypeScript Microservices
$48.99
Mastering TypeScript 3
$54.99
Learning TypeScript 2.x
$54.99
Total $ 158.97 Stars icon
Banner background image

Table of Contents

11 Chapters
Debunking Microservices Chevron down icon Chevron up icon
Gearing up for the Journey Chevron down icon Chevron up icon
Exploring Reactive Programming Chevron down icon Chevron up icon
Beginning Your Microservice Journey Chevron down icon Chevron up icon
Understanding API Gateway Chevron down icon Chevron up icon
Service Registry and Discovery Chevron down icon Chevron up icon
Service State and Interservice Communication Chevron down icon Chevron up icon
Testing, Debugging, and Documenting Chevron down icon Chevron up icon
Deployment, Logging, and Monitoring Chevron down icon Chevron up icon
Hardening Your Application Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
(7 Ratings)
5 star 28.6%
4 star 14.3%
3 star 14.3%
2 star 14.3%
1 star 28.6%
Filter icon Filter
Top Reviews

Filter reviews by




Luca Campana May 05, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
A useful guide among the thousand frameworks and tools available today for node and typescript, excellent guidelines for a microservices architecture
Amazon Verified review Amazon
Job Edson Ortiz Zárate Feb 22, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Se requiere conocimientos previos en docker, Microservices, NODEJS, buena guía para poner todos los conceptos paso a paso en un nuevo proyecto de microservicios con NODEJS
Amazon Verified review Amazon
Dave Nov 19, 2018
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
This is a great book technically but suffers from typos e.g. calling javascript Java at one point which was confusing. Another issue is editing for example one section tells us we are about to code then gives us a summary and ends the chapter. Here's another example, from page 223 "...it simply sends the message to any queue or message broker and simply."I've put the full stop in the speach marks because that's how it is in the book.I'd recommend this book, but it's a hard read when every few pages there is a mistake that makes it hard to understand.
Amazon Verified review Amazon
Amazon Customer Aug 24, 2020
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
The first chapter is very informative for those unfamiliar with design patterns, or specifically, these patterns. The examples and instructions for building the sample projects are not clear. It is difficult to follow along with the examples. The author obviously put a lot of work into this book, but the editor took the day off.
Amazon Verified review Amazon
Oracle Apr 22, 2020
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
Pros: Ok compilation of information, for reference.Cons: Bad grammar, reads as though it was not edited or reviewed. Minimal code examples.In summary, if you are looking for information about creating an application written in TypeScript and using microservices, this is not the book for you. You would be better off buying a book about microservices that is language agnostic, then applying what you already know about TypeScript and the microservice features of your chosen framework.--This book provides an ok compilation of information about the structure of a microservice oriented architecture, whilst a lot of information could be found online I find it useful to have all the information in one place that I can easily reference.However, it reads like a first draft that was published without being reviewed by an editor. There are lots of grammatical mistakes, making more than a few concepts difficult to understand unless you reread that section (sometimes not even then) or look them up online.Not to mention, there are frequently random digressions and sections that should have been removed as they don't add to the value of the information. One pertinent example of this is in chapter 4 under "Design aspects involved": "Let's say if I have to cut down a tree (PS: I am a nature lover and I don't support this), instead of directly chopping it down, I would rather first sharpen the axe."Whilst it is admirable that the author doesn't support chopping down a tree, it is completely irrelevant in the context of a book that is supposed to be focusing on providing information succinctly.It is this kind of thing that strongly suggests there was no editor involved.I appreciate that English may not be the authors first language, indeed they do seem to have a good grasp on it, I am not going to dwell on this as I have read things written by native English speakers that are much worse.I think the title is somewhat misleading, although TypeScript/JavaScript and Nodejs are used in the book, it is much more theory focused than code focused. Personally, I think the title should be more along the lines of "Microservices with examples in TypeScript" which even then puts a bit too much emphasis on TypeScript.Really, you could take the information provided and apply it to any language you choose, you would just need to implement the sections on packages/NPM etc, differently according to that language.All that being said, would I have bought the book or recommend it knowing all that? I wouldn't. There are better books that are the around the same price.As it stands, I did buy it, and as I said it provides an ok reference for structuring a microservice application, I have found one or two things useful and it has answered some questions I have had. Which is why I have given it two stars.If it was edited better and contained more examples and more complete examples, instead of scattered snippets, it would be a very good book for architecting microservices with TypeScript.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.