Categories
2020 MEAN Stack Development Guide

nodejs API performance monitoring with ECS/Log

https://www.npmjs.com/package/@shoppredigital/omnilog 

https://github.com/shoppredigital-tech/OmniLog

Use Metabase Alerts

Categories
2020 MEAN Stack Development Guide

code coverage for nodejs projects with codecov with mocha, nyc and Github Actions

Getting a badge

https://stackoverflow.com/questions/54010651/codecov-io-badge-in-github-readme-md

Go to https://codecov.io/gh/<your-organisation>/<your-project>/settings/badge, here you can see your badges ready to be copied.

Or just navigate to your project and go to Settings -> Badge.

Adding it to your github

checkout Demo here – https://github.com/goECS/ecs-sdk-js/blob/master/README.md

Enabling Github Actions

Setting up the code

npm install codecov --save-dev

https://github.com/codecov/codecov-node

create a feature.spec.js

test with

# run test cases
node_modules/.bin/nyc --reporter=text-lcov node_modules/.bin/mocha --opts .mocharc feature.spec.js --exit"

# submit test coverage to codecov
node_modules/.bin/codecov --token=<codecov-token>

https://help.github.com/en/actions/reference/events-that-trigger-workflows

Checkout a simple workflow file here: https://github.com/goECS/ecs-sdk-js/blob/master/.github/workflows/lint-and-test.yml

Trigger a build using changing some code in master branch

Checkout for first successful build https://github.com/goECS/ecs-sdk-js/runs/673185873?check_suite_focus=true

Categories
2020 MEAN Stack Development Guide

WebStorm for NodeJS/AngularJS Development

  1. Configuring Webstorm in Ubuntu | Mac | Windows

Accessibility

  1. npm scripts
  2. Terminal
  3. Version control & VCS Menu
  4. Mocha Test Runner

WebStorm Plugins

  1. gittools webstorm plugin
  2. eslint webstorm plugin

Three

Four

Five

Categories
2020 MEAN Stack Development Guide

eslint 6.8.0 with typescript for server

npm i eslint-config-airbnb eslint-config-airbnb-base eslint-plugin-import eslint-plugin-promise eslint-plugin-typescript precommit-hook -D

Improve quality of your nodejs/angularjs code development with Airbnb eslint config

Categories
2020 MEAN Stack Development Guide

Typescript configs for WebStorm

  • import errors while running test cases
  • performance issues while development, using transpile-only
  • ts-node-dev – nodemon for typescript projects
  • transpiling typescript to javascript
  • compatiablity with existing module.exports using esModuleInterops

Categories
2020 MEAN Stack Development Guide

Github repo naming –

  • github.com/adarshpatil9/api
  • dns: api.adarshpatil9.com

github username should be domainname

Best Practices

for example: if client domain is walmart.com

then if u like to develop api for walmart.com and it will be hosted with domain api.walmart.com

then will be good to have https://github.com/walmart

where walmart is your github organisation name or username

and create repo with name api

your first project may

Categories
2020 MEAN Stack Development Guide

Configuring git with ssh keys to avoid entering passwords

git config --global user.name "Nikkitha Shanker"
git config --global user.email "nikkitha[at]shoppredigital.com"
ssh-keygen
## hit enter 4 times
cat ~/.ssh/id_rsa.pub

## copy and add it https://github.com/settings/keys
git clone git@github.com:nikkithought/nodejs-docker-caprover.git

## now git will not ask any password or username

for ui driven git use webstorm >>

use precommit-hook for quality checks before git commit

# use --skip-verify option to bypass precommit hook