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
€20.98 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
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

Shipping Address

Billing Address

Shipping Methods
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
Estimated delivery fee Deliver to Ireland

Premium delivery 7 - 10 business days

€23.95
(Includes tracking information)

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 : 9781788830751
Languages :
Concepts :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
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

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Ireland

Premium delivery 7 - 10 business days

€23.95
(Includes tracking information)

Product Details

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

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.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
€189.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
€264.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 120.97
TypeScript Microservices
€36.99
Mastering TypeScript 3
€41.99
Learning TypeScript 2.x
€41.99
Total 120.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

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact [email protected] with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at [email protected] using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on [email protected] with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on [email protected] within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on [email protected] who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on [email protected] within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela