Coder Social home page Coder Social logo

nodejs_nestjs_testcase's Introduction

Quality Gate Status

Description

This is repository has been created as a demonstration of my skills for Bell Integrator company, for the vacancy of TechLead (NodeJS Backend Developer)

The original version has been created in 2019, but I updated this is code to my actual state of tech skill sets.

You can use this is repository as a template for your microservices (how I do)

Task description

Older versions

2019 year

Actual version

License: MIT

Building

Check what .env file is exists or create own (or send args from command line).

See: example.env as example (rename to production.env for production or development.env for development).

You can more info in package.json. Or don't do anything, and config will be parsed by command line =) (see cross-env documentation).

Features:

  • Swagger
  • Prometheus as monitoring tool
  • Sentry for reserve logging tool
  • SonarQube for code quality
  • Ready for using in docker/kubernetes (I hope what HELM charts you can create manually)

For local development

  • unpack archive to your directory
  • cd this directory
  • npm install (or npm ci in feature, if package-lock.json is exist)

For production build

  • If is docker will be used: sh build_docker.sh or docker build -t testcase . && docker run testcase
  • If is docker is not available: npm install pm2 -g && (npm ci || npm i) && (npm run build && pm2 start 'npm run start:prod')

Swagger (OpenAPI)

  • Run your service
  • go to localhost:3000/api (port can be changed, and api endpoint in code) for swagger ui
  • go to localhost:3000/api/swagger.json for downloading swagger.json

How a test

  • Run server
  • Go to localhost:3000/api and click v1/get-token (use accounts from below)
  • Copy-Paste access-token from response and use him for calling another methods
  • Call v1/vote and v1/results. Remember: Initial state what database is empty

Accounts (username-password)

  • john-changeme
  • chris-secret
  • maria-guess

HealthChecs

  • readiness/liveness (terminus) - is not implemented
  • go to /healthCheck and if you got true when your service is alive
  • go to /metrics for collect of prometheus metrics

Additional information:

  1. PM2 documentation.
  2. Docker documentation.
  3. NestJS documentation.

Used additional packages:

https://github.com/willsoto/nestjs-prometheus https://github.com/nodeshift/helm

nodejs_nestjs_testcase's People

Contributors

galek avatar

Stargazers

 avatar

Watchers

 avatar

nodejs_nestjs_testcase's Issues

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.