Mandatory Algorithms for Coding Interview
Basic algorithms that you must know if you want to crack your coding interview. In case you are starting to prepare for coding practice then make sure you...
Do you have a lot of JavaScript projects using GitHub repositories? How are you managing dependencies among those projects? Developers might be struggling to manage a large set of GitHub repositories and Business might be spending a lot of money to manage them. The potential solution to this problem is Monorepo. You can put all of your JavaScript projects regardless of framework (angular, vue.js, react.js) in a single GitHub repository called monorepo. This will solve the problem and you will not have many Git projects. However, nothing is free! So there are many challenges with monorepo that developers are facing. I will explain all of the challenges and show you how you can solve them. Also I will create monorepo from scratch in this article using angular projects as samples.
Single Git Repository holds source code of multiple applications and libraries.
Monorepo in organization helps you to get below benefits:
If you have already developed couple of JavaScript projects then you are good to go and learn Monorepo. For this article if you have basic knowledge of Angular then it will be good since I will create angular projects in example monorepo.
Here is the Nx npm package that you can use from npm. For this article I will demonstrate code that is hosted in github at below location:
Challenges are how to identify which application depends on how many projects? How to constrain dependency so that it reduces cyclic dependency issues and organizes code structure? How to only compile the project which has only changed? How to only run tests for the changed projects? How to increase tooling speed for a large set of projects in a single monorepo? How to manage versions? All of these are very important requirements. Nx.Nrwl monorepo framework is an excellent framework to manage any number of JavaScript projects in just one GitHub Repo. With Nx.Nrwl Monorepo you get facility to visualize which project depends on others. All of the challenges that I mentioned could be resolved by Nx Monorepo. Stay tuned and read this article till the end to create your angular monorepo from scratch using the Nx Monorepo framework.
You could have your own policy as per your organization’s need to manage parallel development, release, fix, development, merging, major release, maintenance related work. However, I am suggesting one option. Let’s see if that makes sense to you.
Create a branch for release number. Example releases/11.0 treat this branch as active working branch. You can treat this as your dev branch.

For adding new feature or working on some new PBI or usecase. Create a features folder and put PBI number as new branch in features folder work on development and merge them in to release branch.
Example: features/PBI123/appendOrder
In order to do major release create a new branch 11.1 as major release branch. And if you want to apply fix on 11.1 then create another branch 11.1.1 work on fixes and merge them back to release branch 11.0 for future release.

In this article, I will walk you through the steps to create one nx monorepo workspace with Angular application and libraries from empty preset.
Hey developer, make sure you have node.js installed which is greater than V10. I have installed node.js v14.
I am using Vs Code and installed nx console extension to get inbuilt way of creating apps/libs from nx console only.
Install below VsCode extensions for better development experience:
Azure Pipelines for validations of yml file

Below are optional but recommended extensions
FixMe Comments
FIXME: Comments are some things that you are planning to fix within the current sprint.
Example: Fixing Api Service to call Server Web API within this sprint only.
Stories having FIXME are alarming for you. Make sure all FIXME’s are addressed before marking stories are done. 📓 Notice: Once you fix the code then remove the comment 😄

Todo Comments
TODO: comments are something that you are planning to work on future sprints.
Example: Working on MCQ API Service to call server side API that has to be done on future sprint.

Check all todo comments CTRL + SHIFT + P

If you want to get the custom icons for your files then make sure you have installed VSCode Materials and copy below settings and paste in your local VSCode settings.json file located at %appdata%\Code\User\settings.json
"material-icon-theme.folders.associations": {
"itops": "Vm",
"presentation":"Views",
"aggregate-score":"Sublime",
"aspects": "Apollo",
"contracts": "Scala",
"message-handlers": "Serverless",
"base": "core",
"branding": "Shared",
"main": "Stack",
"composition": "include",
"modules": "Cluster",
"partials": "Mock",
"filters": "Terraform",
"sharedviews": "Svelte",
"dashboard": "Gulp",
"ui-core": "Review",
"dev": "Intellij",
"ngmaterial": "Theme",
"ckeditor5": "Mobile",
"launch": "Docker",
"editor": "Custom",
"toolbar": "Tools",
"pubsub": "Event",
"message-handler": "Delta",
"api-composition": "Mock",
"dto": "Gradle",
"interfaces": "Animation",
"global-error-handler":"Error",
"root":"Svg"
},
"material-icon-theme.files.associations": {
"*.state.ts": "Silverstripe",
"*.dto.ts": "Gradle",
"*.module.ts": "Racket",
"*.routing.module.ts": "R",
"*.store.ts": "Storybook",
"*.tests.ts": "Test-ts",
"*.controller.ts": "Angular-component",
"*.enum.ts": "Jinja",
"*.service.ts": "Quasar",
"*.model.ts": "Shaderlab",
"*.viewmodel.ts": "Pug",
"*.command.ts": "Email",
"*.event.ts": "Stencil",
"*.ts":"Idris"
},
You will get below icons once updating settings file.

When you create nx monorepo with Angular or React or Next.js or Gatsby or next.js or Web Components then it will give you JEST as unit test runner. In case you want to get karma test runner then you have to create Empty workspace and then add @nrwl/angular then add new application or lib with karma unit test runner.
In order to create your first Nx Monorepo workspace run below script:
npx create-nx-workspace@latest
myorg

It will create the workspace with angular app that we defined.

When you will use their template they will add end to end test for application. They will also add jest test runner.

In my workspace, I do not want Jest and I do not want e2e tests. So I am creating my workspace with empty preset next.
Run npx create-nx-workspace@latest
Give organization name: curise
Select angular application for the workspace. angular
This will install @nrwl/angular plugin to give you tools to create angular lib and apps.



Run the script:


Run nx build

Showing dist folder.

After creating empty workspace.
Benefits of Empty Workspace
karma unit test runnerworkspace.json to configure any apps and libs.Disadvantages of empty workspace:
Nx CLI
Regardless of empty or pre-populated workspace you must create your own CI/CD Pipelines and Nx commands for your pipelines.
Now we will create our monorepo workslpace that we will continue using it. We will start from scratch empty monorepo.
Creating empty Nx Monorepo workspace is our final option for this example. So let’s create desired working folder and from that location open powershell on windows machine I found working on git bash commands were not working nicely.
Run below script to create empty workspace
npx create-nx-workspace@latest --preset=empty
Above script will ask you

Notice it created the workspace

So Now I get empty app and library folders.

This is my dependencies that I get in package.json

Nx CLI commands will invoke Angular CLI. The Nx CLI simply does some optimizations before invoking the Angular CLI. Nx Cli can execute all of the ng cli commands. The benefit you get with Nx CLI is Computation Caching which gives faster execution of tasks. Also Nx CLI is technology agnostic You can use Nx CLI to run angular, react, JavaScript or any project scripts.
So it gives uniformity in your team to always run Nx CLI in your workspace regardless of any front-end technology you are using..
In order to point ng cli to Nx CLI we have to run decorate-angular-cli.js file. Because of symlinking you can still type ng build or ng test or ng lint in the terminal. The ng command, in this case, will point to nx, which will perform optimizations before invoking ng.
After install we can execute this decorator file.
"postinstall": "node ./decorate-angular-cli.js && ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points",
Although I don’t recommend this option ![]()
However, in case you want to opt out of NX CLI then follow below steps:
We are not doing this though.
"scripts": {
"nx": "nx",
"start": "nx serve",
"build": "nx build",
"test": "nx test",
"lint": "nx workspace-lint && nx lint",
"e2e": "nx e2e",
"affected:apps": "nx affected:apps",
"affected:libs": "nx affected:libs",
"affected:build": "nx affected:build",
"affected:e2e": "nx affected:e2e",
"affected:test": "nx affected:test",
"affected:lint": "nx affected:lint",
"affected:dep-graph": "nx affected:dep-graph",
"affected": "nx affected",
"format": "nx format:write",
"format:write": "nx format:write",
"format:check": "nx format:check",
"update": "nx migrate latest",
"workspace-generator": "nx workspace-generator",
"dep-graph": "nx dep-graph",
"help": "nx help"
},
I will use nx console to create application.
Since I want to create Angular applications and libraries I need @nrwl/angular node package to be
installed.
please run below script to install @nrwl/angular
npm i -D @nrwl/angular

Select Nx, then select generate and then select Angular Library.

Fill out the required fields. I want to create logger angular library under lib/branding folder with karma testing framework.

This is my dry run result

Logger project is created successfully.

