Giter VIP home page Giter VIP logo

cvs-tsk-edh-marshaller-inbound's Introduction

cvs-tsk-edh-marshaller-inbound

A service for catching update requests from EDH into CVS

Dependencies

The project runs on node >10 with typescript and serverless framework. For further details about project dependencies, please refer to the package.json file. nvm is used to managed node versions and configuration explicitly done per project using an .npmrc file.

Prerequisites

Please install and run the following securiy programs as part of your development process:

These will be run as part of your projects hooks so you don't accidentally introduce any new security vulnerabilities.

You will also require Docker to run the service locally if you wish to mock external dependencies.

Architecture

EDH Architecture Integration pattern

End to end design

All in one view

Getting started

Set up your nodejs environment running nvm use and once the dependencies are installed using npm i, you can run the scripts from package.json to build your project. This code repository uses serverless framework to mock AWS capabilities for local development.

Scripts

  • Building without source maps - npm run build
  • Building with source maps - npm run build:dev

Configuration

The configuration file can be found under src/config/config.yml. Environment variable injection is possible with the syntax: ${BRANCH}, or you can specify a default value: ${BRANCH:local}.

Environmental variables

  • The BRANCH environment variable indicates in which environment is this application running. Not setting this variable will result in defaulting to local.
  • The EDH environment variable is used as a feature flag, to switch to stub endpoints. A value of of STUB will use the stubApiKey and stubBaseUrl. Any other value will use the real key/url
  • The DEBUG environment variable is used as a feature flag, to enable more extensive logging. Does more logging if value is TRUE, otherwise off
  • The VALIDATION environment variable is used as a feature flag, to enable validation. Does validation if value is TRUE, otherwise off

Debugging

The following environmental variables can be given to your serverless scripts to trace and debug your service:

AWS_XRAY_CONTEXT_MISSING = LOG_ERROR
SLS_DEBUG = *
BRANCH

Testing

Unit testing

In order to test, you need to run the following:

npm run test # unit tests

End to end

Infrastructure

We follow a gitflow approach for development. For the CI/CD and automation please refer to the following pages for further details:

Contributing

Please familiarise yourself with commitlint and conventional commits conventions as a hook is in place to enforce standards.

Hooks and code standards

The projects has multiple hooks configured using husky which will execute the following scripts: security-checks, audit, tslint, prepush. The codebase uses typescript clean code standards as well as sonarqube for static analysis.

SonarQube is available locally, please follow the instructions below if you wish to run the service locally (brew is the preferred approach).

Static code analysis

Brew (recommended):

  • Install sonarqube using brew
  • Change sonar.host.url to point to localhost, by default, sonar runs on http://localhost:9000
  • run the sonar server sonar start, then perform your analysis npm run sonar-scanner

Manual:

  • Download sonarqube
  • Add sonar-scanner in environment variables in your profile file add the line: export PATH=<PATH_TO_SONAR_SCANNER>/sonar-scanner-3.3.0.1492-macosx/bin:$PATH
  • Start the SonarQube server: cd <PATH_TO_SONARQUBE_SERVER>/bin/macosx-universal-64 ./sonar.sh start
  • In the microservice folder run the command: npm run sonar-scanner

cvs-tsk-edh-marshaller-inbound's People

Contributors

bfloreadvsa avatar jonlazarinidd avatar khodderdvsa avatar m-ujaffer avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

uk-gov-mirror

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.