Giter VIP home page Giter VIP logo

typescript-bc-template's Introduction

typescript-bc-template

EXPERIMENTAL vNext Typescript Bounded Context Mono Repository Template

This repository has two main purposes

  • As a template for bounded context mono repos
  • As example code for the implementation of applications. It shows how to use common cross-cutting concerns' clients, like logging, auditing, platform-config and security.

How to use this template

  • Start by creating a new repository in GitHub using this template

create repo from template

  • Make sure package directory names conform to the standard and end with "lib", "svc" or "tool"()

Unsorted hints:

  • For packages that don't require publishing to NPM, make sure you have the "private": true line in package.json. By contrast, for all modules that require NPM publishing make sure it is set to false.

How to add dependencies with npm packages

npm -w packages/package-dir-name install npm_dependency_name

For development dependencies add the --dev at the end, like so:

npm -w packages/package-dir-name install npm_dependency_name --save-dev

Notes:

  • Replace package-dir-name with the correct module name, it corresponds to the directory name
  • Replace npm_dependency_name with the correct dependency name
  • Common devDependencies, such as linters or test frameworks, should be installed/dependend in the main package.json to avoid repeating them in each of the monorepo's modules

TBD finish this

Packages

Example Service - example-svc

This service exemplifies how to create a bounded context service that can be deployed. The objective is to show how to use the most important vNext platform foundational services.

To make sure the service is docker image is build and published to DockerHub by the CI/CD pipeline, change the value of the " publish_to_dockerhub" to true.

"private": true,
"mojaloop": {
  "publish_to_dockerhub": true
},

Please see the details of the example service within its README file.

Usage

Install NVM - Node version manager

More information on how to install NVM: https://github.com/nvm-sh/nvm

Use NVM to install the correct Node.js version

# (In the repository root directory - one having the .nvmrc file)
nvm install
nvm use

Install Dependencies

All commands below assume you're positioned at the root of the monorepo.

npm install

Build

npm run build

Run

npm run start

Unit Tests

npm run test:unit

Integration Tests

npm run test:integration

Execute locally the pre-commit checks - these will be executed with every commit and in the default CI/CD pipeline

Make sure these pass before committing any code

npm run pre_commit_check

typescript-bc-template's People

Contributors

mdebarros avatar pedrosousabarreto avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

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.