Currently there is no way you can stop dry run therefore, use the script to create application or lib.
nx generate @nrwl/angular:library --name=utils --directory=branding --importPath=@myor/branding-utils --prefix=myorg-branding-utils --tags=scope:branding,type:branding-utils --no-interactive --dry-run
NX Monorepo only support JEST or NONE unit test runner for Javascript project.
nx generate @nrwl/workspace:library --name=ckeditor5 --directory=branding --importPath=@myorg/branding-ckeditor5 --prefix=myorg-branding-ckeditor5 --tags=scope:branding,type:branding-ckeditor5 --no-interactive --js --unitTestRunner=none --dry-run
Nx Run Command helps to create custom commands

Target Name : Bane of the target like build
Project Name : is the name of the project in the workspace.json file : branding-ckeditor
Command: npm run build
cwd location of the src folder of the project
outputs where the build artifacts will be stored.

nx generate @nrwl/workspace:run-commands --name=build --command='npm run build' --project=branding-ckeditor5 --cwd=libs/branding/ckeditor5/src --outputs=libs/branding/ckeditor5 --no-interactive --dry-run
This will update the workspace.json and nx.json

Now you can run nx build branding-ckeditor5
Let’s select an angular application this time to create cutepuppies-admin apps.

Name: cutepuppies-admin

e2eTestRunner: none ( I don’t want this test )

Routing: Generates a routing module select this.

Tags: scope:itops,type:itops-cutepuppies-admin
Unit Test Runner: Karma

Click on the Run button and finally select SASS while it is asking for which style format.
See my app is created

Let’s create a loggingService inside our logger project.
Use Nx Console to create angular service.

This is dry run result of angular service creation

Fill out the form add below information

Name: logging
project: branding-logger
Notice Logger service created

Lets run the test and see if the test is passing or not. Since I am using main branch instead of master branch I will update my scripts to take base as main branch only.

Since only logging service is added if I run the test only one project test will run.
Run npm run affected:test

Next lest run the build

npm run affected:build

Notice the app is building and the dist folder is created with one app.

Now let’s use a logging service to log something and run our application next.
Go to libs/branding/logger/src/index.ts and export the logger service.

Next go to apps\cutepuppies-admin\src\app\app.component.ts and add logging service and log in constructor.

Lets serve our application run below script
nx serve cutepuppies-admin

Navigate to http://localhost:4200 and see in console log hello world is coming.

Now lets build the application again and go to the dist folder and run below script from dist folder
cd dist/apps/cutepuppies-admin && npx http-server -o
Notice our app is running and I see the log as well.

Creating Cute Puppies Client

Created Sales/PuppyEditor

Creating sales/puppies









Adding sales puppies route to client app.

Adding puppy editor route in admin app


Declaring Module: libs/sales/puppy-editor/src/lib/sales-puppy-editor.module.ts




Check Dry Run result and confirm

and select Run

Component Created

Component is good




To get the path of the component copy the relative path of lib folder of sales/puppies /libs/sales/puppies/src/lib




Select Run to create component

Lets update the routing for puppies
Add route for add puppy in puppy editor

Add route in admin app: add below route to navigate to puppy editor default component

Add route in client app: add below route to navigate to puppies module’s default component.

Lets add scripts to serve both admin and client app
"start-admin":"nx serve cutepuppies-admin --port=4210 -o",
"start-client":"nx serve cutepuppies-client --port=4211 -o",

Lets clean app component HTML

Lets run the admin app npm run start-admin

Admin Site is up and running http://localhost:4210/puppies-editor

app component

Run npm run start-client

Client site is running : http://localhost:4211/puppies

Apps
Libs
Run nx dep-graph --base=main

Install yaml visual studio extension

Install Azure Pipelines for validations of yml file

We will install node modules and cache it so that for future build it will read from the cache location. If package-lock.json is changed it will refresh the cache.
We are going to use Restores and saves pipeline artifacts with Universal Packages to cache the ci pipelines. So Install the Task in your azure devops from marketplace.
Restores and saves pipeline artifacts with Universal Packages

Since we are use pipeline cache, we need to create Artifacts Feed in Azure devops to store the node_modules folders. Learn more about Artifacts Feed
Artifacts Feeds are organizational constructs that allow you to store, manage, and group your packages and control who to share it with. Feeds are not package-type dependent. You can store all the following package types in a single feed: npm, NuGet, Maven, Python, and Universal packages.
Follow steps to create build definition
Then go to project and create install-node-module.yml file:

steps:
- task: NodeTool@0
inputs:
versionSpec: '14.x'
displayName: 'Install Node.js'
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreAndSaveCacheV1.RestoreAndSaveCache@1
inputs:
keyfile: '**/package-lock.json, !**/node_modules/**/package-lock.json, !**/.*/**/package-lock.json'
targetfolder: '$(Build.SourcesDirectory)/node_modules'
vstsFeed: 'nx_azure_node_modules_cache_feed'
- script: |
npm ci --ignore-engines
displayName: Install dependencies only if there is no cache available
condition: ne(variables['CacheRestored'], 'true')

/**
* # Generate Ci command
* 1. It will identify the affected projects
* 2. Group the projects in 3 groups for each command.
* ## Example:
* If 3 projects are affected it will create below group for lint, test and build command
* lint1:[admin], lint2:[logger], lint3:[client]
* build1:[admin], build2:[logger], build3:[client]( if you made buildable for each projects)
* test1:[admin], test2:[logger], test3:[client]( if you have tests for each projects)
* If 4 projects are affected it will create below group for lint, test and build command
* lint1:[admin,ngmaterial], lint2:[logger], lint3:[client]
* build1:[admin,ngmaterial], build2:[logger], build3:[client]( if you made buildable for each projects)
* test1:[admin,ngmaterial], test2:[logger], test3:[client] ( if you have tests for each projects)
*/
const execSync = require('child_process').execSync;
const isMaster = process.argv[2] === 'False';
const baseSha = isMaster ? 'origin/main~1' : 'origin/main';
console.log(
JSON.stringify({
...commands('lint'),
...commands('test'),
...commands('build'),
})
);
function commands(target) {
const array = JSON.parse(
execSync(`npx nx print-affected --base=${baseSha} --target=${target}`)
.toString()
.trim()
).tasks.map((t) => t.target.project);
array.sort(() => 0.5 - Math.random());
const third = Math.floor(array.length / 3);
const a1 = array.slice(0, third);
const a2 = array.slice(third, third * 2);
const a3 = array.slice(third * 2);
return {
[target + '1']: a1,
[target + '2']: a2,
[target + '3']: a3,
};
}

trigger:
- main # Trigger CI automatically whenever main branch is changed
jobs:
- job: initial_setup # Install Node.js & Node Packages & Generate Commands for Affected Projects.
pool:
vmImage: 'ubuntu-latest'
variables:
IS_PR: $[ eq(variables['Build.Reason'], 'PullRequest') ] # Findout Is this pull request?
steps:
- template: .azure-pipelines/steps/install-node-modules.yml # Base Template
- powershell: echo "##vso[task.setvariable variable=COMMANDS;isOutput=true]$(node ./tools/scripts/generate-ci-commands.js $(IS_PR))" # Create COMMANDS build time variable and assign ci commands.
name: setCommands
- script: echo $(setCommands.COMMANDS) # Echo the command for log purpose.
name: echoCommands

Select run

This time we have not changed the code therefore no build command created.


