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)
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).
- 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)
- unpack archive to your directory
- cd this directory
npm install
(ornpm ci
in feature, ifpackage-lock.json
is exist)
- If is docker will be used:
sh build_docker.sh
ordocker 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')
- 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
- Run server
- Go to
localhost:3000/api
and clickv1/get-token
(use accounts from below) - Copy-Paste
access-token
from response and use him for calling another methods - Call
v1/vote
andv1/results
. Remember: Initial state what database is empty
- john-changeme
- chris-secret
- maria-guess
- readiness/liveness (terminus) - is not implemented
- go to
/healthCheck
and if you gottrue
when your service is alive - go to
/metrics
for collect of prometheus metrics
https://github.com/willsoto/nestjs-prometheus https://github.com/nodeshift/helm