Check health of nestjs bull queue with terminus

Loading

Reading Time: 5 minutes Introduction It is common for enterprise applications to connect to external resources to process requests and get back responses. Therefore, application should know that the components it depends on are up and running all the times. Otherwise, the application behaves erroneously when serving client requests. To stay aware of the availability of connected resources, we … Read more

Queue and job processing in nestjs

Loading

Reading Time: 5 minutes Introduction The responsibility of backend application is to handle client requests and return responses back to the client. However, backend performance can degrade when the request is resource intensive; UI thread waits endlessly and user interface is blocked for further user actions. To avoid the unresponsiveness, we can place jobs in queue and delegate the … Read more

Lint files and dependencies in NestJs with unimported

Loading

Reading Time: 5 minutes Introduction When developers maintain a NestJS project, they add and delete codes to the project that some dependencies and files become redundant. When unused files and dependencies are left around, they become technical debts and reduce the code quality. Fortunately, we can use unimported to lint files and dependencies before git commit to avoid pushing … Read more

Create dynamic module made easy in NestJS 9

Loading

Reading Time: 4 minutes Introduction Our technology team builds a lot of Nestjs libraries to reuse in Nestjs applications. Our libraries provide forRoot() to create dynamic module only. Therefore, we cannot call forRootAsync() to register asynchronous module by importing modules and injecting services. Before V9, there are many boilerplate codes to get forRootAsync() to work. Internally, forRootAsync invokes createAsyncProvider … Read more

Functional composition with compose and pipe in lodash/fp

Loading

Reading Time: 3 minutes What is functional composition? Functional composition is the technique of composing multiple functions into a complex function. In Mathematic definition, f(x) and g(x) are functions and h(x) is the composed function of f and g. Functional composition is an efficient technique in processing list data and it is preferred over calling chained array methods to … Read more

Use Karma, Mocha, Chai and Coverage to run headless unit tests and generate lcov code coverage

Loading

Reading Time: 3 minutes Github: https://github.com/railsstudent/image-gallery-native-js 1) Install gulp, mocha, chai, puppeteer, http-server as dev-dependencies yarn add gulp mocha chai puppeteer http-server -D 2) Install all karma dependencies as dev-dependencies. yarn add karma karma-chai karma-mocha karma-chrome-launcher mocha chai -D 3) Create test/bootstrap.karma.js file to share global variables among unit test cases. ‘use strict’; const expect = chai.expect; const assert … Read more

Automate UI testing with Mocha and Puppeteer (Updated)

Loading

Reading Time: 2 minutes Github: https://github.com/railsstudent/image-gallery-native-js 1) yarn add puppeteer mocha chai yarn add puppeteer mocha chai 2) Create bootstrap.js file to share global variables among tests. Expose chai.expect, chai.assert and an instance of browser ‘use strict’; const puppeteer = require(‘puppeteer’); const chai = require(‘chai’); const expect = chai.expect; const globalVariables = { browser: global.browser, expect: global.expect }; // … Read more

Articles I want to read

Loading

Reading Time: < 1 minute Tensorflow https://towardsdatascience.com/how-to-build-a-gesture-controlled-web-based-game-using-tensorflow-object-detection-api-587fb7e0f907 Ngrx https://medium.com/@bo.vandersteene/advanced-pagination-with-ngrx-store-and-angular-5-f26ca4761cef https://medium.com/@vlado.tesanovic/handling-keyboard-shortcuts-in-angular-with-redux-ngrx-c88907f17ca8 Angular https://blog.angularindepth.com/angular-ivy-change-detection-execution-are-you-prepared-ab68d4231f2c https://medium.com/frontend-coach/self-or-optional-host-the-visual-guide-to-angular-di-decorators-73fbbb5c8658 https://medium.com/@davidibl/advanced-reusable-custom-angular-validator-9ca5febef583 https://malcoded.com/posts/web-assembly-angular?utm_source=mybridge&utm_medium=blog&utm_campaign=read_more JS Using trampolines to manage large recursive loops in JavaScript React Native https://medium.freecodecamp.org/after-building-my-first-react-native-app-im-now-convinced-it-s-the-future-d3c5e74f8fa8