In order to run the lint, test and build we have to create run-many.js file where we will put our script.
/**
* # Run Many
* It will run the script using nx command line to run them in parellel.
*/
const execSync = require('child_process').execSync;
const commands = JSON.parse(process.argv[2]);
const projects = commands[process.argv[3]];
const target = process.argv[4];
execSync(
`npx nx run-many --target=${target} --projects=${projects.join(
','
)} --parallel`,
{
stdio: [0, 1, 2],
}
);
trigger:
- main # Trigger CI automatically whenever main branch is changed
jobs:
- job: initial_setup # Install Node.js & Node Packages & Generate Commands for Affected Projects.
pool:
vmImage: 'ubuntu-latest'
variables:
IS_PR: $[ eq(variables['Build.Reason'], 'PullRequest') ] # Findout Is this pull request?
steps:
CAMTASIA_19_MEDIA_FORMAT*C:\Users\Rupesh\Documents\Camtasia\Rec 01-21-21_003.trec|Product - template: .azure-pipelines/steps/install-node-modules.yml # Base Template
- powershell: echo "##vso[task.setvariable variable=COMMANDS;isOutput=true]$(node ./tools/scripts/generate-ci-commands.js $(IS_PR))" # Create COMMANDS build time variable and assign ci commands.
name: setCommands
- script: echo $(setCommands.COMMANDS) # Echo the command for log purpose.
name: echoCommands
- job: lint1 # Lets Run the Linting command for lint1 array.
dependsOn: initial_setup
condition:
| # Make sure this is passing and Don't Run this if we have empty array in nx commands from intial_setup step.
and(
succeeded(),
not(contains(
dependencies.initial_setup.outputs['setCommands.COMMANDS'],
'"lint1":[]'
))
)
pool:
vmImage: 'ubuntu-latest'
variables:
COMMANDS: $[ dependencies.initial_setup.outputs['setCommands.COMMANDS'] ]
steps:
- template: .azure-pipelines/steps/install-node-modules.yml
- script: node ./tools/scripts/run-many.js '$(COMMANDS)' lint1 lint # Run the lint command in parallel
- job: lint2
dependsOn: initial_setup
condition: |
and(
succeeded(),
not(contains(
dependencies.initial_setup.outputs['setCommands.COMMANDS'],
'"lint2":[]'
))
)
pool:
vmImage: 'ubuntu-latest'
variables:
COMMANDS: $[ dependencies.initial_setup.outputs['setCommands.COMMANDS'] ]
steps:
- template: .azure-pipelines/steps/install-node-modules.yml
- script: node ./tools/scripts/run-many.js '$(COMMANDS)' lint2 lint
- job: lint3
dependsOn: initial_setup
condition: |
and(
succeeded(),
not(contains(
dependencies.initial_setup.outputs['setCommands.COMMANDS'],
'"lint2":[]'
))
)
pool:
vmImage: 'ubuntu-latest'
variables:
COMMANDS: $[ dependencies.initial_setup.outputs['setCommands.COMMANDS'] ]
steps:
- template: .azure-pipelines/steps/install-node-modules.yml
- script: node ./tools/scripts/run-many.js '$(COMMANDS)' lint3 lint
- job: test1
dependsOn: initial_setup
condition: |
and(
succeeded(),
not(contains(
dependencies.initial_setup.outputs['setCommands.COMMANDS'],
'"test1":[]'
))
)
pool:
vmImage: 'ubuntu-latest'
variables:
COMMANDS: $[ dependencies.initial_setup.outputs['setCommands.COMMANDS'] ]
steps:
- template: .azure-pipelines/steps/install-node-modules.yml
- script: node ./tools/scripts/run-many.js '$(COMMANDS)' test1 test
- job: test2
dependsOn: initial_setup
condition: |
and(
succeeded(),
not(contains(
dependencies.initial_setup.outputs['setCommands.COMMANDS'],
'"test2":[]'
))
)
pool:
vmImage: 'ubuntu-latest'
variables:
COMMANDS: $[ dependencies.initial_setup.outputs['setCommands.COMMANDS'] ]
steps:
- template: .azure-pipelines/steps/install-node-modules.yml
- script: node ./tools/scripts/run-many.js '$(COMMANDS)' test2 test
- job: test3
dependsOn: initial_setup
condition: |
and(
succeeded(),
not(contains(
dependencies.initial_setup.outputs['setCommands.COMMANDS'],
'"test3":[]'
))
)
pool:
vmImage: 'ubuntu-latest'
variables:
COMMANDS: $[ dependencies.initial_setup.outputs['setCommands.COMMANDS'] ]
steps:
- template: .azure-pipelines/steps/install-node-modules.yml
- script: node ./tools/scripts/run-many.js '$(COMMANDS)' test3 test
- job: build1
dependsOn: initial_setup
condition: |
and(
succeeded(),
not(contains(
dependencies.initial_setup.outputs['setCommands.COMMANDS'],
'"build1":[]'
))
)
pool:
vmImage: 'ubuntu-latest'
variables:
COMMANDS: $[ dependencies.initial_setup.outputs['setCommands.COMMANDS'] ]
steps:
- template: .azure-pipelines/steps/install-node-modules.yml
- script: node ./tools/scripts/run-many.js '$(COMMANDS)' build1 build`
- job: build2
dependsOn: initial_setup
condition: |
and(
succeeded(),
not(contains(
dependencies.initial_setup.outputs['setCommands.COMMANDS'],
'"build2":[]'
))
)
pool:
vmImage: 'ubuntu-latest'
variables:
COMMANDS: $[ dependencies.initial_setup.outputs['setCommands.COMMANDS'] ]
steps:
- template: .azure-pipelines/steps/install-node-modules.yml
- script: node ./tools/scripts/run-many.js '$(COMMANDS)' build2 build
- job: build3
dependsOn: initial_setup
condition: |
and(
succeeded(),
not(contains(
dependencies.initial_setup.outputs['setCommands.COMMANDS'],
'"build3":[]'
))
)
pool:
vmImage: 'ubuntu-latest'
variables:
COMMANDS: $[ dependencies.initial_setup.outputs['setCommands.COMMANDS'] ]
steps:
- template: .azure-pipelines/steps/install-node-modules.yml
- script: node ./tools/scripts/run-many.js '$(COMMANDS)' build3 build
Notice since we have not changed any code we will notice only initial_setup and rest all jobs will be skipped.

Go libs\branding\logger\src\lib\logging.service.ts

Run npm run affected:dep-graph

confirm changes are working Run npm run start-admin

Lets create a script to test and watch

Now lets fix the test for admin project correct the title name
Now run npm run affected:test
It will automatically run the admin test.

Now lest fix the test for client project correct the title name
Now run npm run affected:test
It will automatically run the both admin & client test.


See this time in the build machine as well it identified
Notice test and build are passing

We dont want to trigger these many jobs since our monorepo is not that large. Therefore, I am deciding to create just one job so lets follow below steps.
Lets update the build definition to run them as task within single job.
Rename the current file to generate-ci-batch-commands.js
And create new file generate-ci-commands.js

/**
* # Generate Ci command
* 1. It will identify the affected projects
* 2. Group the projects in 3 groups for each command.
* ## Example:
* If 3 projects are affected it will create below group for lint, test and build command
* lint1:[admin], lint2:[logger], lint3:[client]
* build1:[admin], build2:[logger], build3:[client]( if you made buildable for each projects)
* test1:[admin], test2:[logger], test3:[client]( if you have tests for each projects)
* If 4 projects are affected it will create below group for lint, test and build command
* lint1:[admin,ngmaterial], lint2:[logger], lint3:[client]
* build1:[admin,ngmaterial], build2:[logger], build3:[client]( if you made buildable for each projects)
* test1:[admin,ngmaterial], test2:[logger], test3:[client] ( if you have tests for each projects)
*/
debugger;
const execSync = require('child_process').execSync;
const isMaster = process.argv[2] === 'False';
const baseSha = isMaster ? 'origin/main~1' : 'origin/main';
console.log(
JSON.stringify({
...commands('lint'),
...commands('test'),
...commands('build'),
})
);
function commands(target) {
const array = JSON.parse(
execSync(`npx nx print-affected --base=${baseSha} --target=${target}`)
.toString()
.trim()
).tasks.map((t) => t.target.project);
return { [target]: array };
}
If you run this script, after changing logger project. It will generate the commands for the affected projects. Like below
{
"lint": ["cutepuppies-admin", "branding-logger"],
"test": ["cutepuppies-admin", "branding-logger"],
"build": ["cutepuppies-admin"]
}

Rename the current azure-pipeline yml

and move to .azure-pipeline/steps folder for future use or backup.

azure-pipelines.yml
trigger:
- main # Trigger CI automatically whenever main branch is changed
variables:
IS_PULLREQUEST: $[eq(variables['Build.Reason'], 'PullRequest')]
steps:
- task: Cache@2
displayName: 'Cache Npm Dependencies'
inputs:
key: '**/package-lock.json, !**/node_modules/**/package-lock.json, !**/.*/**/package-lock.json'
path: '$(Build.SourcesDirectory)/node_modules'
cacheHitVar: 'CacheRestored'
- task: Npm@1
displayName: 'npm ci'
inputs:
command: ci
verbose: false
condition: ne(variables['CacheRestored'], 'true')
- powershell: |
echo "##vso[task.setvariable variable=COMMANDS]$(node ./tools/scripts/generate-ci-commands.js $(IS_PULLREQUEST))"
name: setCommands
displayName: setting commands
- script: echo $(COMMANDS)
name: echoCommands
displayName: commands to run
- script: node ./tools/scripts/run-many.js '$(COMMANDS)' lint
displayName: linting
condition: |
and(
succeeded(),
not(contains(
variables['COMMANDS'],
'"lint":[]'
))
)
- script: node ./tools/scripts/run-many.js '$(COMMANDS)' test
displayName: testing
condition: |
and(
succeeded(),
not(contains(
variables['COMMANDS'],
'"test":[]'
))
)
- script: node ./tools/scripts/run-many.js '$(COMMANDS)' build
displayName: building
condition: |
and(
succeeded(),
not(contains(
variables['COMMANDS'],
'"build":[]'
))
)
Run build


Run build

Build Success

Lets update the commands to also give a list of apps to publish in npm repository.
When We change logger we want to also see publish array with affected app.
{
"lint": ["branding-logger", "cutepuppies-admin"],
"test": ["branding-logger", "cutepuppies-admin"],
"build": ["cutepuppies-admin"],
"publish": ["cutepuppies-admin"]
}
If I change the client app as well then I should see both apps in publish array.
{
"lint": ["cutepuppies-client", "branding-logger", "cutepuppies-admin"],
"test": ["cutepuppies-client", "branding-logger", "cutepuppies-admin"],
"build": ["cutepuppies-client", "cutepuppies-admin"],
"publish": ["cutepuppies-client", "cutepuppies-admin"]
}
I will add below method for getting publish apps
function affectedApps(command) {
const x = execSync(`npx nx affected:apps --base=${baseSha}`)
.toString()
.trim();
let apps = x ? x.split('\n\n')[1].split(' - ').slice(1) : [];
apps = apps.map((t) => t.replace('\n', '').trim());
return { [command]: apps };
}
The new script for generate-ci-command.js
const execSync = require('child_process').execSync;
const isMaster = process.argv[2] === 'False';
const baseSha = isMaster ? 'origin/main~1' : 'origin/main';
console.log(
JSON.stringify({
...commands('lint'),
...commands('test'),
...commands('build'),
...affectedApps('publish'), // publish command for the apps
})
);
function commands(target) {
const array = JSON.parse(
execSync(`npx nx print-affected --base=${baseSha} --target=${target}`)
.toString()
.trim()
).tasks.map((t) => t.target.project);
return { [target]: array };
}
function affectedApps(command) {
const x = execSync(`npx nx affected:apps --base=${baseSha}`)
.toString()
.trim();
let apps = x ? x.split('\n\n')[1].split(' - ').slice(1) : [];
apps = apps.map((t) => t.replace('\n', '').trim());
return { [command]: apps };
}
Admin app package.json

Client app package.json


In order to copy package.json file after build in the dist folder update the workspace file.
admin project

client project

I want to build my angular app with below
Below is the nx build command to fulfill above requirements
nx run-many --target=build --projects=cutepuppies-client,cutepuppies-admin --parallel --configuration=production --outputHashing=none --sourceMap=true
Run above nx build command

Notice in the dist folder in admin folder we got map file and package.json
client project

https://hackmd.io/ChTI9iFXQXGdlQAWrcqrKA
https://hackmd.io/Aiksk5NqQouDgKcZLjnHfQ
Get access token from (npm.js)[https://www.npmjs.com/]


Generating new access token in npmjs

Adding npmrc file with authtoken


/**
* . bump the version
* . add npmrc file (if required)
* . publish to npm package repository
*
* Example: node ./publish-npm.js $(COMMANDS) $(Build.BuildNumber)
*
*/
const execSync = require('child_process').execSync;
const fs = require('fs');
const path = require('path');
var basePackageJson = require('../../package.json');
const args = {
commands: process.argv[2],
buildNumber: process.argv[3],
};
console.log('Received Args: ', args, '\n');
if (!args.commands) {
throw new Error('Commands are required');
}
const commands = JSON.parse(args.commands);
/*
let commands = {
publish: ['cutepuppies-admin', 'cutepuppies-client'],
};
*/
if (!args.buildNumber) {
throw new Error('Build Number is required');
}
const buildNumber = args.buildNumber.toString();
// let buildNumber = '3243';
const projects = commands['publish'];
const newVersion = getNewVesrion();
console.log(`new npm version would be: ${newVersion}`, '\n');
updatePublishingPackageJsonVersion();
publishNpmPackage();
return newVersion;
function getNewVesrion() {
let currentVersion = basePackageJson.version;
return currentVersion
.split('.')
.map((x, i) => (i == 2 ? buildNumber : x))
.join('.');
}
function updatePublishingPackageJsonVersion() {
projects.forEach((project) => {
updateVersion(
path.resolve(__dirname, '../../', `dist/apps/${project}/package.json`)
);
});
}
function updateVersion(packageJsonFilePath) {
var package = require(packageJsonFilePath);
package.version = newVersion;
fs.writeFileSync(packageJsonFilePath, JSON.stringify(package, null, 2));
console.log(
`Version updated for the app ${package.name}: ${newVersion}`,
'\n'
);
}
function publishNpmPackage() {
projects.forEach((app) => {
const cwd = path.resolve(__dirname, '../../', `dist/apps/${app}`);
console.log(`publishing to npm from: `, cwd, '\n');
execSync(
`npm publish --access public`,
{ cwd, stdio: [0, 1, 2] },
function (error) {
console.log(error, '\n');
throw error;
}
);
console.log(`${app} is published`, newVersion, '\n');
});
}
See both admin and client is published.



Karma test will fail if u have not tests.
Therefore, if you want to stop this behavior then you need to go to karma.conf.js at root location where u see package.json and add below flag as false.
failOnEmptyTestSuite: false
Quiz: Where should I write the code to create a mcq widget?
It is a data structure which has state.
Is a collection of models. If you have multiple models of the same type, create store to retrieve them and put them in the collection.
Store we can write code that does not go in one model and you want span over the multiple instances of the model.
We have component layer, message handlers and api service layers.
✅ RUN TEST: npm run affected:test ✅ RUN LINT: npm run affected:lint
You can always run affected projects on your feature branch by giving its name.
npm run affected:test --base=origin/features/PBI23/MessageHandlers
npm run affected:lint --base=origin/features/PBI23/MessageHandlers
Feel free to follow any naming conventions provided in your organization. Here is what I recommend:

Does the lib projects have npm versions? Answer: No, because they are not buildable and publishable.
How should we branch in monorepo ? Answer: V1, V2, V3 are the branches for the monorepo.
When do we create branches ? Answer: As you move your code to a new environment it is recommended to create a separate branch in monorepo.
Thanks for reading my article till end. I hope you learned something special today. If you enjoyed this article then please share to your friends and if you have suggestions or thoughts to share with me then please write in the comment box.

Basic algorithms that you must know if you want to crack your coding interview. In case you are starting to prepare for coding practice then make sure you...
Application and Service Principal Objects in Azure
Did you get a phone call from your customer saying they want to improve their application reliability while you move their workload to the cloud? If yes t...
Creating cost optimized highly scalable cloud architecture is challenging but it is possible! Using Spot Amazon Elastic Compute Cloud (Amazon EC2) instanc...
In a traditional data center you create one perimeter, secure them by installing firewall, WAF, SIEMS etc. and have 100% confidence that the data center i...
How to make sure our workload in the cloud is secure, reliable. How to monitor the cost of your cloud resources consumption? Is there any automation you can ...
EBITDA and EBIT is a very fundamental financial term that is nowadays mostly considered during the cloud adoption phase for IT companies. If your company ...
Are you attempting coding interview challenges in Javascript? Then make sure you learn below mandatory JavaScriipt apis and utilities.
Point of presence is a fundamental block of the telecommunication domain. You must be aware of this concept. If you want to system design for video conten...
Are you planning to design your next advanced distributed architecture? Make sure you are aware of the concepts such as high availability, consistency and...
Now a days distributed architecture is common. We deploy our services into many different servers to scale them up and meet our demand. However, managing ...
Do you have situations where a process is trying to use your virtual machine in the cloud and you want to protect and control the access? Do you want to u...
Azure Active Directory (AD) verifies the credentials that are username and password. It belongs to the Azure Identity Platform.
Learn more about how to use tags to organize your Azure resources and management hierarchy. Also learn the cmdlet used to fetch tags from Azure resources.
If you have any project that you want to integrate with Azure Active Directory and secure your app. Then you must try using Microsoft Authentication Libra...
Learn the failover and failback stages in Site Recovery on Azure. Learn Business Continuity and Disaster Recovery (BCDR) strategy in Azure.
Site Recovery is very critical now a days. In your own Data-center or Server disasters can happen and you must secure your site to recover from them. Use ...
Securing your workload and datacenter over the cloud is very challenging. You want your resources to be protected by both machines and users. Azure Active...
Data is very essential and now a days data is everything. So you have application in cloud and want to explore which type of data where to store in Azure....
Are you planning to migrate your on-premise data to the cloud using Azure data transfer solutions?
Learn what service from Azure you should use while creating your application in Azure. This article has quick short answer for when to use what in Azure s...
Virtualization is the single concept that now-a-days cloud service providers are using at massive scale and delivering IT technologies such as storage, co...
According to Statista.com As of 2021, around 50 percent of all corporate data is stored in the cloud. This share reached 30 percent in 2015 and has contin...
Azure Network Watcher is a monitoring service with lots of other important services for network. Most network diagnostics issues can be detected and analy...
Why do you care about encryption strategies? Well if you are planning to become system administrator or solution architect then you must know how you woul...
Do you have a lot of JavaScript projects using GitHub repositories? How are you managing dependencies among those projects? Developers might be struggling...
Are you willing to become cloud solution architect? I am going to add a few important technical questions that you must know for your next cloud solution ...
Did you know By default azure storage accounts are accessible by the public internet. How can u restrict all public traffic in to your azure storage accou...
If you want to become Cloud Security Architect you must have basics of Networking. This article will discuss all fundamental concepts of networking. Learn...
What are Azure Monitor and Application Insights? How exactly Azure Monitor work? How can you visualize Application Map with Application Insights? Learn th...
When you want to move your business to cloud the major thing to consider is storage. What kind of data you can store? What is the pricing? How can you opt...
Learn about malware, attacks to the network, social engineering attacks from scratch.
Learn how many types of monitoring services available in Azure to monitor your applications.
Azure Monitor is the central service that can help you to improve performance of your application and dependencies. In this article I will go through the ...
When I started learning Cloud being a webdev and software architect background. I came across many IT lingo, jargons, abbreviations that I did know about ...
When I started learning Azure being a webdev and software architect background. I came across many IT lingo, jargons, abbrebiations that I did know about ...
Blob Storage is helpful to upload images, videos, documents, pdfs etc. over the Azure cloud. In order to create new Azure Blob Storage. You must need to c...
Azure architects must aware of fundamentals of routing and peering. In this article we will see fundamentals as well as we will see some examples of routi...
Azure Storage account is a resource in Azure. Storage Account will give your group of services like Blob Service, File Service, Table Service, Queue Servi...
What are the two reasons that you may see the message: “There are no offers available in your region or country at this time”?
Azure VNet is the fundamental unit of networking in Azure Cloud. You must know the basics of VNet. In this article we will explore Azure VNet.
What is NAT, SNAT, DNAT etc. Why do we need them? What is the role of firewall in a Network and how firewall works with NAT, DNAT? Are you also seeking an...
What is NAT, SNAT, DNAT etc. Why do we need them? What is the role of firewall in a Network and how firewall works with NAT, DNAT? Are you also seeking an...
LRS (locally redundant storage) ZRS (zone redundant storage) GRS (geographically redundant storage) RA GRS (read-access geographically redundant storage) GZR...
A virtual private network (VPN) is a type of private interconnected network. VPNs use an encrypted tunnel within another network. I will explain what is V...
Azure Storage has no upfront cost, no termination fees and pay only for what you use. In this article you will learn about Azure storage access tiers and ...
Are you wondering how can you separately track the billing of your resources allocated in same subscription? Did you think you could save money by turning...
Azure Core Storage Services
How to manage DEV, QA and PROD environments in Azure Cloud? You end-up creating many resources and now how would you organize them for QA, DEV, UAT enviro...
Did you know you can containerize your asp.net MVC with docker application and upload to Azure Container Registry and host them using Azure Kubernetes Clu...
Understanding Core Azure Services
TCP: is a transport-layer protocol, and HTTP is an application-layer protocol that runs over TCP.
Azure portal is great while visualizing Azure log and metrics. You can see the pie chart, graph for resources like VMs etc. You can also create your custo...
In this article you will learn how you can upload a file to the server using node.js and HTML5.
Did you know you can enable web application tracing, performance check, request response time trace and exception tracing all free using Azure Application...
Are you wondering how to use ng-show in Angular 11? There is a way to achieve it by using [hidden]= “false”. However, if you are migrating large angularjs...
For entire azure resources even across subscriptions if you want to know about your billing, invoice, budget, alerts, recommendations then you must go to ...
You want to connect your Azure resources from your on-premise office machine or home laptop right? So how would you do that? Read this article. In order t...
Azure Advisor collects recommendations from all of the services within your subscription and display them in a single page. Example you can see recommenda...
Have you realized writing code that is not production ready is not good practice? Have you seen code which violates the DRY principle? Did you notice spec...
You can monitor performance and health of Virtual Machines and Virtual Machines scale sets, running processors and other resources dependencies with Azure...
Do you have node.js project that has specs and you want to make sure these specs run when you push your code to GitHub repo? Well you must setup CI in you...
I am happy that I cleared my Microsoft Azure Fundamental Certification (Az 900) Exam. This is the start of my Azure journey. In this article, I will expla...
Azure Security Center is the base infrastructure service to collect logs analyze them and generate tailored recommendations. Learn how can you review and ...
Do you have node.js project that you want to write specs using Jasmine? Are you wondering how to write specs and run all specs in your node.js project? Le...
This article will teach you the how to configure and implement diagnostics log for Azure resources. This article will help you to prepare for az-303: Mi...
Webbooks are basically user defined HTTP callbacks which are triggered by specific events. Whenever that trigger event occurs in the source site, the webh...
Azure Service Bus is a transport layer comprises of messaging entities. Learn what is Topology in messaging world and how N-Service bus makes life easy by...
Learn Merge Sorting algorithm in recursion function. In this article I will show you the execution of the recursion function for Merge Sorting.
Microsoft Azure Solutions Architect Expert is a role-based certification with a 1 year expiry.
Learn how to help your company to migrate its database workload to Microsoft Azure. How can you use Azure Cosmos DB to migrate your data to cloud and reta...
In order to become Azure Solution Architect Expert You must give AZ-303 and AZ-304 certification exams.
Can you explain concepts and terminology for the core Azure architecture components? Can you describe the benefits and usages of Azure subscriptions and m...
Do you love open-source? Do you want to make your PowerShell really powerful? Consider installing scoop and make your life simple! 😄 Learn how can scoop h...
Do you love open-source? Do you want to make your PowerShell really powerful? Consider installing scoop and make your life simple! 😄 Learn how can scoop h...
Do you want to understand binary search? Read this article, I have discussed binary search problems in JavaScript.
Did you know your company can take advantage of using many Azure cloud computing which will help your company to reduce its overall computing costs? Did y...
Do you want to build your first Angular App and deploy over cloud using GitHub Actions? How to deploy/publish Angular App to GitHub Pages automatically? D...
Microsoft offers 6 kinds of support plans. In this article lets quickly check them out.
While building/compiling angular or node application on Local Build Machine or Azure Pipelines or GitHub Workflows or Netflix or Heroku. The main issue we...
Microsoft offers 6 kinds of support plans. In this article lets quickly check them out.
Azure Information Protection (AIP) is a cloud-based solution that enables organizations to classify and protect documents and emails by applying labels.
Creating Azure Function in Csharp
Do you want to create your own custom GitHub Action? It’s very simple & really fun! In this article I will walk you through the steps to write, test, ...
Azure Load Balancer evenly distributes incoming network traffic load among backend resources or servers. It works at layer 4 (Transport Layer) of OSI (Ope...
Are you wondering how to publish Test Results over Azure CI Build while using Angular and JEST? In this article I will demonstrate nx monorepo publishing ...
Azure Information Protection (AIP) is a cloud-based solution that enables organizations to classify and protect documents and emails by applying labels.
In order to become Azure Developer Associate you must pass AZ-204 exam. If you want to become Cloud Solution Architect then consider giving Microsoft AZ-2...
Can you describe basic concepts of cloud computing? Is Azure right solution for your business needs? How can you create your Azure subscription today? I w...
Learn some important built-in very helpful methods in Powershell. It could be a quick note for you so don’t forget to bookmark this article! 🥇
Learn everything you should know about Azure Services and their concepts as a beginner.
Have you tried to host NServiceBus within Azure Functions? In this article I will teach you how can you host your first NServiceBus project within Azure F...
When I was learning Azure Infrastructure, I had big question in my mind what is subnet and why do I need Subnet in my network? If you share my question th...
When I was learning Azure Infrastructure, I had big question in my mind what is subnet and why do I need Subnet in my network? If you share my question th...
Do you prefer LINQ queries? I do because they provide a single consistent programming model across how they work with objects in application code and how ...
Are you wondering how your function app authenticate & authorize to read or write to Azure SQL table? Do you think how your web application will get p...
Are you wondering how your function app authenticate & authorize to read or write to Azure SQL table? Do you think how your web application will get p...
Do you want to create dotnet csharp console app and write CRUD ( Create, Read, Update and Delete ) operations over Azure Cosmos DB noSQL data? Read this a...
Did you know you can create and deploy Azure resources using JSON template? Did you also know that you can enforce business compliances on your resources?...
Do you want to make your PowerShell prompt colorful? Please read this article to make your PowerShell Terminal colorful and Git supported. I will use oh-m...
Did you know you can create and deploy Azure resources using JSON template? Did you also know that you can enforce business compliances on your resources?...
Do you want to learn Azure and afraid of being charged your credit card or getting big bills? Learn this article where I will explain how you can get free...
Are you wondering how to enforce business compliance to the deployed resources over Azure? Did you know you can write configuration file to deploy resourc...
Do you want to create Cosmos DB & Collection from DotNet Core Project? Read this article to create your first .net core project. And write csharp code...
Do you want to refresh AZ 304 Microsoft Azure Architect Design related random questions? This article will give you great random flashcards to remember Az...
Do you want to create your new Cosmos DB account and first database and collections right from Visual Studio Code? Read this article to learn hands on cod...
Did you know you can write a script and run from your machine to create and destroy multiple cloud infrastructures? Well yes I am not joking this is possi...
Are you using repository pattern? And want to commit multiple repository operations as a single logical transaction in Azure Cosmos DB? Read this article ...
.Net running on-process till .Net Core 3.1 & .Net isolated workers are coming on .Net 6 onwards & you can deploy Azure Function Apps in production...
Are you beginner on Azure Functions and want to learn the basics of Azure Functions? Did you know you can create Azure Functions and publish to Azure usin...
Do You want to start IT Business and you don’t have equipments? Don’t worry Azure is the solution for your business. By using Azure Compute Resources you ...
Did you know how can you protect your business against software or hardware disaster within Azure data-center? Did you also know how can you protect your ...
Are you beginner on Azure Cosmos DB and want to know what exactly is Cosmos DB? Then read this article. Azure Cosmos DB is a fully managed NoSQL database ...
Do you know in Azure Data Center you can protect your server against regular server software maintenance outages? You can also protect your VMs on Azure a...
Convert Angular service to a Message Handler. Do you want to organize your Angular code base as Service Oriented Architecture (SOA) way. And you want to c...
I have WordPress or Blogger blog and I decided to move away from WordPress and switch to Jekyll. I loved the way Jekyll is working. You can deploy Jekyll ...
Are you non-computer background student? I am a Electronics Engineering student and have been in software company and worked more than 16 years from junio...
When I started learning coding for a coding-interview for Facebook, Amazon or Google. I faced problems when I saw programmers were using terminologies lik...
Did you know how your servers are placed in Azure Data-Center? Do you understand how Azure Data Center protects your servers against software or hardware ...
Are you preparing for cloud solution architect interview then you must aware of soft skill questions. In this article I will give you questions that you m...
Learn how can you can create & host your own new Blog site for FREE. With high performance and SEO enabled using Jekyll and host them in GitHub Pages....
Are you willing to become cloud solution architect? I am going to add a few important technical questions that you must know for your next cloud solution ...
Did you know Azure DevOps Services and Azure DevOps Server are different entities? I have learned lessons while working on Azure DevOps Server 2020 on-pre...
Learn how Storage Spaces Direct provides you a Data fault tolerance at verity of levels. You don’t loose data at any stage. You get Data resiliency out of...
Do you want to show Angular Code Coverage Report in Azure CI Pipeline then read this article and follow the steps. IstanbulReporter in Karma.conf.js Go...
If you are working on nx monorepo workspace and if you have notice below error and want to fix it then read this article. “Error: A project without tags c...
Understanding Azure architecture gives you power to learn lots of higher level concepts on Azure like Virtual Machine scale sets etc. Therefore, in this a...
Do you want to schedule your Jekyll blog post to be published on GitHub Pages on future date time? Then read this article. Introduction Jekyll static s...
Do you want to restore and publish your scoped and public npm packages from Azure CI Pipeline? Do you want to Configure CI/CD for Node application with Az...
Artifacts caching does not work on-premise Azure DevOps Server 2020. The Azure DevOps documentation on Cache Action is not updated and that is misleading....
Do you want to know how to tag your git branch while building your source code when someone commits or merge to MASTER/MAIN branch? Then please read this ...
Are you wondering how to create an .npmrc file and put an authentication token from azure devOps for your team member’s development boxes? Do you have mul...
Are you using windows machine for local development? Do you have Azure DevOp’s server git repo and want to connect from local box? Then read this article....
Do you want to follow Conventional Commits and want to enforce a rule such that your team also follows it? In this article, You will learn how to enforce ...
Are you worried that new angular 10 project is not running in “IE11” even though you enable the given polyfills by angular team? Then please read this art...
Do you want to organize your CSS files in your angular app? Do you want to find out the strategy to segregate the CSS based on cross browsers and operatin...
If you are working on Nx Monorepo workspace and have many angular projects. And if you are using Azure CI/CD Pipeline then you might aware that there is no i...
If you have a blogging site using Jekyll and you want to publish your blogs to your Dev.To account? Then read this article. Jekyll Project I have my Jekyll...
So you want to learn how you will integrate CkEditor v5 in Nx Monorepo. Do you also want to learn how to create custom plugin inside CkEditor v5? Then I w...
If you want to run node.js script from azure-pipelines.yml and get the value returned from node.js script and use it in your CI next task. Then read this ...
Publish Test Results task publishes test results to Azure CI Pipelines. Step 1: Publish Unit Test Summary Report Step 1 - To generate Test Report I’m using...
Did you have requirement to update your Angular CI build number as your new Package.json version number and Branch name? Well this is a good practice to d...
Publish Code Coverage task Publishes Cobertura or JaCoCo code coverage results from your build in azure CI Pipeline. Azure DevOps provides us with the a...
Do you want to create environment level variable for your Azure Build CI Pipeline and access them in your azure pipeline task? Example: If you are using n...
Do you want to debug your NRWL/NX monorepo specs in visual studio code or right in chrome? Then this article is for you. I am going to use JEST test runne...
In my previous article “Imposing Constraints on Dependency Graph” you did learn how to isolate all projects of a folder (service A) from all of the projec...
Do you want to publish your nx monorepo app to npmjs.org? In this article, I will explain how can u publish your app to npmjs.org. Introduction In my m...
Are you using NRWL/NX monorepo in your company? and you are worried how to configure dependencies so that you can better control your projects? I use nx d...
In this article, I will explain how to know which applications or libraries are changed in your nx monorepo workspace. First time building Nx Monorepo ...
Do you want to create a new application on my nx monorepo work-space? Also do want to make sure that you should be able to build and test your application...
Do you want to create one variable in task-1 and read the value of that variable in task-2 in your azure ci pipeline? If your answer is yes then read this ar...
Protecting Master Branch from Bad Pull Requests is big challenge now a days while working in a team. You are working on git with distributed architecture. Wh...
Subscribe to email alerts to get notified for your build CI/CD in azure pipeline. It is good idea to setup subscription to get email to a group email id...
All are hosted CI/CD server supporting the build running in the build machines and deployment to target machines. Travis CI A hosted continuous int...
If you are following agile then continuous integration is must. I have setup CI/CD in Azure DevOps and I personally found my Angular build is taking lot of t...
If you want to create Build definition for Angular project in Azure DevOps, then this article is for you. Login to Dev Azure and go to the pipelines and foll...
Yaml files are used in Azure Pipelines for build and release definition. Yaml files are also used in GitHub build and release. Yaml is designed to be clean a...
In this video tutorial 0010-4 JWT authentication for distrubuted system we will learn what makes JWT authentication world’s most popular authentication type....
As we already discussed rest of the authentication types in our previous video tutorials, JWT based authentication is best among all. It is world famous and ...
In this video tutorial Cookie Based Authentication Advantage And Disadvantage | 0010-02 we will discuss about cookie based authentication. In this type of au...
Authentication is vital to most of the applications and the way it is achieved has evolved substantially in recent years. Basically there are three types of ...
About the Class Learn how to build an e-commerce online shopping responsive web application from scratch using Angular 8+, express & MongoDb comple...
Whenever somebody asks developer about difference between server side & client side coding, generally answer comes as “Anything angular or HTML code or a...
What is User Story A User Story is a note that captures what a user does or needs to do as part of her work. Each User Story consists of a short descripti...
In this video session Given When Then | Angular | BDD, we will teach you how to write unit tests in more readable fashion. Like Given When Then Style using J...
In our previous video session Add Item To Cart | Test Driven | RxJS | Demo we have already discussed Add item use case in our shopping cart project. Next in ...
In our previous demo session Creating Store Using RxJS | Angular | Demo we have written base code for our Cart Store. Now we will add methods to it, based on...
In this video session Creating Store Using RxJS | Angular | Demo we will create our Cart store and it is nothing but just a wrapper on top of state, so it be...
Till now in previous demo session Responsive Products Page | e-Commerce | Angular Material | 2 we have done loading of products with spinner, applied sorting...
In our previous demo session Responsive Products Page | e-Commerce | Angular Material | 1 we discussed how to use mat-table rather mat-cards or mat-grids in ...
In our previous demo session Pagination And Filter e-Commerce Angular App | mat-table we have covered filtering and pagination functionality in our ecommerce...
As we already fixed design and responsiveness of Login and Register pages of our ecommerce app in previous demo session Creating Responsive Login And Registe...
In our previous demo session Responsive Toolbar Online ecommerce Store Part 2 we have learnt how to create responsive toolbar with proper design. Next in thi...
In continuity to our previous demo session Responsive Toolbar Online eCommerce Store Part 1 where we made required changes to our ecommerce store to make its...
After learning error handling in our previous demo session Handling Server Side HTTP Error | 0009-27, next we will focus on creating responsive toolbar in ou...
🔥 Master the real, in-demand tech skills from home with Full Stack Master 100% online learning platform. Come out of this disaster with higher-paying,...
As we discussed in our previous video session Designing Shopping Page Using Angular Material Grid And Card | 0009-26, our web app is now growing as we are ad...
As we already discussed in our previous demo session like with growing maturity our code becomes complex and difficult to debug. Then we come up with this de...
Gradually, as our code base will grow it will become complex and we will face difficulties in debugging our code. In this session Debugging Server Side Code ...
Save the below code in bat file and execute it. It will install all the important VS Code Extensions that you need to do Angular / React or any Front End De...
While writing test in jasmine you will encounter a situation where you want to create a mock object & also you want to spy it's property. Jasmine cre...
In this video session User Login In Angular With MongoDB | Demo | 0009-23 we will login into our product Mart app through MongoDB database and we will see ho...
[iframe src="https://mailchi.mp/f98949daab5f/build-online-e-commerce-application-meanjs-full-stack-the-complete-course" width="100%" height="3500px"]
Fullstack Development Training
In this video session Saving User To MongoDB | Mongoose | Demo | 0009-22 we will explain how to save user data in mongo db and how to validate user at server...
[advanced_iframe securitykey=”” src=”https://gumroad.com/fullstackmaster/p/up-coming-full-stack-master-courses” id=”” name=”” width=”100%” height=”1500px” m...
Now in this demo session Installing And Configuring Mongodb & Mongoose | Demo | 0009-21 we will see how to install MongoDB in our machine and how to use ...
Introduction Now a days event based architecture is very popular. Writing JavaScript web application from scratch using event based architecture is a grea...
In our previous demos session we have created our server and restful API and tested API with postman also. Next we will try to integrate this Restful API in ...
In this demo session Creating Endpoint For Authentication | Express | Demo | 0009-19 we will create a restful API and will host it in Node.js using express. ...
Let’s begin this demo session 0009-18- Demo: Adding Registration and Logout feature with change in some look and feel of our user registration page, by impor...
In this demo session Creating Registration Component | Angular | Demo | 0009-17 we will first create registration component which will allow us to save user ...
In this demo session Adding Log In Component | Angular | Demo| 0009-16 we will learn to implement Login functionality in our app. With this functionality, us...
In our previous demo sessions we successfully created our Product Mart app. Now we are ready to deploy our code to so called production environment. For this...
Nowadays, we build large enterprise applications with Angular. But how to best structure such projects to ensure long-term maintainability and re-usability?...
In this demo session Integrating Toolbar | Angular CLI | Demo | 0009-13 we will see how to integrate toolbar in our angular app. In order to put toolbar in o...
This demo session Applying Card Component | Angular Material | Demo | 0009-12 talks about integrating card components from angular material so that we can p...
In this demo session Creating Product Service | Angular Service | Demo | 0009-11 we will see how to show products from JSON file in our angular project. Each...
In continuity of our demo session Creating Products Module | Lazy loaded module | Angular | 0009-09 we will see how to create Products page for our app keepi...
Let’s begin this demo session Creating Products Module | Lazy loaded module | Angular | 0009-09 by creating a home component. Command used to generate home c...
As we discussed in our last demo session Installing Angular Material Using Angular CLI | Tutorial | 0009-07 we are missing out component module installation ...
In order to install required angular material, angular team has provided six steps to follow in angular material home page. All of them are listed when we cl...
As you begin learning of coding basics, one important thing which makes your learning process easier and practical is availability of code. Most of the onlin...
So far in our angular project development from scratch we have covered two things: Environmental setup Creation of project using angular CLI An important q...
We saw in our previous session Creating Angular App using Angular CLI | 0009-03 how to do environmental set up and installation for our first angular project...
Let’s begin our Angular app development project from scratch. This article explains each step very minutely, so that you do not feel lost anywhere. It also s...
MEAN is an acronym for MongoDB, ExpressJS, AngularJS and Node.js. From client to server to database, MEAN is full stack JavaScript framework, ideal for build...
There are certain steps that we need to understand thoroughly to begin any angular project from scratch. In our previous video tutorial we already explained ...
When we talk about angular app development, most of the people get confused about its build & deployment activities. Our video tutorial Angular app Devel...
The Prototype Pattern creates new objects, but rather than creating non-initialized objects it returns objects that are initialized with values it copied fro...
In our previous video session JavaScript Concepts- Module Pattern | 0004-11 we have learnt about basics of Module Pattern. Here in this video tutorial JavaSc...
The Module Pattern is one of the most common design patterns used in JavaScript. It is easy to use and creates encapsulation of our code. Before we deep dive...
In our previous article JavaScript Concepts: What Is this Keyword | 0004-08 We read about ‘This’ concept of JavaScript which refers to calling context of the...
‘This’ keyword is widely used in almost all programming languages. Like in some programming languages This variable points to instance of an object or class....
Hoisting is another important JavaScript concept. It defines that in JS every variable gets declared at the beginning of the function. It literally means as ...
Closure is another JavaScript concept which comes in line with Scope concept. It basically comes into picture when we have nested functions. Whenever we have...
Though the concept of scope is not that easy to understand for beginners, yet we have tried to explain it in easiest way in our video tutorial JavaScript Con...
If you are planning to accelerate your career as JavaScript Professional, you must know some basic JavaScript concepts. Here in our video tutorials we have e...
In our eighth angular coding session Angular Coding Session Learn Dependency Injection | Practical | 8/8, we will see how to dynamically inject the console o...
In our sixth angular coding session Angular Coding Session Learn Dependency Injection | Practical | 6/8, we will see how to configure logger based on environ...
In our fifth angular coding session Angular Coding Session Learn Dependency Injection | Practical | 5/8 we will see how to create mini-logger by using existi...
In our fourth angular coding session Angular Coding Session Learn Dependency Injection | Practical | 4/8, we will see how to Inject Base URL from module in o...
In our third angular coding session Angular Coding Session Learn Dependency Injection | Practical | 3/8 we will see how to use http logger as a service in ou...
In our second angular coding session Angular Coding Session Learn Dependency Injection | Practical | 2/8, we will see how to use console logger as a service ...
As we know about Dependency Injection in detail like what is DI, where to use it and what is its significance? So in order to understand Dependency Injection...
Memory Issues Trouble shooting memory issues in web application is very important and it needs careful understanding of memory analysis. There are various...
A provider is an instruction to the DI system on how to obtain a value for a dependency. It is the provider that determines which instance or value should be...
As we know UseExisting provider configures the Injector to return a value of another UseExisting token. Through this provider, we can use already existing in...
Multi: true means that one provider token provides an array of elements. Using multi: true we tell Angular that the provider is a multi provider. This is use...
UseFactory provider configures the Injector to return a value by invoking a UseFactory function. It is basically a function which follows factory design patt...
UseValue provider configures the Injector to return a value for a token. It comes in that category of providers where we do not have unique thing to identify...
UseExisting provider configures the Injector to return a value of another UseExisting token. Through this provider, we can use already existing instance or o...
Class Provider configures the Injector to return an instance of useClass for a token. It is similar to type provider but it has different way of providing co...
A provider is an instruction to the DI system on how to obtain a value for a dependency. Most of the time, these dependencies are services that you create an...
There are 2 types of architectures one is Pull Based the second one is Push Based. I will explain you how can we leverage RxJS BehaviorS...
What are RxJS subjects and the benefits of using them. How to understand RxJS subjects such that you can apply it in your day to day coding at your own p...
Heroku PaaS best Cloud Platform Heroku is a cloud platform that lets you to build, deliver, monitor and scale application. Heroku is Platform as Service (Paa...
Angular 8.0.0 is here! Is there any breaking changes in Angular 8? No, Angular 8 is released now! As Angular team had promised they have not introduced break...
Introduction Welcome to step by step hands-on guide to setup webpack in your upcoming typescript project. Please follow the steps and you should be able t...
Unit Testing RxJS with Marble Diagrams Welcome to Unit Testing RxJS with Marble Diagrams course excercise material portal. Please watch Uni...
Scope of Dependency in Angular is very important concept to understand for a full stack developer. This is primarily asked question by interviewer in many di...
As we know, one must configure an injector with a provider, or it won't know how to create the dependency. The most obvious way for an injector to create an ...
A Dependency Provider configures an Injector with a DI Token, which that injector uses to provide the concrete, runtime version of a dependency value. The in...
We cannot simply ignore the shortcomings like Interface, Array (bunch of objects) cannot be used as DI Token in angular. There can be possibility where we ne...
No, we cannot do dependency injection through Interface in Typescript Angular; it can be done in C# or Java. This is very important concept need to know for ...
When we think of learning Dependency Injection in Angular, couple of questions arises like How this DI concept works in Angular? What are all the important ...
React: React is a JavaScript library for building UI components for web applications, maintained by Facebook. React Native, another popular outcome from Face...
Due to its component based architecture, angular has capability to protect our code for future. It is basically making our code future ready as each componen...
One of the main architectural principles in Angular is that an application should be composed of well encapsulated, loosely coupled components. In this sessi...
In 0008-7- angular: Hierarchical Dependency Injection video session, you will see how Angular hierarchical dependency injection system works. You will discov...
Most of the applications connect to multiple environments during their lifecycle. Environment which your application needs to connect can differ depending on...
Angular has a unique feature that makes it more popular and provides an upper hand as compare to other app building platforms like vue JS, React JS i.e. its ...
Dependency Injection Container or Injector is basically a static or global thing which is being used throughout the app to inject dependencies or objects. It...
Basically there are three types of dependency injection, Depending on the context we can choose any type which is being supported by that framework. Three ty...
Wikipedia Definition: Dependency injection is a technique whereby one object (or static method) supplies the dependencies of another object. A dependency is ...
Are you preparing for Angular interview? Not sure from where to start? Well we do have answers to all your angular related queries. We will help you to list ...
Along with choosing right template, best resume format, putting educational qualifications etc, the most important component required in an interview-winning...
Did you know you can create your own publish-subscribe library for your RxJS project? By using BehaviorSubject and filter operator it is possible to create ...
Did you know you can use RxJS simple operators and do html form validation re-actively? Well I learn RxJS operators by implementing them in real world proje...
I love to create automatic API Documentation of my project. Regardless I work on Angular, React or VueJS as far as it uses Typescript. Did you know you coul...
You might be aware of EADDRINUSE node error in node.js application. Where it says address is in use. This is very annoying. It happenes if some of the port...
I love Typescript the way it helps development speed and accuracy. I wanted to work with Typescript, Webpack and Express.JS finally came up with a project w...
Model in Domain Driven Design is a system of abstraction that eliminates things which are not required. Domain Model allows us to think about a particular do...
How to Inject Base Assets path URL dependency to webpack CSS bundle? In your JavaScript project build by webpack, if you have requirement where at the build ...
Dependency Injection In Software Engineering Dependency Injection is a technique where one object injects or passes the dependency object to other object at ...
Decorator is a concept in Typescript that can be used to annotate a class or it's members. Decorator also enables meta programming where one can collect as ...
Loading... In this article we will see how can you create your own typescript library that you can easily consume in your another typescript project. ...
RxJS Marble Diagrams are made to visualize the values emitted from the RxJS Observable over timeline.</p> Hi in this article I will explain why we need...
In this article we are going to talk about. What goals are ? How to set Goals ? What makes really good goal ? Organize your life goal Sort out your lif...
What is Scope in JavaScript Imagine Scope as a boundary within that things can be isolated. Like in your colony there are certain areas which has stuffs that...
When you create your own Typescript library then you need a barrel file where you put all of your files that you want to expose to the outside world kind of...
Eric Even wrote Domain Driven Design (DDD) book. Eric says DDD is the Philosophy of software design that helps projects dealing with complex problem. I ...
Why JavaScript I believe JavaScript is very popular language nowadays. I love JavaScript because of many reasons. Now various powerful client side framework...
How to add your own logo on README.md file Here is a simple way to create your own logo for your npm package. I hope you will enjoy this. Where to go and get...
What is GhPages Do you want to save time to create post or article while writing software code ? Or do you want to see your angular app live running in the i...
This blog post supports the sample code for the “Unit Testing RxJS with Marble Diagrams” course on Pluralsight, identifying common issues along with their so...
Hi everyone, I am very excited to announce that I became an author in Pluralsight.com and my first course on Unit Testing with RxJS Marble Diagram is going t...
Hi everyone, I started my FullstackMaster YouTube channel where I want to put some technical learning stuffs. I started putting RxJS videos over there. I hop...
Cloud itself is complex so why are customers bothering about multi-cloud at all? Why not just take google cloud and deploy all of your workload and be hap...
I recently wrote one article on JavaScript Module pattern in Code project. Please visit this website and suggest me your thoughts on it... Javascript Module ...
Today, I learned about one Excel Sheet Formula "VLOOKUP". It is very useful formula that gives us the power to search a value in a particular column. ...
I came through an open source JavaScript named as “Knockout.js”. After learning this javascript functionality and features. I found it very powerful, wh...
I took session on jQuery. It was nice experience to talk in front of my colleagues. First time I took session where some of my colleagues joined on phone als...
Suppose you are searching for a product in a shopping website and you got a big set of results. It normally comes in a grid view with a long scroll bar. Some...
My Friend was looking for one error that he was continuously getting when he was trying to setup my old version 1.0 .net code. The error message was: Th...
From last 4 days, I have been struggling on how I should load the UserControl dynamically in my default page. I know in today’s world where .Net 4.0 came up...
In order to make the application more loosely coupled we should use interfaces. In Dependency injection pattern there exist a class called as asse...
Almost 3 years ago Scottgu announced that Microsoft would begin offering product support for jQuery. Now Microsoft is playing a great role on contri...
I was trying to make my own menu widget using jQuery and I came with this below Widget. [sourcecode language="javascript"] //Menu Widget created by Rup...
In any jQuery Plugin there JavaScript local alias pattern is being used as a best practice. They have localized the global jQuery object as an alias $. ...
At the outset, I used to write programs that just work because, I had to complete and deliver the project on time.</p> I remember, when was a...
Recently, I received one question how to send the xml data from one page to another page without using any state management or caching technique of Asp...
Hi all,</p> I recently installed Internet Explorer 8 in my laptop and wondering many new features about the IE8. I was enjoying the good and...
I just read the great article Introducing "Razor" – a new view engine for ASP.NET by Scottgu. I found Razor more comfortable than the other view engines. It'...
Plethora of times it is required to show complex tool tip. Complex, I mean the tool tip that can contain images, links , text decoration etc...To show the cu...
Hi I just came across a greate website http://bililite.com/blog/understanding-jquery-ui-widgets-a-tutorial/ There I learned how to create custom jQuery widge...
There is a great article written by Douglas Crockford. I recommend everybody to read this article. By using Prototypal inheritance technique, we can create t...