master 2170453c4faf cached
544 files
623.6 KB
181.5k tokens
472 symbols
1 requests
Download .txt
Showing preview only (764K chars total). Download the full file or copy to clipboard to get everything.
Repository: tkssharma/nodejs-microservices-patterns
Branch: master
Commit: 2170453c4faf
Files: 544
Total size: 623.6 KB

Directory structure:
gitextract_2afopmxn/

├── README.md
├── api-gateway-and-service-doscovery/
│   ├── .gitignore
│   ├── README.md
│   ├── ServicesSetup.sh
│   ├── ServicesStart.sh
│   ├── api-gateway/
│   │   ├── Dockerbuild.sh
│   │   ├── Dockerfile
│   │   ├── api/
│   │   │   ├── account/
│   │   │   │   ├── login.js
│   │   │   │   └── signup.js
│   │   │   └── crm/
│   │   │       └── orders/
│   │   │           └── orders.js
│   │   ├── api-gateway.js
│   │   ├── config.js
│   │   ├── config.json
│   │   ├── package.json
│   │   ├── server.js
│   │   └── services-helper.js
│   ├── service-log/
│   │   ├── Dockerbuild.sh
│   │   ├── Dockerfile
│   │   ├── config.js
│   │   ├── config.json
│   │   ├── log.js
│   │   ├── package.json
│   │   └── server.js
│   ├── service-login/
│   │   ├── Dockerbuild.sh
│   │   ├── Dockerfile
│   │   ├── config.js
│   │   ├── config.json
│   │   ├── login.js
│   │   ├── package.json
│   │   └── server.js
│   ├── service-orders/
│   │   ├── Dockerbuild.sh
│   │   ├── Dockerfile
│   │   ├── config.js
│   │   ├── config.json
│   │   ├── orders.js
│   │   ├── package.json
│   │   └── server.js
│   └── service-signup/
│       ├── Dockerbuild.sh
│       ├── Dockerfile
│       ├── config.js
│       ├── config.json
│       ├── package.json
│       ├── server.js
│       └── signup.js
├── dockerized-containers/
│   ├── .eslintrc.js
│   ├── .gitignore
│   ├── .travis.yml
│   ├── README.md
│   ├── docker-compose.yml
│   ├── e-Commerce-Admin/
│   │   ├── Dockerfile
│   │   ├── README.md
│   │   ├── app/
│   │   │   ├── config/
│   │   │   │   ├── email.ts
│   │   │   │   └── environments/
│   │   │   │       ├── dev.ts
│   │   │   │       ├── qa.ts
│   │   │   │       └── test.ts
│   │   │   ├── controller/
│   │   │   │   └── UserController.ts
│   │   │   ├── events/
│   │   │   │   └── notification.ts
│   │   │   ├── global/
│   │   │   │   └── templates/
│   │   │   │       ├── emails/
│   │   │   │       │   ├── password-reset-email/
│   │   │   │       │   │   ├── html.pug
│   │   │   │       │   │   └── style.css
│   │   │   │       │   └── welcome-email/
│   │   │   │       │       ├── html.pug
│   │   │   │       │       └── style.css
│   │   │   │       └── response/
│   │   │   │           └── index.ts
│   │   │   ├── helper/
│   │   │   │   ├── bcrypt.ts
│   │   │   │   ├── email.ts
│   │   │   │   ├── errorHandler.ts
│   │   │   │   ├── logger.ts
│   │   │   │   ├── responseTemplate.ts
│   │   │   │   └── twillo.ts
│   │   │   ├── lib/
│   │   │   │   ├── logger.ts
│   │   │   │   ├── mongoose.ts
│   │   │   │   └── requestValidator.ts
│   │   │   ├── middleware/
│   │   │   │   ├── authMiddleware.ts
│   │   │   │   └── requestValidator.ts
│   │   │   ├── models/
│   │   │   │   ├── plugin/
│   │   │   │   │   └── plugin.ts
│   │   │   │   └── user.ts
│   │   │   ├── routes/
│   │   │   │   ├── defaultRoutes.ts
│   │   │   │   ├── provider/
│   │   │   │   │   ├── Facebook.ts
│   │   │   │   │   ├── Google.ts
│   │   │   │   │   ├── Linkedin.ts
│   │   │   │   │   ├── Locale.ts
│   │   │   │   │   └── Twitter.ts
│   │   │   │   ├── routes.ts
│   │   │   │   └── userRoutes.ts
│   │   │   ├── routes.ts
│   │   │   ├── seed/
│   │   │   │   ├── seedUsers.ts
│   │   │   │   └── seedVehicle.ts
│   │   │   ├── transformer/
│   │   │   │   └── userTransformer.ts
│   │   │   └── types/
│   │   │       ├── global.d.ts
│   │   │       └── vendor.d.ts
│   │   ├── env.sh
│   │   ├── express.ts
│   │   ├── package.json
│   │   ├── public/
│   │   │   ├── javascripts/
│   │   │   │   └── script.js
│   │   │   └── style.scss
│   │   ├── server.ts
│   │   ├── tsconfig.json
│   │   ├── tslint.json
│   │   └── uploads/
│   │       ├── documents/
│   │       │   └── .gitkeep
│   │       └── profile/
│   │           └── .gitkeep
│   ├── e-Commerce-Auth/
│   │   ├── Dockerfile
│   │   ├── README.md
│   │   ├── app/
│   │   │   ├── config/
│   │   │   │   ├── email.ts
│   │   │   │   └── environments/
│   │   │   │       ├── dev.ts
│   │   │   │       ├── qa.ts
│   │   │   │       └── test.ts
│   │   │   ├── controller/
│   │   │   │   └── UserController.ts
│   │   │   ├── events/
│   │   │   │   └── notification.ts
│   │   │   ├── global/
│   │   │   │   └── templates/
│   │   │   │       ├── emails/
│   │   │   │       │   ├── password-reset-email/
│   │   │   │       │   │   ├── html.pug
│   │   │   │       │   │   └── style.css
│   │   │   │       │   └── welcome-email/
│   │   │   │       │       ├── html.pug
│   │   │   │       │       └── style.css
│   │   │   │       └── response/
│   │   │   │           └── index.ts
│   │   │   ├── helper/
│   │   │   │   ├── bcrypt.ts
│   │   │   │   ├── email.ts
│   │   │   │   ├── errorHandler.ts
│   │   │   │   ├── logger.ts
│   │   │   │   ├── responseTemplate.ts
│   │   │   │   └── twillo.ts
│   │   │   ├── lib/
│   │   │   │   ├── logger.ts
│   │   │   │   ├── mongoose.ts
│   │   │   │   └── requestValidator.ts
│   │   │   ├── middleware/
│   │   │   │   ├── authMiddleware.ts
│   │   │   │   └── requestValidator.ts
│   │   │   ├── models/
│   │   │   │   ├── plugin/
│   │   │   │   │   └── plugin.ts
│   │   │   │   └── user.ts
│   │   │   ├── routes/
│   │   │   │   ├── defaultRoutes.ts
│   │   │   │   ├── provider/
│   │   │   │   │   ├── Facebook.ts
│   │   │   │   │   ├── Google.ts
│   │   │   │   │   ├── Linkedin.ts
│   │   │   │   │   ├── Locale.ts
│   │   │   │   │   └── Twitter.ts
│   │   │   │   ├── routes.ts
│   │   │   │   └── userRoutes.ts
│   │   │   ├── routes.ts
│   │   │   ├── seed/
│   │   │   │   ├── seedUsers.ts
│   │   │   │   └── seedVehicle.ts
│   │   │   ├── transformer/
│   │   │   │   └── userTransformer.ts
│   │   │   └── types/
│   │   │       ├── global.d.ts
│   │   │       └── vendor.d.ts
│   │   ├── env.sh
│   │   ├── express.ts
│   │   ├── package.json
│   │   ├── public/
│   │   │   ├── javascripts/
│   │   │   │   └── script.js
│   │   │   └── style.scss
│   │   ├── server.ts
│   │   ├── tsconfig.json
│   │   ├── tslint.json
│   │   └── uploads/
│   │       ├── documents/
│   │       │   └── .gitkeep
│   │       └── profile/
│   │           └── .gitkeep
│   ├── e-Commerce-Cart/
│   │   ├── .sequelizerc
│   │   ├── Dockerfile
│   │   ├── README.md
│   │   ├── app/
│   │   │   ├── config/
│   │   │   │   └── environments/
│   │   │   │       ├── dev.ts
│   │   │   │       ├── qa.ts
│   │   │   │       └── test.ts
│   │   │   ├── events/
│   │   │   │   └── processEvent.ts
│   │   │   ├── helper/
│   │   │   │   ├── errorHandler.ts
│   │   │   │   ├── errors.ts
│   │   │   │   ├── logger.ts
│   │   │   │   └── responseTemplate.ts
│   │   │   ├── lib/
│   │   │   │   ├── logger.ts
│   │   │   │   ├── mysql.ts
│   │   │   │   └── requestValidator.ts
│   │   │   ├── middleware/
│   │   │   │   └── requestValidator.ts
│   │   │   ├── models/
│   │   │   │   └── data/
│   │   │   │       └── cart.ts
│   │   │   ├── routes/
│   │   │   │   └── defaultRoutes.ts
│   │   │   ├── routes.ts
│   │   │   └── types/
│   │   │       ├── global.d.ts
│   │   │       └── vendor.d.ts
│   │   ├── config/
│   │   │   └── config.js
│   │   ├── env.sh
│   │   ├── express.ts
│   │   ├── mysql/
│   │   │   └── schema.sql
│   │   ├── package.json
│   │   ├── public/
│   │   │   ├── javascripts/
│   │   │   │   └── script.js
│   │   │   └── style.scss
│   │   ├── server.ts
│   │   ├── tsconfig.json
│   │   ├── tslint.json
│   │   └── uploads/
│   │       ├── documents/
│   │       │   └── .gitkeep
│   │       └── profile/
│   │           └── .gitkeep
│   ├── e-Commerce-Client/
│   │   ├── Dockerfile
│   │   ├── README.md
│   │   ├── env.sh
│   │   ├── firebase.json
│   │   ├── package.json
│   │   ├── public/
│   │   │   ├── index.html
│   │   │   ├── manifest.json
│   │   │   └── normalize.css
│   │   └── src/
│   │       ├── api/
│   │       │   └── index.js
│   │       ├── components/
│   │       │   ├── App/
│   │       │   │   └── index.js
│   │       │   ├── Checkbox/
│   │       │   │   └── index.js
│   │       │   ├── FloatCart/
│   │       │   │   ├── CartProduct/
│   │       │   │   │   └── index.js
│   │       │   │   ├── index.js
│   │       │   │   └── style.scss
│   │       │   ├── Selectbox/
│   │       │   │   └── index.js
│   │       │   ├── Shelf/
│   │       │   │   ├── Filter/
│   │       │   │   │   ├── index.js
│   │       │   │   │   └── style.scss
│   │       │   │   ├── ProductList/
│   │       │   │   │   ├── Product/
│   │       │   │   │   │   └── index.js
│   │       │   │   │   └── index.js
│   │       │   │   ├── ShelfHeader/
│   │       │   │   │   └── index.js
│   │       │   │   ├── Sort/
│   │       │   │   │   └── index.js
│   │       │   │   ├── index.js
│   │       │   │   └── style.scss
│   │       │   ├── Spinner/
│   │       │   │   ├── index.js
│   │       │   │   └── style.scss
│   │       │   └── Thumb/
│   │       │       └── index.js
│   │       ├── config/
│   │       │   ├── index.js
│   │       │   └── server.js
│   │       ├── index.js
│   │       ├── index.scss
│   │       ├── layout/
│   │       │   ├── Auth.js
│   │       │   └── Public.js
│   │       ├── services/
│   │       │   ├── auth/
│   │       │   │   ├── Login.js
│   │       │   │   ├── Logout.js
│   │       │   │   ├── Register.js
│   │       │   │   ├── ResetPassword.js
│   │       │   │   ├── ValidateToken.js
│   │       │   │   ├── action.js
│   │       │   │   ├── actionTypes.js
│   │       │   │   ├── auth.scss
│   │       │   │   └── reducer.js
│   │       │   ├── cart/
│   │       │   │   ├── actionTypes.js
│   │       │   │   ├── actions.js
│   │       │   │   └── reducer.js
│   │       │   ├── filters/
│   │       │   │   ├── actionTypes.js
│   │       │   │   ├── actions.js
│   │       │   │   └── reducer.js
│   │       │   ├── reducers.js
│   │       │   ├── shelf/
│   │       │   │   ├── actionTypes.js
│   │       │   │   ├── actions.js
│   │       │   │   └── reducer.js
│   │       │   ├── sort/
│   │       │   │   ├── actionTypes.js
│   │       │   │   ├── actions.js
│   │       │   │   └── reducer.js
│   │       │   ├── store.js
│   │       │   ├── total/
│   │       │   │   ├── actionTypes.js
│   │       │   │   ├── actions.js
│   │       │   │   └── reducer.js
│   │       │   └── util.js
│   │       ├── setupTests.js
│   │       └── util/
│   │           ├── helper/
│   │           │   └── index.js
│   │           └── middleware/
│   │               ├── auth.js
│   │               └── index.js
│   └── proxy/
│       ├── default.conf
│       ├── hosts
│       └── ssl/
│           ├── pac.crt
│           └── pac.key
├── event-driven-microservices-docker/
│   ├── .githooks/
│   │   ├── pre-commit
│   │   ├── pre-commit.d/
│   │   │   ├── articles-management-service
│   │   │   ├── events-management-service
│   │   │   ├── notification-service
│   │   │   └── user-management-service
│   │   ├── pre-push
│   │   └── pre-push.d/
│   │       ├── articles-management-service
│   │       ├── events-management-service
│   │       ├── notification-service
│   │       └── user-management-service
│   ├── .gitignore
│   ├── docker-compose.yml
│   ├── run_all_tests
│   └── services/
│       ├── articles-management/
│       │   ├── .dockerignore
│       │   ├── .eslintignore
│       │   ├── .eslintrc.yml
│       │   ├── .gitignore
│       │   ├── Dockerfile
│       │   ├── package.json
│       │   ├── src/
│       │   │   ├── app.js
│       │   │   ├── controllers/
│       │   │   │   ├── __mocks__/
│       │   │   │   │   └── article.controller.js
│       │   │   │   └── article.controller.js
│       │   │   ├── environment/
│       │   │   │   └── config.js
│       │   │   ├── message-bus/
│       │   │   │   └── send/
│       │   │   │       ├── __mocks__/
│       │   │   │       │   └── article.added.js
│       │   │   │       └── article.added.js
│       │   │   ├── middlewares/
│       │   │   │   ├── __mocks__/
│       │   │   │   │   └── jwt.js
│       │   │   │   └── jwt.js
│       │   │   ├── models/
│       │   │   │   ├── __mocks__/
│       │   │   │   │   └── article.model.js
│       │   │   │   └── article.model.js
│       │   │   ├── routes/
│       │   │   │   └── article.routes.js
│       │   │   └── server.js
│       │   └── tests/
│       │       └── unit/
│       │           ├── __snapshots__/
│       │           │   └── article.added.message.send.test.js.snap
│       │           ├── app.test.js
│       │           ├── article.added.message.send.test.js
│       │           ├── article.controller.test.js
│       │           ├── article.model.test.js
│       │           ├── article.routes.test.js
│       │           ├── config.test.js
│       │           └── server.test.js
│       ├── authentication/
│       │   ├── .dockerignore
│       │   ├── .eslintrc.yml
│       │   ├── .gitignore
│       │   ├── .gitkeep
│       │   ├── .snyk
│       │   ├── Dockerfile
│       │   ├── package.json
│       │   └── src/
│       │       ├── app.js
│       │       ├── controllers/
│       │       │   └── auth.controller.js
│       │       ├── environment/
│       │       │   └── config.js
│       │       ├── message-bus/
│       │       │   └── recieve/
│       │       │       └── user.added.js
│       │       ├── models/
│       │       │   └── auth.model.js
│       │       ├── routes/
│       │       │   └── auth.routes.js
│       │       └── server.js
│       ├── events-management/
│       │   ├── .dockerignore
│       │   ├── .eslintrc.yml
│       │   ├── .gitignore
│       │   ├── Dockerfile
│       │   ├── package.json
│       │   ├── src/
│       │   │   ├── app.js
│       │   │   ├── controllers/
│       │   │   │   ├── __mocks__/
│       │   │   │   │   └── event.controller.js
│       │   │   │   └── event.controller.js
│       │   │   ├── environment/
│       │   │   │   └── config.js
│       │   │   ├── middlewares/
│       │   │   │   ├── __mocks__/
│       │   │   │   │   └── jwt.js
│       │   │   │   └── jwt.js
│       │   │   ├── models/
│       │   │   │   ├── __mocks__/
│       │   │   │   │   └── event.model.js
│       │   │   │   └── event.model.js
│       │   │   ├── routes/
│       │   │   │   └── event.routes.js
│       │   │   └── server.js
│       │   └── tests/
│       │       └── unit/
│       │           ├── app.test.js
│       │           ├── config.test.js
│       │           ├── event.controller.test.js
│       │           ├── event.model.test.js
│       │           ├── event.routes.test.js
│       │           └── server.test.js
│       ├── media-management/
│       │   └── .gitkeep
│       ├── notification/
│       │   ├── .eslintrc.yml
│       │   ├── .gitignore
│       │   ├── Dockerfile
│       │   ├── __mocks__/
│       │   │   ├── amqp-ts-async.js
│       │   │   ├── koa.js
│       │   │   ├── nodemailer.js
│       │   │   └── winston.js
│       │   ├── package.json
│       │   ├── src/
│       │   │   ├── environment/
│       │   │   │   └── config.js
│       │   │   ├── message-controllers/
│       │   │   │   ├── __mocks__/
│       │   │   │   │   └── articles.js
│       │   │   │   └── articles.js
│       │   │   ├── modules/
│       │   │   │   └── email/
│       │   │   │       ├── __mocks__/
│       │   │   │       │   ├── email.js
│       │   │   │       │   └── email.templates.js
│       │   │   │       ├── email.js
│       │   │   │       └── email.templates.js
│       │   │   ├── server.js
│       │   │   └── subscriptions/
│       │   │       ├── __mocks__/
│       │   │       │   └── article.added.js
│       │   │       └── article.added.js
│       │   └── tests/
│       │       └── unit/
│       │           ├── __snapshots__/
│       │           │   ├── config.test.js.snap
│       │           │   ├── email.templates.test.js.snap
│       │           │   └── email.test.js.snap
│       │           ├── article.added.subscription.test.js
│       │           ├── article.message.controller.test.js
│       │           ├── config.test.js
│       │           ├── email.templates.test.js
│       │           ├── email.test.js
│       │           └── server.test.js
│       ├── search/
│       │   └── .gitkeep
│       └── user-management/
│           ├── .dockerignore
│           ├── .eslintrc.yml
│           ├── .gitignore
│           ├── .gitkeep
│           ├── Dockerfile
│           ├── __mocks__/
│           │   ├── amqp-ts-async.js
│           │   └── winston.js
│           ├── package.json
│           ├── src/
│           │   ├── app.js
│           │   ├── controllers/
│           │   │   ├── __mocks__/
│           │   │   │   └── user.controller.js
│           │   │   └── user.controller.js
│           │   ├── environment/
│           │   │   └── config.js
│           │   ├── message-bus/
│           │   │   └── send/
│           │   │       └── user.added.js
│           │   ├── middlewares/
│           │   │   ├── __mocks__/
│           │   │   │   └── jwt.js
│           │   │   └── jwt.js
│           │   ├── models/
│           │   │   ├── __mocks__/
│           │   │   │   └── user.model.js
│           │   │   └── user.model.js
│           │   ├── routes/
│           │   │   └── user.routes.js
│           │   └── server.js
│           └── tests/
│               └── unit/
│                   ├── __snapshots__/
│                   │   ├── user.added.message.send.test.js.snap
│                   │   └── user.controller.test.js.snap
│                   ├── app.test.js
│                   ├── config.test.js
│                   ├── server.test.js
│                   ├── user.added.message.send.test.js
│                   ├── user.controller.test.js
│                   ├── user.model.test.js
│                   └── user.routes.test.js
├── node js-with-serverless/
│   ├── .gitignore
│   ├── README.md
│   ├── functions/
│   │   ├── delete_item.ts
│   │   ├── edit_item.ts
│   │   ├── read_all.ts
│   │   ├── read_single_item.ts
│   │   └── write_item.ts
│   ├── models/
│   │   └── table_schema.ts
│   ├── package.json
│   ├── serverless.yml
│   └── shared/
│       ├── create_dynamo.ts
│       └── update_dynamo.ts
├── node-js-lambda-sqs-serverless/
│   ├── .gitignore
│   ├── README.md
│   ├── data.json
│   ├── db.js
│   ├── handler.js
│   ├── models/
│   │   └── note.js
│   ├── package.json
│   ├── serverless.yml
│   └── sqs.js
├── node-microservice-starter/
│   ├── .dockerignore
│   ├── .editorconfig
│   ├── .gitattributes
│   ├── .gitignore
│   ├── README.md
│   ├── docker-compose.yml
│   ├── nginx/
│   │   ├── Dockerfile
│   │   └── nginx.conf
│   └── users/
│       ├── .eslintrc.js
│       ├── .prettierrc
│       ├── Dockerfile
│       ├── README.md
│       ├── nest-cli.json
│       ├── package.json
│       ├── src/
│       │   ├── app.controller.spec.ts
│       │   ├── app.controller.ts
│       │   ├── app.module.ts
│       │   ├── app.service.ts
│       │   └── main.ts
│       ├── test/
│       │   ├── app.e2e-spec.ts
│       │   └── jest-e2e.json
│       ├── tsconfig.build.json
│       └── tsconfig.json
├── nodejs-cqrs-pattern/
│   ├── .dockerignore
│   ├── .gitignore
│   ├── Dockerfile
│   ├── README.md
│   ├── config.ts
│   ├── docker-compose.yml
│   ├── docs/
│   │   └── README.md
│   ├── githooks/
│   │   └── README.md
│   ├── nest-cli.json
│   ├── nodemon-debug.json
│   ├── nodemon.json
│   ├── package.json
│   ├── scripts/
│   │   ├── down.sh
│   │   └── up.sh
│   ├── src/
│   │   ├── app.module.ts
│   │   ├── core/
│   │   │   └── event-store/
│   │   │       ├── event-store.class.ts
│   │   │       ├── event-store.interface.ts
│   │   │       ├── event-store.module.ts
│   │   │       ├── event-store.provider.ts
│   │   │       └── event-store.ts
│   │   ├── main.ts
│   │   └── users/
│   │       ├── commands/
│   │       │   ├── handlers/
│   │       │   │   ├── create-user.handler.ts
│   │       │   │   ├── delete-user.handler.ts
│   │       │   │   ├── index.ts
│   │       │   │   ├── update-user.handler.ts
│   │       │   │   └── welcome-user.handler.ts
│   │       │   └── impl/
│   │       │       ├── create-user.command.ts
│   │       │       ├── delete-user.command.ts
│   │       │       ├── update-user.command.ts
│   │       │       └── welcome-user.command.ts
│   │       ├── controllers/
│   │       │   ├── users.controller.spec.ts
│   │       │   └── users.controller.ts
│   │       ├── dtos/
│   │       │   └── users.dto.ts
│   │       ├── events/
│   │       │   ├── handlers/
│   │       │   │   ├── index.ts
│   │       │   │   ├── user-created.handler.ts
│   │       │   │   ├── user-deleted.handler.ts
│   │       │   │   ├── user-updated.handler.ts
│   │       │   │   └── user-welcomed.handler.ts
│   │       │   └── impl/
│   │       │       ├── user-created.event.ts
│   │       │       ├── user-deleted.event.ts
│   │       │       ├── user-updated.event.ts
│   │       │       └── user-welcomed.event.ts
│   │       ├── models/
│   │       │   └── user.model.ts
│   │       ├── repository/
│   │       │   └── user.repository.ts
│   │       ├── sagas/
│   │       │   └── users.sagas.ts
│   │       ├── services/
│   │       │   └── users.service.ts
│   │       └── users.module.ts
│   ├── test/
│   │   ├── app.e2e-spec.ts
│   │   └── jest-e2e.json
│   ├── tsconfig.json
│   ├── tsconfig.spec.json
│   └── tslint.json
├── nodejs-express-typescript/
│   ├── .editorconfig
│   ├── .eslintignore
│   ├── .eslintrc.js
│   ├── .gitignore
│   ├── .prettierrc.json
│   ├── LICENSE
│   ├── Procfile
│   ├── README.md
│   ├── jest.config.js
│   ├── nodemon.json
│   ├── package.json
│   ├── src/
│   │   ├── api/
│   │   │   ├── index.ts
│   │   │   ├── middlewares/
│   │   │   │   ├── index.ts
│   │   │   │   └── isAuth.ts
│   │   │   └── routes/
│   │   │       └── auth.ts
│   │   ├── app.ts
│   │   ├── config/
│   │   │   └── index.ts
│   │   ├── interfaces/
│   │   │   └── IUser.ts
│   │   ├── loaders/
│   │   │   ├── dependencyInjector.ts
│   │   │   ├── express.ts
│   │   │   ├── index.ts
│   │   │   ├── logger.ts
│   │   │   └── mongoose.ts
│   │   ├── models/
│   │   │   └── user.ts
│   │   ├── services/
│   │   │   └── auth.ts
│   │   └── types/
│   │       └── express/
│   │           └── index.d.ts
│   ├── tests/
│   │   ├── .gitkeep
│   │   ├── sample.test.ts
│   │   └── services/
│   │       └── .gitkeep
│   └── tsconfig.json
├── nodejs-microservice-using-docker-Part-1/
│   ├── .gitignore
│   ├── .travis.yml
│   ├── docker-compose.yml
│   ├── nginx/
│   │   ├── Dockerfile
│   │   └── nginx.conf
│   └── server/
│       ├── .babelrc
│       ├── .editorconfig
│       ├── .gitignore
│       ├── .jshintrc
│       ├── .jshintrc-spec
│       ├── Dockerfile
│       ├── Procfile
│       ├── api/
│       │   ├── service/
│       │   │   ├── index.js
│       │   │   ├── index.spec.js
│       │   │   ├── service.controller.js
│       │   │   ├── service.events.js
│       │   │   ├── service.integration.js
│       │   │   ├── service.model.js
│       │   │   └── service.socket.js
│       │   └── utils.js
│       ├── app.js
│       ├── config/
│       │   ├── app.conf.js
│       │   ├── db.conf.js
│       │   ├── routes.conf.js
│       │   └── socket.conf.js
│       ├── gulpfile.babel.js
│       ├── index.js
│       ├── mocha.conf.js
│       └── package.json
└── nodejs-microservice-using-docker-Part-2/
    ├── .gitignore
    ├── docker-compose.yml
    ├── nginx/
    │   ├── Dockerfile
    │   ├── Dockerfile_custom
    │   └── nginx.conf
    ├── node/
    │   ├── Dockerfile
    │   ├── index.js
    │   ├── package.json
    │   └── test/
    │       └── dummyTest.js
    └── redis/
        └── Dockerfile

================================================
FILE CONTENTS
================================================

================================================
FILE: README.md
================================================
# nodejs-microservces-patterns
nodejs-microservces-patterns

- Simple Microservices Demo
- Simple Auth and Autnz setup
- CQRS Pattern
- Event Driven Design Pattern 

### Different examples for understanding node js with microservoces Patterns 

####  https://www.youtube.com/watch?v=_pO0sDeQrp0&list=PLIGDNOJWiL182j1bD_nQm-SxARR5s977O&ab_channel=CodeLabs


================================================
FILE: api-gateway-and-service-doscovery/.gitignore
================================================
node_modules
docs

node/node_modules
.DS_Store

node/npm-debug.log
.DS_Store


================================================
FILE: api-gateway-and-service-doscovery/README.md
================================================

#What is this?

This porject/turotial explains how to implement a NodeJs Api Gateway, into a Microservices Architecture based on a Service Registry developed with a server-side discovery pattern.

![ScreenShot](https://raw.github.com/alchimya/micro-node-api-gateway/master/Microservices_Architecture.png)

Actually, this project can be described as a complete Microservices Architecture containing four different microservices accessible via Api Gateway and discovered with a  Service Registry.

#How to setup and configure
To <b>setup</b> the project, it is enough to launch the the bash script <b/>ServicesSetup.sh</b>
<br/>
The <b>configuration</b> it is a bit tedious but it is very easy. In order you need to open all the <b>config.json</b> file that you will find in to each project folder (services and api-gateway) and setup the MondoDB configuration within the serviceRegistry object:

```javascript
  "serviceRegistry":{
      "watchDog":{
        "isEnabled":false,
        "timer":30000
      },
      "database":{
        "name":"my_mongo_db",
        "user":"my_mongo_db_user",
        "password":"my_mongo_db_password",
        "host":"my_mongo_db_host",
        "port":27017
      }
  }
```
A more dtailed description of the configuration is reported in to the section at the bottom of this document.

#How to use
To start all services you must launch the bash script <b>ServicesStart.sh</b>. This script will provide to launch five differente clustered instances of a Node server as reported below:
<br/>

Service         |Port 	     | Service Route | Api Gateway Ruote (8080)
----------------|------------|---------------|-------------------------
service-login		|	8081	     | /api/login	   | /api/account/login   
service-signup  |	8082	     | /api/signup	 | /api/account/signup         	      
service-orders	|	8084	     | /api/orders	 | /api/crm/orders    	      
service-log		  |	8084	     | /api/log	     |	     ----- 
api-gateway		  |	8080	     |   ----	       |	     ----- 

<br/>
For this tutorial, it is allowed to access directly (see Service Route) to the services, but, depending of your requirements, you can block this access, alllowing only the access via Api Gateway (see Api Gateway Ruote) that for this project is listening to the port 8080.

#Api Gateway Configuraiton 
Here, a detailed description of the <b>config.json</b> file for the Pai Gateway
```javascript
{
  "server":{
    "id":"MicroNodeApiGateway",
    "port":8080,
    "isCluster":true,
    "https":{
      "isEnabled":false,
      "key":"",
      "ca":""
    },
    "headers":[
      {"name":"Access-Control-Allow-Origin","value":"*"},
      {"name":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept"},
      {"name":"Access-Control-Allow-Methods","value":"GET,PUT,POST,DELETE,OPTIONS"}
    ]
  },
  "api":{
    "route":"api",
    "modules":[
      {"name":"login", "path":"api/account", "route":"account/login"},
      {"name":"signup", "path":"api/account", "route":"account/signup"},
      {"name":"orders", "path":"api/crm/orders", "route":"crm/orders"}
    ]
  },
  "services":[
      {"name":"ServiceLog", "endpointId":"log"},
      {"name":"ServiceLogin", "endpointId":"login"},
      {"name":"ServiceSignup", "endpointId":"signup"},
      {"name":"ServiceOrders", "endpointId":"orders"}
  ],
  "serviceRegistry":{
      "database":{
        "name":"my_mongo_db",
        "user":"my_mongo_db_user",
        "password":"my_mongo_db_password",
        "host":"my_mongo_db_host",
        "port":27017
      }
  }
}
```
where:
- server.id: it is a key to identify the microservice
- server.port: it is the port where the microservice is listen to
- server,isCluster: set true if you want you fork the main process depending of your CPU
- server.https: enable/disable the https. It is needed to have the righ certificates to allow clients to connect under https
- server.headers: put here all the response headers that you want to use, for example to enable the cross-origin resource sharing.

- api.route: defines the main route of the api (e.g. /api)
- api.modules: add in to this array all the module (js files for example Express middleware) that you want to use as api modules.
- api.services: add in to this array all the services that you want to implement with your Api Gateway using as service name and entry poin id, the same values used to register a microservice in to the service registry (see below Microservice Configuration and for more detail take a look to this project https://github.com/alchimya/micro-node-service/edit/master/README.md).

- serviceRegistry.watchDog: enable/disable the auto-update for the service registry. Speficy the update seconds into the timer property
- serviceRegistry.databse: configure here your MongoDb connection params. This database represents your Service Registry



#Microservice Configuraiton 
Here, a detailed description of the <b>config.json</b> file for a Microservice
```javascript
{
  "server":{
    "id":"MicroNodeService",
    "port":8080,
    "isCluster":true,
    "https":{
      "isEnabled":false,
      "key":"",
      "ca":""
    },
    "headers":[
      {"name":"Access-Control-Allow-Origin","value":"*"},
      {"name":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept"},
      {"name":"Access-Control-Allow-Methods","value":"GET,PUT,POST,DELETE,OPTIONS"}
    ]
  },
  "api":{
    "route":"api",
    "modules":[
      {"name":"login", "route":"login"}
    ]
  },
  "serviceRegistry":{
      "watchDog":{
        "isEnabled":false,
        "timer":30000
      },
      "database":{
        "name":"my_mongo_db",
        "user":"my_mongo_db_user",
        "password":"my_mongo_db_password",
        "host":"my_mongo_db_host",
        "port":27017
      }
  }
}
```
where:
- server.id: it is a key to identify the microservice
- server.port: it is the port where the microservice is listen to
- server,isCluster: set true if you want you fork the main process depending of your CPU
- server.https: enable/disable the https. It is needed to have the righ certificates to allow clients to connect under https
- server.headers: put here all the response headers that you want to use, for example to enable the cross-origin resource sharing.

- api.route: defines the main route of the api (e.g. /api)
- api.modules: add in to this array all the module (js files for example Express middleware) that you want to use as api modules

- serviceRegistry.watchDog: enable/disable the auto-update for the service registry. Speficy the update seconds into the timer property
- serviceRegistry.databse: configure here your MongoDb connection params. This database represents your Service Registry


![ScreenShot](https://raw.github.com/alchimya/micro-node-api-gateway/master/micro-node-api-gateway.gif)



================================================
FILE: api-gateway-and-service-doscovery/ServicesSetup.sh
================================================
cd service-login
sudo npm install

cd ..
cd service-orders
sudo npm install

cd ..
cd service-signup
sudo npm install

cd ..
cd service-log
sudo npm install

cd ..
cd api-gateway
sudo npm install

================================================
FILE: api-gateway-and-service-doscovery/ServicesStart.sh
================================================
cd service-login
DEBUG=http node server &

cd ..
cd service-orders
DEBUG=http node server &

cd ..
cd service-signup
DEBUG=http node server &

cd ..
cd service-log
DEBUG=http node server &

cd ..
cd api-gateway
DEBUG=http node server

================================================
FILE: api-gateway-and-service-doscovery/api-gateway/Dockerbuild.sh
================================================
docker build -t micro-node-service-api-gateway:latest .
winpty docker run -it --rm -p 8080:8080 --name micro-node-service-api-gateway micro-node-service-api-gateway:latest

================================================
FILE: api-gateway-and-service-doscovery/api-gateway/Dockerfile
================================================
FROM node:6.2.0-onbuild
EXPOSE 8080

================================================
FILE: api-gateway-and-service-doscovery/api-gateway/api/account/login.js
================================================
/**
 * Created by domenicovacchiano on 10/07/16.
 */

var express = require('express'),
    router = express.Router(),
    apiGateway = require('../.././api-gateway');

router.post('/', function (req, res,next) {
    var request = new apiGateway();
    request.sendRequest("ServiceLogin","login",req, res,next);
});

module.exports = router;

================================================
FILE: api-gateway-and-service-doscovery/api-gateway/api/account/signup.js
================================================
/**
 * Created by domenicovacchiano on 10/07/16.
 */

var express = require('express'),
    router = express.Router(),
    apiGateway = require('../.././api-gateway');

router.post('/', function (req, res,next) {
    var request = new apiGateway();
    request.sendRequest("ServiceSignup","signup",req, res,next);
});

module.exports = router;

================================================
FILE: api-gateway-and-service-doscovery/api-gateway/api/crm/orders/orders.js
================================================
/**
 * Created by domenicovacchiano on 10/07/16.
 */

var express = require('express'),
    router = express.Router(),
    apiGateway = require('../../.././api-gateway');

router.post('/', function (req, res,next) {
    var request = new apiGateway();
    request.sendRequest("ServiceOrders","orders",req, res,next);
});

module.exports = router;

================================================
FILE: api-gateway-and-service-doscovery/api-gateway/api-gateway.js
================================================
/**
 * Created by domenicovacchiano on 10/07/16.
 */

var debug = require('debug')('http'),
    config= require ('./config')(),
    request = require('request'),
    servicesHelper = require('./services-helper')(config.services),
    serviceRegistry = require ('micro-node-service-registry-lib')({
        name:config.serviceRegistry.database.name,
        user:config.serviceRegistry.database.user,
        password:config.serviceRegistry.database.password,
        host:config.serviceRegistry.database.host,
        port:config.serviceRegistry.database.port,
        connectionPool:config.serviceRegistry.database.connectionPool
    });

var ApiGateway = function () {
    
};


ApiGateway.prototype.sendRequest=function (serviceName,serviceEndpointId,req, res,next) {
    
    service=servicesHelper.getService(serviceName,serviceEndpointId);

    serviceRegistry.find(service.name,service.endpointId,function (error,service) {
        if (service && !error){
            console.log(service);
            request({
                url: service.endpointUrl,
                method: 'POST',
                json:req.body
            }, function(error, response, body){
                if (error){
                    return next(error)
                }else {
                    debug(body);
                    return res.status(response.statusCode).send(body);
                }
            });
        } else {
            if (error){
                return next(error);
            }else {
                return res.status(500).send(responseLib.errorResponse(1001,"Service not found","Application Error"));
            }

        }
    });
};

module.exports=ApiGateway;

================================================
FILE: api-gateway-and-service-doscovery/api-gateway/config.js
================================================
/**
 * Created by domenicovacchiano on 25/05/16.
 */

var fs = require('fs');

function Config() {
    var config = JSON.parse(fs.readFileSync(__dirname  + '/config.json'), 'utf8');
    return{
        server:{
            id:config.server.id,
            port:config.server.port,
            isCluster:config.server.isCluster,
            https:config.server.https,
            headers:config.server.headers,
            httpsKeyContent:config.server.https.key ? fs.readFileSync(__dirname  + "/" + config.server.https.key) :null,
            httpsCaContent:config.server.https.ca ? fs.readFileSync(__dirname  + "/" + config.server.https.ca) :null,
        },
        api:{
            route:config.api.route,
            modules:config.api.modules
        },
        services:config.services,
        serviceRegistry:config.serviceRegistry
    };

}
module.exports=Config;


================================================
FILE: api-gateway-and-service-doscovery/api-gateway/config.json
================================================
{
  "server":{
    "id":"MicroNodeApiGateway",
    "port":8080,
    "isCluster":true,
    "https":{
      "isEnabled":false,
      "key":"",
      "ca":""
    },
    "headers":[
      {"name":"Access-Control-Allow-Origin","value":"*"},
      {"name":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept"},
      {"name":"Access-Control-Allow-Methods","value":"GET,PUT,POST,DELETE,OPTIONS"}
    ]
  },
  "api":{
    "route":"api",
    "modules":[
      {"name":"login", "path":"api/account", "route":"account/login"},
      {"name":"signup", "path":"api/account", "route":"account/signup"},
      {"name":"orders", "path":"api/crm/orders", "route":"crm/orders"}
    ]
  },
  "services":[
      {"name":"ServiceLog", "endpointId":"log"},
      {"name":"ServiceLogin", "endpointId":"login"},
      {"name":"ServiceSignup", "endpointId":"signup"},
      {"name":"ServiceOrders", "endpointId":"orders"}
  ],
  "serviceRegistry":{
      "database":{
        "name":"test",
        "user":"",
        "password":"",
        "host":"192.168.29.43",
        "port":27017
      }
  }
}





================================================
FILE: api-gateway-and-service-doscovery/api-gateway/package.json
================================================
{
  "name": "DoorApiGateway",
  "version": "0.0.1",
  "description": "Api Gateway",
  "author": {
    "name": "Domenico Vacchiano",
    "email": "domenico@doorgames.com",
    "url": "http://www.doorgames.com"
  },
  "homepage": "http://www.doorgames.com/",
  "repository": {
    "type": "git",
    "url": ""
  },
  "engines": {
    "node": ">= 0.6.0",
    "npm": ">= 1.0.0"
  },
  "dependencies": {
    "express": "^4.13.4",
    "body-parser": "^1.15.1",
    "jsonwebtoken": "^7.0.0",
    "request": "^2.72.0",
    "morgan": "^1.7.0",
    "micro-node-net-lib": "git@github.com:alchimya/micro-node-net-lib.git",
    "micro-node-service-registry-lib": "git@github.com:alchimya/micro-node-service-registry-lib.git"
  },
  "private": true,
  "scripts": {
    "start": "node server.js"
  },
  "main": "server.js"
}


================================================
FILE: api-gateway-and-service-doscovery/api-gateway/server.js
================================================
/**
 * Created by domenicovacchiano on 10/07/16.
 */

var config= require ('./config')(),
    express=require('express'),
    debug = require('debug')('http'),
    bodyParser = require('body-parser'),
    morgan= require('morgan'),
    cluster = require('cluster'),
    numCPUs = require('os').cpus().length,
    netLib = require ('micro-node-net-lib'),
    apiGateway = require('./api-gateway'),
    configServer= {
        server:{
            port:config.server.port
        },
        https:{
            isEnabled:config.server.https.isEnabled,
            key:config.server.httpsKeyContent,
            ca:config.server.httpsCaContent
        },
        express:{
            app:null
        },
        exitHandlers:["exit","SIGINT","SIGTERM"]
    },
    server = netLib.server(configServer);

    if (cluster.isMaster && config.server.isCluster) {
        debug("cpus:" + numCPUs);
        for (var i = 0; i < numCPUs; i++) {
            cluster.fork();
        }
        cluster.on('exit', function(worker, code, signal) {
            console.log("cluster exit");
            debug('Worker %d died with code/signal %s. Restarting worker...', worker.process.pid, signal || code);
            cluster.fork();
        });
        
    } else {

        var app=express();
        app.use(bodyParser.urlencoded({ extended: true }));
        app.use(bodyParser.json());
        app.use(morgan('dev'));
        configServer.express.app = app;
        
        //header(s) setting
        app.all('/*', function(req, res, next) {
            config.server.headers.forEach(function(item) {
                //console.log(item);
                res.header(item.name, item.value);
            });
            next();
        });

        //pu here a middleware to check the api key
        

        //load API route(s)
        config.api.modules.forEach(function(item) {
            //console.log(item);
            app.use('/' + config.api.route + "/" + item.route, require('./' + item.path + "/" +  item.name));
        });
        
        server.create(function (err,server) {
            if (!err){
                console.log("### " + config.server.id + " -> " + (config.server.https ? "HTTPS" : "HTTP") + " Server started on port " +
                    config.server.port + (config.server.isCluster ? " cluster worker " + cluster.worker.id : ""));
            } else {
                debug(err);
            }
        });
        

        //Http Error Handling on
        app.use(function(err, req, res, next) {
            debug(err);
            var request = new apiGateway();
            request.sendRequest("ServiceLog","log",req, res,next);
            res.status(500).send({
                code:1000,
                message:"Application Error",
                domain:"Application Error"
            });
        });
    }

================================================
FILE: api-gateway-and-service-doscovery/api-gateway/services-helper.js
================================================
/**
 * Created by domenicovacchiano on 11/07/16.
 */

function ServiceHelper(services) {
    return{
        getServiceWithName:function (serviceName) {
            var service=services.filter(function( item ) {
                return item.name == serviceName;
            });
            if (!service || !service[0] || service[0].length==0){
                return null;
            }
            return service[0];
        },
        getService:function (serviceName,serviceEndpointId) {
            var service=services.filter(function( item ) {
                return (item.name == serviceName && item.endpointId == serviceEndpointId);
            });
            if (!service || !service[0] || service[0].length==0){
                return null;
            }
            return service[0];
        }
    };
};

module.exports=ServiceHelper;

================================================
FILE: api-gateway-and-service-doscovery/service-log/Dockerbuild.sh
================================================
docker build -t micro-node-service-log:latest .
winpty docker run -it --rm -p 8084:8084 --name micro-node-service-log micro-node-service-log:latest

================================================
FILE: api-gateway-and-service-doscovery/service-log/Dockerfile
================================================
FROM node:6.2.0-onbuild
EXPOSE 8084

================================================
FILE: api-gateway-and-service-doscovery/service-log/config.js
================================================
/**
 * Created by domenicovacchiano on 07/07/16.
 */

var fs = require('fs');

function Config() {
    var config = JSON.parse(fs.readFileSync(__dirname  + '/config.json'), 'utf8');
    return{
        server:{
            id:config.server.id,
            port:config.server.port,
            isCluster:config.server.isCluster,
            https:config.server.https,
            headers:config.server.headers,
            httpsKeyContent:config.server.https.key ? fs.readFileSync(__dirname  + "/" + config.server.https.key) :null,
            httpsCaContent:config.server.https.ca ? fs.readFileSync(__dirname  + "/" + config.server.https.ca) :null,
        },
        api:{
            route:config.api.route,
            modules:config.api.modules
        },
        serviceRegistry:config.serviceRegistry
        
    };

}
module.exports=Config;


================================================
FILE: api-gateway-and-service-doscovery/service-log/config.json
================================================
{
  "server":{
    "id":"ServiceLog",
    "port":8084,
    "isCluster":true,
    "https":{
      "isEnabled":false,
      "key":"",
      "ca":""
    },
    "headers":[
      {"name":"Access-Control-Allow-Origin","value":"*"},
      {"name":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept"},
      {"name":"Access-Control-Allow-Methods","value":"GET,PUT,POST,DELETE,OPTIONS"}
    ]
  },
  "api":{
    "route":"api",
    "modules":[
      {"name":"log", "route":"log"}
    ]
  },
  "serviceRegistry":{
      "watchDog":{
        "isEnabled":false,
        "timer":30000
      },
    "database":{
      "name":"my_mongo_db",
      "user":"my_mongo_db_user",
      "password":"my_mongo_db_password",
      "host":"my_mongo_db_host",
      "port":27017
    }
  }
}


================================================
FILE: api-gateway-and-service-doscovery/service-log/log.js
================================================
/**
 * Created by domenicovacchiano on 07/07/16.
 */

var express = require('express'),
    router = express.Router(),
    debug = require('debug')('http'),
    config= require ('./config')()

router.post('/', function (req, res,next) {
    return res.status(200).send("## Log -> This is just a test response ;-)");
});

module.exports = router;

================================================
FILE: api-gateway-and-service-doscovery/service-log/package.json
================================================
{
  "name": "MicroNodeService",
  "version": "0.0.1",
  "description": "Micro Node Tutorial",
  "author": {
    "name": "Domenico Vacchiano",
    "email": "info@domenicovacchiano.com",
    "url": "http://www.domenicovacchiano.com"
  },
  "homepage": "http://www.domenicovacchiano.com/",
  "repository": {
    "type": "git",
    "url": ""
  },
  "engines": {
    "node": ">= 0.6.0",
    "npm": ">= 1.0.0"
  },
  "dependencies": {
    "express": "^4.13.4",
    "body-parser": "^1.15.1",
    "request": "^2.72.0",
    "morgan": "^1.7.0",
    "network-address": "^1.1.0",
    "micro-node-net-lib": "git@github.com:alchimya/micro-node-net-lib.git",
    "micro-node-service-registry-lib": "git@github.com:alchimya/micro-node-service-registry-lib.git"
  },
  "private": true,
  "scripts": {
    "start": "node server.js"
  },
  "main": "server.js"
}


================================================
FILE: api-gateway-and-service-doscovery/service-log/server.js
================================================
/**
 * Created by domenicovacchiano on 07/07/16.
 */

var config= require ('./config')(),
    address = require('network-address'),
    express=require('express'),
    debug = require('debug')('http'),
    bodyParser = require('body-parser'),
    morgan= require('morgan'),
    cluster = require('cluster'),
    numCPUs = require('os').cpus().length,
    netLib = require ('micro-node-net-lib'),
    configServer= {
        server:{
            port:config.server.port
        },
        https:{
            isEnabled:config.server.https.isEnabled,
            key:config.server.httpsKeyContent,
            ca:config.server.httpsCaContent
        },
        express:{
            app:null
        },
        exitHandlers:["exit","SIGINT","SIGTERM"]
    }
    server = netLib.server(configServer),
    serviceRegistry = require ('micro-node-service-registry-lib')({
        name:config.serviceRegistry.database.name,
        user:config.serviceRegistry.database.user,
        password:config.serviceRegistry.database.password,
        host:config.serviceRegistry.database.host,
        port:config.serviceRegistry.database.port,
        connectionPool:config.serviceRegistry.database.connectionPool
    });

    if (cluster.isMaster && config.server.isCluster) {

        debug("cpus:" + numCPUs);
        for (var i = 0; i < numCPUs; i++) {
            cluster.fork();
        }
        cluster.on('exit', function(worker, code, signal) {
            console.log("cluster exit");
            debug('Worker %d died with code/signal %s. Restarting worker...', worker.process.pid, signal || code);
            cluster.fork();
        });

    } else {
        
        var app=express();
        app.use(bodyParser.urlencoded({ extended: true }));
        app.use(bodyParser.json());
        app.use(morgan('dev'));
        configServer.express.app = app;
        
        //header(s) setting
        app.all('/*', function(req, res, next) {
            config.server.headers.forEach(function(item) {
                //console.log(item);
                res.header(item.name, item.value);
            });
            next();
        });

        //load API route(s)
        config.api.modules.forEach(function(item) {
            //console.log(item);
            app.use('/' + config.api.route + "/" + item.route, require('./' + item.name));
        });
        
        server.create(function (err,server) {
            if (!err){
                //load API route(s) and register services
                registerServer();
                if (config.serviceRegistry.watchDog.isEnabled){
                    setInterval(function(){
                        registerServer();
                    }, config.serviceRegistry.watchDog.timer);
                }
                console.log("### " + config.server.id + " -> " + (config.server.https ? "HTTPS" : "HTTP") + " Server started on port " +
                    config.server.port + (config.server.isCluster ? " cluster worker " + cluster.worker.id : ""));
            } else {
                debug(err);
            }
        });

        server.registerExitHandler(function () {
            unregisterServer();
            debug("Server Exit Handled");
        });

        var registerServer=function () {
            if (!config.server.isCluster || cluster.worker.id===1){
                debug("registerServer");
                config.api.modules.forEach(function(item) {
                    //console.log(item);
                    app.use('/' + config.api.route + "/" + item.route, require('./' + item.name));
                    serviceRegistry.register({
                        serviceId:config.server.id,
                        serviceHost:address(),
                        servicePort:config.server.port,
                        serviceProtocol:config.server.https.isEnabled ? "https" : "http",
                        endpointId:item.name,
                        endpointPath:config.api.route + "/" + item.route
                    }, function (err,item) {
                        if (err){
                            console.log(app.next())
                            debug(err);
                        }
                    });
                });
            }
        };
        var unregisterServer = function () {
            if (!config.server.isCluster || cluster.worker.id===1){
                debug("unregisterServer");
                config.api.modules.forEach(function(item) {
                    serviceRegistry.unregister(config.server.id,item.name,function (err,item) {
                        if (err){
                            //TODO update flag inactive?
                            console.log(err);
                        }
                        if (!config.server.isCluster){
                            process.exit();
                        }
                    });
                });
            }
        };
  

        
    }


================================================
FILE: api-gateway-and-service-doscovery/service-login/Dockerbuild.sh
================================================
docker build -t micro-node-service-login:latest .
winpty docker run -it --rm -p 8081:8081 --name micro-node-service-login micro-node-service-login:latest

================================================
FILE: api-gateway-and-service-doscovery/service-login/Dockerfile
================================================
FROM node:6.2.0-onbuild
EXPOSE 8081

================================================
FILE: api-gateway-and-service-doscovery/service-login/config.js
================================================
/**
 * Created by domenicovacchiano on 07/07/16.
 */

var fs = require('fs');

function Config() {
    var config = JSON.parse(fs.readFileSync(__dirname  + '/config.json'), 'utf8');
    return{
        server:{
            id:config.server.id,
            port:config.server.port,
            isCluster:config.server.isCluster,
            https:config.server.https,
            headers:config.server.headers,
            httpsKeyContent:config.server.https.key ? fs.readFileSync(__dirname  + "/" + config.server.https.key) :null,
            httpsCaContent:config.server.https.ca ? fs.readFileSync(__dirname  + "/" + config.server.https.ca) :null,
        },
        api:{
            route:config.api.route,
            modules:config.api.modules
        },
        serviceRegistry:config.serviceRegistry
        
    };

}
module.exports=Config;


================================================
FILE: api-gateway-and-service-doscovery/service-login/config.json
================================================
{
  "server":{
    "id":"ServiceLogin",
    "port":8081,
    "isCluster":true,
    "https":{
      "isEnabled":false,
      "key":"",
      "ca":""
    },
    "headers":[
      {"name":"Access-Control-Allow-Origin","value":"*"},
      {"name":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept"},
      {"name":"Access-Control-Allow-Methods","value":"GET,PUT,POST,DELETE,OPTIONS"}
    ]
  },
  "api":{
    "route":"api",
    "modules":[
      {"name":"login", "route":"login"}
    ]
  },
  "serviceRegistry":{
      "watchDog":{
        "isEnabled":false,
        "timer":30000
      },
    "database":{
      "name":"my_mongo_db",
      "user":"my_mongo_db_user",
      "password":"my_mongo_db_password",
      "host":"my_mongo_db_host",
      "port":27017
    }
  }
}





================================================
FILE: api-gateway-and-service-doscovery/service-login/login.js
================================================
/**
 * Created by domenicovacchiano on 07/07/16.
 */

var express = require('express'),
    router = express.Router(),
    debug = require('debug')('http'),
    config= require ('./config')()

router.post('/', function (req, res,next) {
    return res.status(200).send("## Login -> This is just a test response ;-)");
});

module.exports = router;

================================================
FILE: api-gateway-and-service-doscovery/service-login/package.json
================================================
{
  "name": "MicroNodeService",
  "version": "0.0.1",
  "description": "Micro Node Tutorial",
  "author": {
    "name": "Domenico Vacchiano",
    "email": "info@domenicovacchiano.com",
    "url": "http://www.domenicovacchiano.com"
  },
  "homepage": "http://www.domenicovacchiano.com/",
  "repository": {
    "type": "git",
    "url": ""
  },
  "engines": {
    "node": ">= 0.6.0",
    "npm": ">= 1.0.0"
  },
  "dependencies": {
    "express": "^4.13.4",
    "body-parser": "^1.15.1",
    "request": "^2.72.0",
    "morgan": "^1.7.0",
    "network-address": "^1.1.0",
    "micro-node-net-lib": "git@github.com:alchimya/micro-node-net-lib.git",
    "micro-node-service-registry-lib": "git@github.com:alchimya/micro-node-service-registry-lib.git"
  },
  "private": true,
  "scripts": {
    "start": "node server.js"
  },
  "main": "server.js"
}


================================================
FILE: api-gateway-and-service-doscovery/service-login/server.js
================================================
/**
 * Created by domenicovacchiano on 07/07/16.
 */

var config= require ('./config')(),
    address = require('network-address'),
    express=require('express'),
    debug = require('debug')('http'),
    bodyParser = require('body-parser'),
    morgan= require('morgan'),
    cluster = require('cluster'),
    numCPUs = require('os').cpus().length,
    netLib = require ('micro-node-net-lib'),
    configServer= {
        server:{
            port:config.server.port
        },
        https:{
            isEnabled:config.server.https.isEnabled,
            key:config.server.httpsKeyContent,
            ca:config.server.httpsCaContent
        },
        express:{
            app:null
        },
        exitHandlers:["exit","SIGINT","SIGTERM"]
    }
    server = netLib.server(configServer),
    serviceRegistry = require ('micro-node-service-registry-lib')({
        name:config.serviceRegistry.database.name,
        user:config.serviceRegistry.database.user,
        password:config.serviceRegistry.database.password,
        host:config.serviceRegistry.database.host,
        port:config.serviceRegistry.database.port,
        connectionPool:config.serviceRegistry.database.connectionPool
    });

    if (cluster.isMaster && config.server.isCluster) {

        debug("cpus:" + numCPUs);
        for (var i = 0; i < numCPUs; i++) {
            cluster.fork();
        }
        cluster.on('exit', function(worker, code, signal) {
            console.log("cluster exit");
            debug('Worker %d died with code/signal %s. Restarting worker...', worker.process.pid, signal || code);
            cluster.fork();
        });

    } else {
        
        var app=express();
        app.use(bodyParser.urlencoded({ extended: true }));
        app.use(bodyParser.json());
        app.use(morgan('dev'));
        configServer.express.app = app;
        
        //header(s) setting
        app.all('/*', function(req, res, next) {
            config.server.headers.forEach(function(item) {
                //console.log(item);
                res.header(item.name, item.value);
            });
            next();
        });

        //load API route(s)
        config.api.modules.forEach(function(item) {
            //console.log(item);
            app.use('/' + config.api.route + "/" + item.route, require('./' + item.name));
        });
        
        server.create(function (err,server) {
            if (!err){
                //load API route(s) and register services
                registerServer();
                if (config.serviceRegistry.watchDog.isEnabled){
                    setInterval(function(){
                        registerServer();
                    }, config.serviceRegistry.watchDog.timer);
                }
                console.log("### " + config.server.id + " -> " + (config.server.https ? "HTTPS" : "HTTP") + " Server started on port " +
                    config.server.port + (config.server.isCluster ? " cluster worker " + cluster.worker.id : ""));
            } else {
                debug(err);
            }
        });

        server.registerExitHandler(function () {
            unregisterServer();
            debug("Server Exit Handled");
        });

        var registerServer=function () {
            if (!config.server.isCluster || cluster.worker.id===1){
                debug("registerServer");
                config.api.modules.forEach(function(item) {
                    //console.log(item);
                    app.use('/' + config.api.route + "/" + item.route, require('./' + item.name));
                    serviceRegistry.register({
                        serviceId:config.server.id,
                        serviceHost:address(),
                        servicePort:config.server.port,
                        serviceProtocol:config.server.https.isEnabled ? "https" : "http",
                        endpointId:item.name,
                        endpointPath:config.api.route + "/" + item.route
                    }, function (err,item) {
                        if (err){
                            console.log(app.next())
                            debug(err);
                        }
                    });
                });
            }
        };
        var unregisterServer = function () {
            if (!config.server.isCluster || cluster.worker.id===1){
                debug("unregisterServer");
                config.api.modules.forEach(function(item) {
                    serviceRegistry.unregister(config.server.id,item.name,function (err,item) {
                        if (err){
                            //TODO update flag inactive?
                            console.log(err);
                        }
                        if (!config.server.isCluster){
                            process.exit();
                        }
                    });
                });
            }
        };
        
        
    }


================================================
FILE: api-gateway-and-service-doscovery/service-orders/Dockerbuild.sh
================================================
docker build -t micro-node-service-orders:latest .
winpty docker run -it --rm -p 8083:8083 --name micro-node-service-orders micro-node-service-orders:latest

================================================
FILE: api-gateway-and-service-doscovery/service-orders/Dockerfile
================================================
FROM node:6.2.0-onbuild
EXPOSE 8083

================================================
FILE: api-gateway-and-service-doscovery/service-orders/config.js
================================================
/**
 * Created by domenicovacchiano on 07/07/16.
 */

var fs = require('fs');

function Config() {
    var config = JSON.parse(fs.readFileSync(__dirname  + '/config.json'), 'utf8');
    return{
        server:{
            id:config.server.id,
            port:config.server.port,
            isCluster:config.server.isCluster,
            https:config.server.https,
            headers:config.server.headers,
            httpsKeyContent:config.server.https.key ? fs.readFileSync(__dirname  + "/" + config.server.https.key) :null,
            httpsCaContent:config.server.https.ca ? fs.readFileSync(__dirname  + "/" + config.server.https.ca) :null,
        },
        api:{
            route:config.api.route,
            modules:config.api.modules
        },
        serviceRegistry:config.serviceRegistry
        
    };

}
module.exports=Config;


================================================
FILE: api-gateway-and-service-doscovery/service-orders/config.json
================================================
{
  "server":{
    "id":"ServiceOrders",
    "port":8083,
    "isCluster":true,
    "https":{
      "isEnabled":false,
      "key":"",
      "ca":""
    },
    "headers":[
      {"name":"Access-Control-Allow-Origin","value":"*"},
      {"name":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept"},
      {"name":"Access-Control-Allow-Methods","value":"GET,PUT,POST,DELETE,OPTIONS"}
    ]
  },
  "api":{
    "route":"api",
    "modules":[
      {"name":"orders", "route":"orders"}
    ]
  },
  "serviceRegistry":{
      "watchDog":{
        "isEnabled":false,
        "timer":30000
      },
    "database":{
      "name":"my_mongo_db",
      "user":"my_mongo_db_user",
      "password":"my_mongo_db_password",
      "host":"my_mongo_db_host",
      "port":27017
    }
  }
}





================================================
FILE: api-gateway-and-service-doscovery/service-orders/orders.js
================================================
/**
 * Created by domenicovacchiano on 07/07/16.
 */

var express = require('express'),
    router = express.Router(),
    debug = require('debug')('http'),
    config= require ('./config')()

router.post('/', function (req, res,next) {
    return res.status(200).send("## Orders -> This is just a test response ;-)");
});

module.exports = router;

================================================
FILE: api-gateway-and-service-doscovery/service-orders/package.json
================================================
{
  "name": "MicroNodeService",
  "version": "0.0.1",
  "description": "Micro Node Tutorial",
  "author": {
    "name": "Domenico Vacchiano",
    "email": "info@domenicovacchiano.com",
    "url": "http://www.domenicovacchiano.com"
  },
  "homepage": "http://www.domenicovacchiano.com/",
  "repository": {
    "type": "git",
    "url": ""
  },
  "engines": {
    "node": ">= 0.6.0",
    "npm": ">= 1.0.0"
  },
  "dependencies": {
    "express": "^4.13.4",
    "body-parser": "^1.15.1",
    "request": "^2.72.0",
    "morgan": "^1.7.0",
    "network-address": "^1.1.0",
    "micro-node-net-lib": "git@github.com:alchimya/micro-node-net-lib.git",
    "micro-node-service-registry-lib": "git@github.com:alchimya/micro-node-service-registry-lib.git"
  },
  "private": true,
  "scripts": {
    "start": "node server.js"
  },
  "main": "server.js"
}


================================================
FILE: api-gateway-and-service-doscovery/service-orders/server.js
================================================
/**
 * Created by domenicovacchiano on 07/07/16.
 */

var config= require ('./config')(),
    address = require('network-address'),
    express=require('express'),
    debug = require('debug')('http'),
    bodyParser = require('body-parser'),
    morgan= require('morgan'),
    cluster = require('cluster'),
    numCPUs = require('os').cpus().length,
    netLib = require ('micro-node-net-lib'),
    configServer= {
        server:{
            port:config.server.port
        },
        https:{
            isEnabled:config.server.https.isEnabled,
            key:config.server.httpsKeyContent,
            ca:config.server.httpsCaContent
        },
        express:{
            app:null
        },
        exitHandlers:["exit","SIGINT","SIGTERM"]
    }
    server = netLib.server(configServer),
    serviceRegistry = require ('micro-node-service-registry-lib')({
        name:config.serviceRegistry.database.name,
        user:config.serviceRegistry.database.user,
        password:config.serviceRegistry.database.password,
        host:config.serviceRegistry.database.host,
        port:config.serviceRegistry.database.port,
        connectionPool:config.serviceRegistry.database.connectionPool
    });

    if (cluster.isMaster && config.server.isCluster) {

        debug("cpus:" + numCPUs);
        for (var i = 0; i < numCPUs; i++) {
            cluster.fork();
        }
        cluster.on('exit', function(worker, code, signal) {
            console.log("cluster exit");
            debug('Worker %d died with code/signal %s. Restarting worker...', worker.process.pid, signal || code);
            cluster.fork();
        });

    } else {
        
        var app=express();
        app.use(bodyParser.urlencoded({ extended: true }));
        app.use(bodyParser.json());
        app.use(morgan('dev'));
        configServer.express.app = app;
        
        //header(s) setting
        app.all('/*', function(req, res, next) {
            config.server.headers.forEach(function(item) {
                //console.log(item);
                res.header(item.name, item.value);
            });
            next();
        });

        //load API route(s)
        config.api.modules.forEach(function(item) {
            //console.log(item);
            app.use('/' + config.api.route + "/" + item.route, require('./' + item.name));
        });
        
        server.create(function (err,server) {
            if (!err){
                //load API route(s) and register services
                registerServer();
                if (config.serviceRegistry.watchDog.isEnabled){
                    setInterval(function(){
                        registerServer();
                    }, config.serviceRegistry.watchDog.timer);
                }
                console.log("### " + config.server.id + " -> " + (config.server.https ? "HTTPS" : "HTTP") + " Server started on port " +
                    config.server.port + (config.server.isCluster ? " cluster worker " + cluster.worker.id : ""));
            } else {
                debug(err);
            }
        });

        server.registerExitHandler(function () {
            unregisterServer();
            debug("Server Exit Handled");
        });

        var registerServer=function () {
            if (!config.server.isCluster || cluster.worker.id===1){
                debug("registerServer");
                config.api.modules.forEach(function(item) {
                    //console.log(item);
                    app.use('/' + config.api.route + "/" + item.route, require('./' + item.name));
                    serviceRegistry.register({
                        serviceId:config.server.id,
                        serviceHost:address(),
                        servicePort:config.server.port,
                        serviceProtocol:config.server.https.isEnabled ? "https" : "http",
                        endpointId:item.name,
                        endpointPath:config.api.route + "/" + item.route
                    }, function (err,item) {
                        if (err){
                            console.log(app.next())
                            debug(err);
                        }
                    });
                });
            }
        };
        var unregisterServer = function () {
            if (!config.server.isCluster || cluster.worker.id===1){
                debug("unregisterServer");
                config.api.modules.forEach(function(item) {
                    serviceRegistry.unregister(config.server.id,item.name,function (err,item) {
                        if (err){
                            //TODO update flag inactive?
                            console.log(err);
                        }
                        if (!config.server.isCluster){
                            process.exit();
                        }
                    });
                });
            }
        };
  

    }


================================================
FILE: api-gateway-and-service-doscovery/service-signup/Dockerbuild.sh
================================================
docker build -t micro-node-service-signup:latest .
winpty docker run -it --rm -p 8082:8082 --name micro-node-service-signup micro-node-service-signup:latest

================================================
FILE: api-gateway-and-service-doscovery/service-signup/Dockerfile
================================================
FROM node:6.2.0-onbuild
EXPOSE 8082

================================================
FILE: api-gateway-and-service-doscovery/service-signup/config.js
================================================
/**
 * Created by domenicovacchiano on 07/07/16.
 */

var fs = require('fs');

function Config() {
    var config = JSON.parse(fs.readFileSync(__dirname  + '/config.json'), 'utf8');
    return{
        server:{
            id:config.server.id,
            port:config.server.port,
            isCluster:config.server.isCluster,
            https:config.server.https,
            headers:config.server.headers,
            httpsKeyContent:config.server.https.key ? fs.readFileSync(__dirname  + "/" + config.server.https.key) :null,
            httpsCaContent:config.server.https.ca ? fs.readFileSync(__dirname  + "/" + config.server.https.ca) :null,
        },
        api:{
            route:config.api.route,
            modules:config.api.modules
        },
        serviceRegistry:config.serviceRegistry
        
    };

}
module.exports=Config;


================================================
FILE: api-gateway-and-service-doscovery/service-signup/config.json
================================================
{
  "server":{
    "id":"ServiceSignup",
    "port":8082,
    "isCluster":true,
    "https":{
      "isEnabled":false,
      "key":"",
      "ca":""
    },
    "headers":[
      {"name":"Access-Control-Allow-Origin","value":"*"},
      {"name":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept"},
      {"name":"Access-Control-Allow-Methods","value":"GET,PUT,POST,DELETE,OPTIONS"}
    ]
  },
  "api":{
    "route":"api",
    "modules":[
      {"name":"signup", "route":"signup"}
    ]
  },
  "serviceRegistry":{
      "watchDog":{
        "isEnabled":false,
        "timer":30000
      },
    "database":{
      "name":"my_mongo_db",
      "user":"my_mongo_db_user",
      "password":"my_mongo_db_password",
      "host":"my_mongo_db_host",
      "port":27017
    }
  }
}





================================================
FILE: api-gateway-and-service-doscovery/service-signup/package.json
================================================
{
  "name": "MicroNodeService",
  "version": "0.0.1",
  "description": "Micro Node Tutorial",
  "author": {
    "name": "Domenico Vacchiano",
    "email": "info@domenicovacchiano.com",
    "url": "http://www.domenicovacchiano.com"
  },
  "homepage": "http://www.domenicovacchiano.com/",
  "repository": {
    "type": "git",
    "url": ""
  },
  "engines": {
    "node": ">= 0.6.0",
    "npm": ">= 1.0.0"
  },
  "dependencies": {
    "express": "^4.13.4",
    "body-parser": "^1.15.1",
    "request": "^2.72.0",
    "morgan": "^1.7.0",
    "network-address": "^1.1.0",
    "micro-node-net-lib": "git@github.com:alchimya/micro-node-net-lib.git",
    "micro-node-service-registry-lib": "git@github.com:alchimya/micro-node-service-registry-lib.git"
  },
  "private": true,
  "scripts": {
    "start": "node server.js"
  },
  "main": "server.js"
}


================================================
FILE: api-gateway-and-service-doscovery/service-signup/server.js
================================================
/**
 * Created by domenicovacchiano on 07/07/16.
 */

var config= require ('./config')(),
    address = require('network-address'),
    express=require('express'),
    debug = require('debug')('http'),
    bodyParser = require('body-parser'),
    morgan= require('morgan'),
    cluster = require('cluster'),
    numCPUs = require('os').cpus().length,
    netLib = require ('micro-node-net-lib'),
    configServer= {
        server:{
            port:config.server.port
        },
        https:{
            isEnabled:config.server.https.isEnabled,
            key:config.server.httpsKeyContent,
            ca:config.server.httpsCaContent
        },
        express:{
            app:null
        },
        exitHandlers:["exit","SIGINT","SIGTERM"]
    }
    server = netLib.server(configServer),
    serviceRegistry = require ('micro-node-service-registry-lib')({
        name:config.serviceRegistry.database.name,
        user:config.serviceRegistry.database.user,
        password:config.serviceRegistry.database.password,
        host:config.serviceRegistry.database.host,
        port:config.serviceRegistry.database.port,
        connectionPool:config.serviceRegistry.database.connectionPool
    });

    if (cluster.isMaster && config.server.isCluster) {

        debug("cpus:" + numCPUs);
        for (var i = 0; i < numCPUs; i++) {
            cluster.fork();
        }
        cluster.on('exit', function(worker, code, signal) {
            console.log("cluster exit");
            debug('Worker %d died with code/signal %s. Restarting worker...', worker.process.pid, signal || code);
            cluster.fork();
        });

    } else {
        
        var app=express();
        app.use(bodyParser.urlencoded({ extended: true }));
        app.use(bodyParser.json());
        app.use(morgan('dev'));
        configServer.express.app = app;
        
        //header(s) setting
        app.all('/*', function(req, res, next) {
            config.server.headers.forEach(function(item) {
                //console.log(item);
                res.header(item.name, item.value);
            });
            next();
        });

        //load API route(s)
        config.api.modules.forEach(function(item) {
            //console.log(item);
            app.use('/' + config.api.route + "/" + item.route, require('./' + item.name));
        });

        server.create(function (err,server) {
            if (!err){
                //load API route(s) and register services
                registerServer();
                if (config.serviceRegistry.watchDog.isEnabled){
                    setInterval(function(){
                        registerServer();
                    }, config.serviceRegistry.watchDog.timer);
                }
                console.log("### " + config.server.id + " -> " + (config.server.https ? "HTTPS" : "HTTP") + " Server started on port " +
                    config.server.port + (config.server.isCluster ? " cluster worker " + cluster.worker.id : ""));
            } else {
                debug(err);
            }
        });

        server.registerExitHandler(function () {
            unregisterServer();
            debug("Server Exit Handled");
        });

        var registerServer=function () {
            if (!config.server.isCluster || cluster.worker.id===1){
                debug("registerServer");
                config.api.modules.forEach(function(item) {
                    //console.log(item);
                    app.use('/' + config.api.route + "/" + item.route, require('./' + item.name));
                    serviceRegistry.register({
                        serviceId:config.server.id,
                        serviceHost:address(),
                        servicePort:config.server.port,
                        serviceProtocol:config.server.https.isEnabled ? "https" : "http",
                        endpointId:item.name,
                        endpointPath:config.api.route + "/" + item.route
                    }, function (err,item) {
                        if (err){
                            console.log(app.next())
                            debug(err);
                        }
                    });
                });
            }
        };
        var unregisterServer = function () {
            if (!config.server.isCluster || cluster.worker.id===1){
                debug("unregisterServer");
                config.api.modules.forEach(function(item) {
                    serviceRegistry.unregister(config.server.id,item.name,function (err,item) {
                        if (err){
                            //TODO update flag inactive?
                            console.log(err);
                        }
                        if (!config.server.isCluster){
                            process.exit();
                        }
                    });
                });
            }
        };
        
        
    }


================================================
FILE: api-gateway-and-service-doscovery/service-signup/signup.js
================================================
/**
 * Created by domenicovacchiano on 07/07/16.
 */

var express = require('express'),
    router = express.Router(),
    debug = require('debug')('http'),
    config= require ('./config')()

router.post('/', function (req, res,next) {
    return res.status(200).send("## Signup -> This is just a test response ;-)");
});

module.exports = router;

================================================
FILE: dockerized-containers/.eslintrc.js
================================================
module.exports = {
  "extends": "airbnb-base",
  "rules": {
      "comma-dangle": 0,
      "no-console": 0,
      "no-unused-vars" :0
    }
};

================================================
FILE: dockerized-containers/.gitignore
================================================
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
logs
*.log
npm-debug.log*
/dist
.vscode
/test
/*/dist
# Runtime data
pids
*.pid
/node_modules
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages
package-lock.json
# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# Jetbrains dir
.idea/
.DS_Store

# github dir
.github/

# .env files
bin/dev.env
bin/test.env


================================================
FILE: dockerized-containers/.travis.yml
================================================
language: node_js
sudo: false
node_js:
  - 10
install:
  - npm install
script:
  - npm test

================================================
FILE: dockerized-containers/README.md
================================================
# Application for e-commerce Hub


REST API to support application features
  - Express as web framework with Typescript
  - Passport js for social authentication 
  - Express CORS enabled
  - boom for error codes & Joi for Validation
  - Winston for logging and express minitor for monitoring
  - Mongoose as ODM driver
  - eslint validation extending airbnb styleguide 
  - git hooks & CI/CD in place
  - Typescript based compilation tsc compiler
  - TDD in progress with Mocha
  - JWT based authentication
  - multiple Mongoose collection with referencing
  - payment gateway Integration
  - Heroku deployment
  - Mini e-commerce platform 

# Cart Application #

"It's just simple application to provide REST APIs for mini e-commerce platform where individual can buy products and can pay the bills
 - microservices architecture
 - Client application in React
 - User Auth microservices
 - Cart services
 - Admin Microservices  

![deividing services](/screens/02.png "title")
![Micro services with Node JS](/screens/03.png "title")



```
# Application Execution
```javascript
git clone  repo
npm install
npm run startdev
tsc -- watch
```
# Application configuration
```javascript
env.sh need to be added locally 
export NODE_ENV="dev"
export PORT="3005"
export MONGOURL="mongodb://mongo/hello"
export EXPRESS_SESSION_SECRET="************************"
export F_CLIENTID="**************"
export F_CLIENTSECRET="**********************"
```
# update etc/hosts file
```
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
127.0.0.1       mysql redis mongo
127.0.0.1       ms-commerce.com
```
# Sevices end-point

- http://ms-commerce.com/api/v1  Auth services
- http://ms-commerce.com/admin/v1 Admin APIs
- http://ms-commerce.com/admin/v1  Cart APIs

# Application NPM Script
```javascript
"start": "cd dist &&  nodemon server.js",
"prestart": "tsc && cp -r uploads dist/ && cp -r app/global dist/app/",
"clean" : "rm -rf dist",
"copy" : "cp -r uploads dist/ && cp -r app/global dist/app/"
```


================================================
FILE: dockerized-containers/docker-compose.yml
================================================
version: '3.5'
services:
  gateway:
    image: nginx:1.11
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./proxy/default.conf:/etc/nginx/conf.d/default.conf:ro
      - ./proxy/ssl:/etc/nginx/ssl:ro
    depends_on:
      - ms_commerce_auth
      - ms_commerce_admin
      - ms_commerce_client
    networks:
      - ms_network
  ms_mysql:
    container_name: ms_mysql
    image: mysql:5.7
    volumes:
      - ~/datadir/mysql:/var/lib/mysql
    ports:
      - 3306:3306
      - 33060:33060
    environment:
      MYSQL_ROOT_PASSWORD: root
    networks:
      - ms_network
  ms_commerce_mongo:
    image: mongo
    container_name: ms_commerce_mongo
    restart: unless-stopped
    volumes:
      - ~/datadir/mongo:/data/db
    ports:
      - 27017:27017
    networks:
      - ms_network
  ms_commerce_auth:
    container_name: ms_commerce_auth
    build: ./e-Commerce-Auth/
    image: e-commerce-auth
    volumes:
      - ./e-Commerce-Auth/:/usr/src/app
      - /usr/src/app/node_modules
    ports:
      - 3001:3001
      - 9201:9201
    depends_on:
      - ms_mysql
    networks:
      - ms_network
  ms_commerce_cart:
    container_name: ms_commerce_cart
    build: ./e-Commerce-Cart/
    image: e-commerce-cart
    volumes:
      - ./e-Commerce-Cart/:/usr/src/app
      - /usr/src/app/node_modules
    ports:
      - 3004:3004
      - 9204:9204
    depends_on:
      - ms_mysql
    networks:
      - ms_network      
  ms_commerce_admin:
    build: ./e-Commerce-Admin/
    image: e-commerce-admin
    container_name: ms_commerce_admin
    environment:
      - NODE_ENV=local
    volumes:
      - ./e-Commerce-Admin/:/usr/src/app
      - /usr/src/app/node_modules
    ports:
      - 3002:3002
      - 9202:9202
    depends_on:
      - ms_commerce_mongo
    networks:
      - ms_network
  ms_commerce_client:
    build: ./e-Commerce-Client/
    image: e-commerce-client
    container_name: ms_commerce_client
    environment:
      - NODE_ENV=local
    volumes:
      - ./e-Commerce-Client/:/usr/src/app
      - /usr/src/app/node_modules
    ports:
      - 3003:3003
    depends_on:
      - ms_commerce_admin
      - ms_commerce_auth
    networks:
      - ms_network      
networks:
  ms_network:
    driver: bridge
    name: ms_network



================================================
FILE: dockerized-containers/e-Commerce-Admin/Dockerfile
================================================
FROM node:carbon

# Create app directory
WORKDIR /usr/src/app

# Bundle app source
COPY . .

# npm install
RUN  npm install
# Run npm install --global grpc --unsafe-perm

EXPOSE 3002 9202
CMD [ "npm", "run", "watchserver" ]
CMD [ "npm", "run", "startdev" ]



================================================
FILE: dockerized-containers/e-Commerce-Admin/README.md
================================================
# Application for e-commerce Hub


REST API to support application features

  - Express as web framework with Typescript
  - Passport js for social authentication 
  - Express CORS enabled
  - boom for error codes & Joi for Validation
  - Winston for logging and express minitor for monitoring
  - Mongoose as ODM driver
  - eslint validation extending airbnb styleguide 
  - git hooks & CI/CD in place
  - Typescript based compilation tsc compiler
  - TDD in progress with Mocha
  - JWT based authentication
  - multiple Mongoose collection with referencing
  - payment gateway Integration
  - Heroku deployment
  - Mini e-commerce platform 

# Cart Application #

"It's just simple application to provide REST APIs for mini e-commerce platform where individual can buy products and can pay the bills

```
# Application Execution
```javascript
git clone  repo
npm install
npm run startdev
tsc -- watch
```
# Application configuration
```javascript
env.sh need to be added locally 
export NODE_ENV="dev"
export PORT="3005"
export MONGOURL="mongodb://mongo/hello"
export EXPRESS_SESSION_SECRET="************************"
export F_CLIENTID="**************"
export F_CLIENTSECRET="**********************"
```

# Application NPM Script
```javascript
"start": "cd dist &&  nodemon server.js",
"prestart": "tsc && cp -r uploads dist/ && cp -r app/global dist/app/",
"clean" : "rm -rf dist",
"copy" : "cp -r uploads dist/ && cp -r app/global dist/app/"
```


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/config/email.ts
================================================
'use strict';

export default {

  global: {
    from: 'info@kpilibrary.com',
  },
  welcome: {
    subject: 'Welcome to KPI Library',
  },
  password_reset: {
    subject: 'KPI Library: Reset your password',
  },
  event_booked_guest: {
    subject: 'KPI Library: Your Booking Has Been Confirmed',
  },
  event_booked_host: {
    subject: 'KPI Library: Your Event Has Been Booked',
  },
  event_booked_guests_notification: {
    subject: 'KPI Library: Your Booking Has Been Confirmed',
  },
  message_received: {
    subject: 'KPI Library: New Message Received',
  },
  guest_review_email: {
    subject: 'KPI Library: Event Completed',
  },
  alacarte_booked_guest: {
    subject: 'KPI Library: Alacarte Booking Details',
  },
  alacarte_booked_host: {
    subject: 'KPI Library: Your Alacarte Has Been Booked',
  }
}



================================================
FILE: dockerized-containers/e-Commerce-Admin/app/config/environments/dev.ts
================================================
/* eslint quote-props: 0 */
export { }
const configuration: any = {};
configuration.mongo = {
  url:  process.env.MONGODB_URI || process.env.MONGOURL,
};
configuration.URL = {
  frontEnd: process.env.FE_URL
}
configuration.facebook = {
  client_id: process.env.F_CLIENTID,
  client_secret: process.env.F_CLIENTSECRET,
  callback_url: process.env.F_CALLBACK
};
configuration.google = {
  client_id: process.env.G_CLIENTID,
  client_secret: process.env.G_CLIENTSECRET,
  callback_url: process.env.G_CALLBACK
};
configuration.linkedin = {
  client_id: process.env.L_CLIENTID,
  client_secret: process.env.L_CLIENTSECRET,
  callback_url: process.env.L_CALLBACK
};
configuration.twitter = {
  client_id: process.env.T_CLIENTID,
  client_secret: process.env.T_CLIENTSECRET,
  callback_url: process.env.T_CALLBACK
};
configuration.email = {
  apiKey: process.env.API_KEY,
  host: process.env.SMTP_HOST,
  port: process.env.SMTP_PORT,
  auth: {
    user: process.env.SMTP_USER,
    pass: process.env.SMTP_PASSWORD,
  }
}
configuration.twilio = {
  sid: process.env.SID,
  token: process.env.TOKEN,
  phone: process.env.PHONE,
}
configuration.url = {
  FE: process.env.FE,
  API: process.env.API,
}
configuration.uploadpath = {
  uploaddir: process.env.UPLOAD_DIR,
  profiledir: process.env.PROFILE_PICTURE_DIR
}

module.exports = configuration;

================================================
FILE: dockerized-containers/e-Commerce-Admin/app/config/environments/qa.ts
================================================
/* eslint quote-props: 0 */
export { }
const configuration: any = {};
configuration.mongo = {
  url:  process.env.MONGODB_URI || process.env.MONGOURL,
};
configuration.URL = {
  frontEnd: process.env.FE_URL
}
configuration.facebook = {
  client_id: process.env.F_CLIENTID,
  client_secret: process.env.F_CLIENTSECRET,
  callback_url: process.env.F_CALLBACK
};
configuration.google = {
  client_id: process.env.G_CLIENTID,
  client_secret: process.env.G_CLIENTSECRET,
  callback_url: process.env.G_CALLBACK
};
configuration.linkedin = {
  client_id: process.env.L_CLIENTID,
  client_secret: process.env.L_CLIENTSECRET,
  callback_url: process.env.L_CALLBACK
};
configuration.twitter = {
  client_id: process.env.T_CLIENTID,
  client_secret: process.env.T_CLIENTSECRET,
  callback_url: process.env.T_CALLBACK
};
configuration.email = {
  apiKey: process.env.API_KEY,
  host: process.env.SMTP_HOST,
  port: process.env.SMTP_PORT,
  auth: {
    user: process.env.SMTP_USER,
    pass: process.env.SMTP_PASSWORD,
  }
}
configuration.twilio = {
  sid: process.env.SID,
  token: process.env.TOKEN,
  phone: process.env.PHONE,
}
configuration.url = {
  FE: process.env.FE,
  API: process.env.API,
}
configuration.uploadpath = {
  uploaddir: process.env.UPLOAD_DIR,
  profiledir: process.env.PROFILE_PICTURE_DIR
}
module.exports = configuration;


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/config/environments/test.ts
================================================
/* eslint quote-props: 0 */
export { }
const configuration: any = {};
configuration.mongo = {
  url:  process.env.MONGODB_URI || process.env.MONGOURL,
};
configuration.URL = {
  frontEnd: process.env.FE_URL
}
configuration.facebook = {
  client_id: process.env.F_CLIENTID,
  client_secret: process.env.F_CLIENTSECRET,
  callback_url: process.env.F_CALLBACK
};
configuration.google = {
  client_id: process.env.G_CLIENTID,
  client_secret: process.env.G_CLIENTSECRET,
  callback_url: process.env.G_CALLBACK
};
configuration.linkedin = {
  client_id: process.env.L_CLIENTID,
  client_secret: process.env.L_CLIENTSECRET,
  callback_url: process.env.L_CALLBACK
};
configuration.twitter = {
  client_id: process.env.T_CLIENTID,
  client_secret: process.env.T_CLIENTSECRET,
  callback_url: process.env.T_CALLBACK
};
configuration.email = {
  apiKey: process.env.API_KEY,
  host: process.env.SMTP_HOST,
  port: process.env.SMTP_PORT,
  auth: {
    user: process.env.SMTP_USER,
    pass: process.env.SMTP_PASSWORD,
  }
}
configuration.twilio = {
  sid: process.env.SID,
  token: process.env.TOKEN,
  phone: process.env.PHONE,
}
configuration.url = {
  FE: process.env.FE,
  API: process.env.API,
}
configuration.uploadpath = {
  uploaddir: process.env.UPLOAD_DIR,
  profiledir: process.env.PROFILE_PICTURE_DIR
}
module.exports = configuration;


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/controller/UserController.ts
================================================
export { };
const uuidv4 = require('uuid/v4');
import User from '../models/user';
declare function require(name: string);
import Helper from '../helper/bcrypt';
const jwt = require('jsonwebtoken');
import helper from '../helper/bcrypt';
import mailEvents from '../events/notification';
import logger from '../helper/logger';
import email from '../helper/email';

const saltRounds = 10;
class userController {

  static getUserByEmail(email, cb) {
    User.findOne({ 'email': email }, (error, user) => {
      if (user) {
        cb(null, user);
      } else {
        cb('User does not exist in system', null);
      }
    });
  }
  static validateUser(req, res, cb) {
    const { body } = req;
    User.find({ email: body.email })
      .then((data) => {
        if (data && data.length) {
          const flag = helper.comparePassword(body.password, data[0].password)
          if (flag) {
            jwt.sign(helper.buildUserToken(data[0]), 'secretkey', (tokError, token) => {
              cb(null, token);
            });
          } else {
            cb(new Error('username password does not match'), null);
          }
        }
        else {
          cb(new Error('no user found with this account email'), null);
        }
      });
  }
  static registerDefault(req, res, cb) {
    const { body } = req;
    const { location } = req;
    const hash = helper.generateSaltValue(body.password);
    return User.find({ email: body.email }).then((user) => {
      if (user && user.length > 0) {
        cb(new Error('user already regitsered with us'), null);
      } else {
        return User.create(this.buildUser(body, hash, location)
          , (error, user) => {
            if (error) {
              cb(error, null);
            } else {
              logger.info('emitting user create event');
              mailEvents.emit("welcome", user);
              cb(null, user);
            }
          });
      }
    });
  }
  static buildUser(body, hash = null, location = null) {

    const build = {
      username: body.username,
      phone: body.phone,
      email: body.email,
      email_verified: false,
      phone_verified: false,
      picture: body.picture ? body.picture : null,
      status: 1,
      gender: null,
      documents: [],
      type: 1,
      social: body.meta,
      uuid: uuidv4()
    }
    return hash ? Object.assign({}, build, { password: hash }) : build;
  }
  static registerSocial(user, callback) {
      User.findOne({ email: user.email }, (error, existingUser) => {
        if (existingUser) {
          callback(null, (existingUser));
        } else {
          User.create(this.buildUser(user, null), (err, user) => {
            if (err) {
              callback(err, null);
            } else {
              callback(null, user);
              mailEvents.emit("welcome", user);
            }
          });
        }
      });

  }

  static activateUserAccount(uuid, cb) {
    User.findOne({ 'uuid': uuid }, (error, foundUser) => {
      if (foundUser) {
        foundUser.email_verified = true;
        foundUser.save(function (err) {
          if (err) {
            cb('error occoured while updating record');
          } else {
            cb(null, 'done');
          }
        });
      } else {
        cb('User does not exist in system');
      }
    });
  }
  static resetPassword(email, callback) {
    // just generate password and send new password on mail
    User.findOne({ 'email': email }, (error, foundUser) => {
      if (foundUser) {
        let password = Math.random().toString(36).slice(2);
        const hash = helper.generateSaltValue(password);
        foundUser.password = hash;
        foundUser.save(function (err) {
          if (err) {
            callback('error occoured while updating record');
          } else {
            mailEvents.emit("forgotPassword", foundUser, password);
            callback(null, 'done');
          }
        });
      } else {
        callback('User does not exist in system with this email');
      }
    });
  }

  static changeUserRole(req, callback) {
    const email = req.params.email
    const body = req.body
    User.findOne({ 'email': email }, (error, user) => {
      if (user) {
        user.type = 2;
        user.save(function (err, updated_user) {
          if (err) {
            callback('error occoured while chaging role');
          } else {
            callback(null, updated_user);
          }
        });
      }
      else {
        callback('user not found in system', null);
      }
    });
  }

  static updateUser(email, data, callback) {
    User.findOne({ 'email': email }, (error, user) => {
      if (user) {
        if (data.username) { user.username = data.username; }
        if (data.gender) { user.gender = data.gender; }
        if (data.phone) { user.phone = data.phone; }
        if (data.profile_picture) { user.profile_picture = data.profile_picture; }
        if (data.password && data.password === data.confirm_password) {
          const hash = helper.generateSaltValue(data.password);
          user.password = hash;
        }
        if ( data.picture ) { user.picture = Helper.avatarURL(data.picture) }

        if (data.phone_verified) {
          user.phone_verified = true;
        }
        if (data.document) {
          user.documents.push(data.document);
        }
        if (data.meta) {
          user.meta = {
            about: data.meta.about || '',
            fun_fact: data.meta.fun_fact || '',
            payment: data.meta.payment || '',
          }
        }
        user.save(function (err, updated_user) {
          if (err) {
            callback('error occoured while updating record');
          } else {
            callback(null, updated_user);
          }
        });
      } else {
        callback('user not found', null);
      }
    });
  }
}

export default userController;


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/events/notification.ts
================================================

import Email from '../helper/email';
declare function require(name: string);

const events = require('events');
const winston = require('winston');
// import Twillo from '../helper/twillo';

const eventEmitter = new events.EventEmitter();
eventEmitter.on('welcome', (user) => {
  winston.log('info', `sending welcome email to ${user.email}`);
  // Twillo.default_notification(user.phone, 'welcome')
  Email.welcome(user);
});
eventEmitter.on('forgotPassword', (user, password, uuid) => {
  winston.log('info', `sending forgotPassword email to ${user.email}`);
  Email.password_reset(user, password);
  // Twillo.default_notification(user.phone, 'welcome')
});

export default eventEmitter;


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/global/templates/emails/password-reset-email/html.pug
================================================
html(lang='en')
  head
    meta(charset='utf-8')
    meta(name='viewport', content='width=device-width, initial-scale=1, shrink-to-fit=no')
    title  password has successfully been reset
    link(href='https://fonts.googleapis.com/css?family=Rubik:300,300i,400,400i,500,500i,700,700i,900,900i', rel='stylesheet')
    link(rel='shortcut icon', type='image/x-icon', href='images/favicon.ico')
    link(rel='stylesheet', href='../assets/styles/style.css', type='text/css')
  body(data-gr-c-s-loaded='true', style='')
    .template-wrapper
    table.body(border='0', cellpadding='0', cellspacing='0')
      tbody
        tr
          td  
          td.container
            .content
              table.main
                tbody
                  tr
                    td.wrapper
                      table(border='0', cellpadding='0', cellspacing='0')
                        tbody
                          tr
                            td
                              a.template-logo(href='../index.html')
                                img(src='https://kekasrijan.herokuapp.com/static/media/kpi.88a7c7c4.png', alt='')
                              p.lead
                                | Hello #{user.email}, 
                                br
                                | Your password has successfully been reset
                              table(border='0', cellpadding='0', cellspacing='0')
                                tbody
                                  tr
                                    td.mt30.mb30(align='center')
                                      table(border='0', cellpadding='0', cellspacing='0')
                                        tbody
                                          tr
                                            td
                                              p.user-text
                                                span  Your new password is #[pre #{password}]
                                                br
                                                a.btn-primary(href= login_url) Login 
                              p Thank you
                              p.mb0
                                | If you have any problems, please contact me at 
                                a.click-link(href='#') admin@gmail.com
              table.help-section
                tbody
                  tr
                    td.wrapper
                      table(border='0', cellpadding='0', cellspacing='0')
                        tbody
                          tr
                            td
                              h2.text-center.mb0 Need more help?
                              a.support-link(href='#') We're here,ready to here
              table
                tbody
                  tr
                    td.wrapper
                      table(border='0', cellpadding='0', cellspacing='0')
                        tbody
                          tr
                            td
                              p
                                | You received this email beacuse you just signed up for new account. If it look weird
                                a.default-link(href='#') view it in your browser
                  .footer
                    table(border='0', cellpadding='0', cellspacing='0')
                      tbody
                        tr
                          td.content-block
                            p.text-center
                              | © 2018 KPI App, Goa India
                              br
                              |  If these emails get annoying, please feel to 
                              a(href='#') unsubscribe
          td  


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/global/templates/emails/password-reset-email/style.css
================================================
@charset "UTF-8";
/* -------------------------------------
          GLOBAL RESETS
      ------------------------------------- */

.container {
  display: block;
  Margin: 0 auto !important;
  max-width: 580px;
  padding: 10px;
  width: 580px;
  position: relative;
  bottom: 140px;
}

img {
  border: none;
  -ms-interpolation-mode: bicubic;
  max-width: 100%;
}

body {
  background-color: #f6f6f6;
  font-family: 'Rubik', sans-serif;
  font-size: 15px;
  line-height: 28px;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

table {
  border-collapse: separate;
  mso-table-lspace: 0pt;
  mso-table-rspace: 0pt;
  width: 100%;
}

table td {
  font-family: sans-serif;
  font-size: 14px;
  vertical-align: top;
}

/* -------------------------------------
          BODY & CONTAINER
      ------------------------------------- */

.body {
  background-color: #f6f6f6;
  width: 100%;
}

.lead {
  font-size: 18px;
}

.mt30 {
  margin-top: 30px;
  display: block;
}

.mb30 {
  margin-bottom: 30px;
  display: block;
}

/* Set a max-width, and make it display as block so it will automatically stretch to that width, but will also shrink down on a phone or something */

.container {
  display: block;
  Margin: 0 auto !important;
  /* makes it centered */
  max-width: 580px;
  padding: 10px;
  width: 580px;
  position: relative;
  bottom: 140px;
}

/* This should also be a block element, so that it will fill 100% of the .container */

.content {
  box-sizing: border-box;
  display: block;
  Margin: 0 auto;
  max-width: 580px;
  padding: 10px;
}

/* -------------------------------------
          HEADER, FOOTER, MAIN
      ------------------------------------- */

.template-wrapper {
  background-color: #03A9F4;
  width: 100%;
  height: 250px;
  position: relative;
}

.click-link {
  color: #03A9F4;
  display: inline-block;
  margin-bottom: 20px;
}

.help-section {
  background-color: #ffdcdc;
  border-radius: 3px;
  width: 100%;
  text-align: center;
}

.mb0 {
  margin-bottom: 0px;
}

.support-link {
  color: #03A9F4;
  display: inline-block;
  font-size: 19px;
  margin-bottom: 0px;
}

.template-logo {
  display: block;
  margin-bottom: 40px;
  margin: auto;
}

.user-text {
  font-size: 18px;
  font-weight: 500;
}

.user-text span {
  font-weight: 600;
}

.text-secondary {
  color: #218ef4 !important
}

.main {
  background: #ffffff;
  border-radius: 3px;
  width: 100%;
  margin-bottom: 20px;
}

.wrapper {
  box-sizing: border-box;
  padding: 40px 25px;
}

.content-block {
  padding-bottom: 10px;
  padding-top: 10px;
  line-height: 2;
}

.footer {
  clear: both;
  text-align: center;
  width: 100%;
}

.footer td, .footer p, .footer span, .footer a {
  color: #999999;
  font-size: 12px;
  text-align: center;
}

/* -------------------------------------
          TYPOGRAPHY
      ------------------------------------- */

h1, h2, h3, h4 {
  color: #000000;
  font-family: sans-serif;
  font-weight: 400;
  line-height: 1.4;
  margin: 0;
  Margin-bottom: 30px;
}

h1 {
  font-size: 35px;
  font-weight: 300;
  text-align: center;
  text-transform: capitalize;
}

p, ul, ol {
  font-family: sans-serif;
  font-size: 15px;
  font-weight: normal;
  margin: 0;
  margin-bottom: 15px;
}

p li, ul li, ol li {
  list-style-position: inside;
  margin-left: 5px;
}

a {
  color: #3498db;
  text-decoration: underline;
}

/* -------------------------------------
          BUTTONS
      ------------------------------------- */

.btn {
  box-sizing: border-box;
  width: 100%;
}

.btn>tbody>tr>td {
  padding-bottom: 15px;
}

.btn table {
  width: auto;
}

.btn table td {
  background-color: #ffffff;
  border-radius: 5px;
  text-align: center;
}

.btn a {
  background-color: #ffffff;
  border: solid 1px #3498db;
  border-radius: 5px;
  box-sizing: border-box;
  color: #3498db;
  cursor: pointer;
  display: inline-block;
  font-size: 14px;
  font-weight: bold;
  margin: 0;
  padding: 12px 25px;
  text-decoration: none;
  text-transform: capitalize;
}

.btn-primary table td {
  background-color: #3498db;
}

.btn-primary a {
  background-color: #03A9F4;
  border-color: #03A9F4;
  color: #ffffff;
}

.default-link {
  color: #03A9F4;
}

.default-link:hover {
  color: #03A9F4;
}

/* -------------------------------------
          OTHER STYLES THAT MIGHT BE USEFUL
      ------------------------------------- */

.last {
  margin-bottom: 0;
}

.first {
  margin-top: 0;
}

.align-center {
  text-align: center;
}

.align-right {
  text-align: right;
}

.align-left {
  text-align: left;
}

.clear {
  clear: both;
}

.mt0 {
  margin-top: 0;
}

.mb0 {
  margin-bottom: 0;
}

.preheader {
  color: transparent;
  display: none;
  height: 0;
  max-height: 0;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  visibility: hidden;
  width: 0;
}

.powered-by a {
  text-decoration: none;
}

hr {
  border: 0;
  border-bottom: 1px solid #f6f6f6;
  Margin: 20px 0;
}

/* -------------------------------------
          RESPONSIVE AND MOBILE FRIENDLY STYLES
      ------------------------------------- */

@media only screen and (max-width: 620px) {
  table[class=body] h1 {
    font-size: 28px !important;
    margin-bottom: 10px !important;
  }
  table[class=body] p, table[class=body] ul, table[class=body] ol, table[class=body] td, table[class=body] span, table[class=body] a {
    font-size: 16px !important;
  }
  table[class=body] .wrapper, table[class=body] .article {
    padding: 10px !important;
  }
  table[class=body] .content {
    padding: 0 !important;
  }
  table[class=body] .container {
    padding: 0 !important;
    width: 100% !important;
  }
  table[class=body] .main {
    border-left-width: 0 !important;
    border-radius: 0 !important;
    border-right-width: 0 !important;
  }
  table[class=body] .btn table {
    width: 100% !important;
  }
  table[class=body] .btn a {
    width: 100% !important;
  }
  table[class=body] .img-responsive {
    height: auto !important;
    max-width: 100% !important;
    width: auto !important;
  }
}

/* -------------------------------------
          PRESERVE THESE STYLES IN THE HEAD
      ------------------------------------- */

@media all {
  .ExternalClass {
    width: 100%;
  }
  .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {
    line-height: 100%;
  }
  .apple-link a {
    color: inherit !important;
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    text-decoration: none !important;
  }
  .btn-primary table td:hover {
    background-color: #34495e !important;
  }
  .btn-primary a:hover {
    background-color: #03A9F4 !important;
    border-color: #03A9F4 !important;
  }
}
.btn-primary {
  text-decoration: none;
  color: #FFF;
  background-color: #03A9F4;
  border: solid #03A9F4;
  border-width: 6px 18px;
  line-height: 2em;
  /* 2em * 14px = 28px, use px to get airier line-height also in Thunderbird, and Yahoo!, Outlook.com, AOL webmail clients */
  /*line-height: 28px;*/
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  display: inline-block;
  border-radius: 4px;
  text-transform: capitalize;
}

================================================
FILE: dockerized-containers/e-Commerce-Admin/app/global/templates/emails/welcome-email/html.pug
================================================
html(lang='en')
  head
    meta(charset='utf-8')
    meta(name='viewport', content='width=device-width, initial-scale=1, shrink-to-fit=no')
    title Account Activation email || KPI Library
    link(href='https://fonts.googleapis.com/css?family=Rubik:300,300i,400,400i,500,500i,700,700i,900,900i', rel='stylesheet')
    link(rel='shortcut icon', type='image/x-icon', href='images/favicon.ico')
    link(rel='stylesheet', href='../assets/styles/style.css', type='text/css')
  body(data-gr-c-s-loaded='true', style='')
    .template-wrapper
    table.body(border='0', cellpadding='0', cellspacing='0')
      tbody
        tr
          td  
          td.container
            .content
              table.main
                tbody
                  tr
                    td.wrapper
                      table(border='0', cellpadding='0', cellspacing='0')
                        tbody
                          tr
                            td
                              a.template-logo(href='../index.html')
                                img(src='https://kekasrijan.herokuapp.com/static/media/kpi.88a7c7c4.png', alt='')
                              p.lead
                                | Hello KPI Library, 
                                br
                                | Thanks for Signup on KPI App
                                br
                                | We have sent User Account Activation Link below
                              table(border='0', cellpadding='0', cellspacing='0')
                                tbody
                                  tr
                                    td.mt30.mb30(align='center')
                                      table(border='0', cellpadding='0', cellspacing='0')
                                        tbody
                                          tr
                                            td
                                              p.user-text
                                                | Hi,
                                                span #{user.email},
                                                br
                                                br
                                                a.btn-primary(href= activate_url) Activate  your Account
                              p Thank you
                              p.mb0
                                | If you have any problems, please contact me at 
                                a.click-link(href='#') admin@gmail.com
              table.help-section
                tbody
                  tr
                    td.wrapper
                      table(border='0', cellpadding='0', cellspacing='0')
                        tbody
                          tr
                            td
                              h2.text-center.mb0 Need more help?
                              a.support-link(href='#') We're here,ready to here
              table
                tbody
                  tr
                    td.wrapper
                      table(border='0', cellpadding='0', cellspacing='0')
                        tbody
                          tr
                            td
                              p
                                | You received this email beacuse you just signed up for new account. If it look weird
                                a.default-link(href='#') view it in your browser
                  .footer
                    table(border='0', cellpadding='0', cellspacing='0')
                      tbody
                        tr
                          td.content-block
                            p.text-center
                              | © 2018 KPI App, Goa India
                              br
                              |  If these emails get annoying, please feel to 
                              a(href='#') unsubscribe
          td  


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/global/templates/emails/welcome-email/style.css
================================================
@charset "UTF-8";
/* -------------------------------------
          GLOBAL RESETS
      ------------------------------------- */

.container {
  display: block;
  Margin: 0 auto !important;
  max-width: 580px;
  padding: 10px;
  width: 580px;
  position: relative;
  bottom: 140px;
}

img {
  border: none;
  -ms-interpolation-mode: bicubic;
  max-width: 100%;
}

body {
  background-color: #f6f6f6;
  font-family: 'Rubik', sans-serif;
  font-size: 15px;
  line-height: 28px;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

table {
  border-collapse: separate;
  mso-table-lspace: 0pt;
  mso-table-rspace: 0pt;
  width: 100%;
}

table td {
  font-family: sans-serif;
  font-size: 14px;
  vertical-align: top;
}

/* -------------------------------------
          BODY & CONTAINER
      ------------------------------------- */

.body {
  background-color: #f6f6f6;
  width: 100%;
}

.lead {
  font-size: 18px;
}

.mt30 {
  margin-top: 30px;
  display: block;
}

.mb30 {
  margin-bottom: 30px;
  display: block;
}

/* Set a max-width, and make it display as block so it will automatically stretch to that width, but will also shrink down on a phone or something */

.container {
  display: block;
  Margin: 0 auto !important;
  /* makes it centered */
  max-width: 580px;
  padding: 10px;
  width: 580px;
  position: relative;
  bottom: 140px;
}

/* This should also be a block element, so that it will fill 100% of the .container */

.content {
  box-sizing: border-box;
  display: block;
  Margin: 0 auto;
  max-width: 580px;
  padding: 10px;
}

/* -------------------------------------
          HEADER, FOOTER, MAIN
      ------------------------------------- */

.template-wrapper {
  background-color: #03A9F4;
  width: 100%;
  height: 250px;
  position: relative;
}

.click-link {
  color: #03A9F4;
  display: inline-block;
  margin-bottom: 20px;
}

.help-section {
  background-color: #ffdcdc;
  border-radius: 3px;
  width: 100%;
  text-align: center;
}

.mb0 {
  margin-bottom: 0px;
}

.support-link {
  color: #03A9F4;
  display: inline-block;
  font-size: 19px;
  margin-bottom: 0px;
}

.template-logo {
  display: block;
  margin-bottom: 40px;
  margin: auto;
}

.user-text {
  font-size: 18px;
  font-weight: 500;
}

.user-text span {
  font-weight: 600;
}

.text-secondary {
  color: #218ef4 !important
}

.main {
  background: #ffffff;
  border-radius: 3px;
  width: 100%;
  margin-bottom: 20px;
}

.wrapper {
  box-sizing: border-box;
  padding: 40px 25px;
}

.content-block {
  padding-bottom: 10px;
  padding-top: 10px;
  line-height: 2;
}

.footer {
  clear: both;
  text-align: center;
  width: 100%;
}

.footer td, .footer p, .footer span, .footer a {
  color: #999999;
  font-size: 12px;
  text-align: center;
}

/* -------------------------------------
          TYPOGRAPHY
      ------------------------------------- */

h1, h2, h3, h4 {
  color: #000000;
  font-family: sans-serif;
  font-weight: 400;
  line-height: 1.4;
  margin: 0;
  Margin-bottom: 30px;
}

h1 {
  font-size: 35px;
  font-weight: 300;
  text-align: center;
  text-transform: capitalize;
}

p, ul, ol {
  font-family: sans-serif;
  font-size: 15px;
  font-weight: normal;
  margin: 0;
  margin-bottom: 15px;
}

p li, ul li, ol li {
  list-style-position: inside;
  margin-left: 5px;
}

a {
  color: #3498db;
  text-decoration: underline;
}

/* -------------------------------------
          BUTTONS
      ------------------------------------- */

.btn {
  box-sizing: border-box;
  width: 100%;
}

.btn>tbody>tr>td {
  padding-bottom: 15px;
}

.btn table {
  width: auto;
}

.btn table td {
  background-color: #ffffff;
  border-radius: 5px;
  text-align: center;
}

.btn a {
  background-color: #ffffff;
  border: solid 1px #3498db;
  border-radius: 5px;
  box-sizing: border-box;
  color: #3498db;
  cursor: pointer;
  display: inline-block;
  font-size: 14px;
  font-weight: bold;
  margin: 0;
  padding: 12px 25px;
  text-decoration: none;
  text-transform: capitalize;
}

.btn-primary table td {
  background-color: #3498db;
}

.btn-primary a {
  background-color: #3498db;
  border-color: #3498db;
  color: #ffffff;
}

.default-link {
  color: #3498db;
}

.default-link:hover {
  color: #3498db;
}

/* -------------------------------------
          OTHER STYLES THAT MIGHT BE USEFUL
      ------------------------------------- */

.last {
  margin-bottom: 0;
}

.first {
  margin-top: 0;
}

.align-center {
  text-align: center;
}

.align-right {
  text-align: right;
}

.align-left {
  text-align: left;
}

.clear {
  clear: both;
}

.mt0 {
  margin-top: 0;
}

.mb0 {
  margin-bottom: 0;
}

.preheader {
  color: transparent;
  display: none;
  height: 0;
  max-height: 0;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  visibility: hidden;
  width: 0;
}

.powered-by a {
  text-decoration: none;
}

hr {
  border: 0;
  border-bottom: 1px solid #f6f6f6;
  Margin: 20px 0;
}

/* -------------------------------------
          RESPONSIVE AND MOBILE FRIENDLY STYLES
      ------------------------------------- */

@media only screen and (max-width: 620px) {
  table[class=body] h1 {
    font-size: 28px !important;
    margin-bottom: 10px !important;
  }
  table[class=body] p, table[class=body] ul, table[class=body] ol, table[class=body] td, table[class=body] span, table[class=body] a {
    font-size: 16px !important;
  }
  table[class=body] .wrapper, table[class=body] .article {
    padding: 10px !important;
  }
  table[class=body] .content {
    padding: 0 !important;
  }
  table[class=body] .container {
    padding: 0 !important;
    width: 100% !important;
  }
  table[class=body] .main {
    border-left-width: 0 !important;
    border-radius: 0 !important;
    border-right-width: 0 !important;
  }
  table[class=body] .btn table {
    width: 100% !important;
  }
  table[class=body] .btn a {
    width: 100% !important;
  }
  table[class=body] .img-responsive {
    height: auto !important;
    max-width: 100% !important;
    width: auto !important;
  }
}

/* -------------------------------------
          PRESERVE THESE STYLES IN THE HEAD
      ------------------------------------- */

@media all {
  .ExternalClass {
    width: 100%;
  }
  .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {
    line-height: 100%;
  }
  .apple-link a {
    color: inherit !important;
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    text-decoration: none !important;
  }
  .btn-primary table td:hover {
    background-color: #34495e !important;
  }
  .btn-primary a:hover {
    background-color: #03A9F4 !important;
    border-color: #03A9F4 !important;
  }
}
.btn-primary {
  text-decoration: none;
  color: #FFF;
  background-color: #03A9F4;
  border: solid #03A9F4;
  border-width: 6px 18px;
  line-height: 2em;
  /* 2em * 14px = 28px, use px to get airier line-height also in Thunderbird, and Yahoo!, Outlook.com, AOL webmail clients */
  /*line-height: 28px;*/
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  display: inline-block;
  border-radius: 4px;
  text-transform: capitalize;
}

================================================
FILE: dockerized-containers/e-Commerce-Admin/app/global/templates/response/index.ts
================================================
class ResponseTemplate {
  static general(data) {
    return data;
  }
  static error(code, message, description) {
    return {
      statusCode: code || 400,
      message: message || 'some error occoured',
      description: description || 'error occoured on server, please try again after some time.'
    };
  }
  static authError() {
    return this.error(
      403,
      'authentication error',
      'no authentication token provided, please login first and provide the authentication token.'
    );
  }
  static invalidAuthError() {
    return this.error(
      403,
      'authentication error',
      'invalid Token provided, please login first and provide the authentication token.'
    );
  }
  static emptyContent() {
    return this.general({
      statusCode: 402,
      message: 'empty content found',
      description: 'you must provide valid data and it must not be empty.',
      helpful_links: ['http://stackoverflow.com/questions/18419428/what-is-the-minimum-valid-json']
    });
  }
  static invalidContentType() {
    return this.general({
      statusCode: 400,
      message: 'invalid content type',
      description: 'you must specify content type and it must be application/json',
      helpful_links: ['http://stackoverflow.com/questions/477816/what-is-the-correct-json-content-type']
    });
  }
  static routeNotFound() {
    return this.error(
      405,
      'resource not found',
      'the resource your tried to access doesn\'t exist or you dont have permissions to access it.'
    );
  }
  static userNotFound() {
    return this.error(
      400,
      'user not found',
      "the user you're looking for doesn't exist or you dont have permissions to access it."
    );
  }
  static updateErrorOccoured(error) {
    return this.error(
      301,
      'error occoured',
      error || 'error occoured while updating your data.'
    );
  }
  static success(description, data=null) {
		return {
			statusCode: 200,
			message: 'success',
			description: description || 'data successfully saved.',
			...data
		}
	}
}

export default ResponseTemplate;



================================================
FILE: dockerized-containers/e-Commerce-Admin/app/helper/bcrypt.ts
================================================

const bcrypt = require('bcrypt-nodejs');
const jwt = require('jsonwebtoken');
const {url} = global['configuration']
const {uploadpath} = global['configuration']
const path = require('path');
const fs = require('fs');
const helper = {
  generateSaltValue(password) {
    const salt = bcrypt.genSaltSync(); // enter number of rounds, default: 10
    const hash = bcrypt.hashSync(password, salt);
    return hash;
  },
  comparePassword(userPassword, password ) {
    if (!userPassword.length ||  !( password && password.length > 0) ) {
      return false;
    }
    return bcrypt.compareSync(userPassword, password);
  },
  authRedirectUrl( path ) {
		return `${url.FE}/#/auth/validate-token/${path}`;
	},
	
  buildUserToken(data) {
    return {
        email: data.email,
        id:data._id,
        username: data.username ? data.username : data.email,
        hasPassword: data.password ? true : false,
        type : data.type || 1,
        picture : data.picture
    }
  },
  resource( path ) {
		return `${url.API}${path}`;
	},
  getFileExtension( file ) {
		let extensions = file.split('.');
		if ( extensions.length === 1 ) {
			return 'jpg';
		} else {
			return extensions.pop();
		}
	},
	avatarURL( filename ) {
		if ( filename.includes('://') ) {
			return filename;
		}
		return this.resource(`/${uploadpath.uploaddir}/${uploadpath.profiledir}/${filename}`);
	},
	userDocumentURL( filename ) {
		if ( filename.includes('://') ) {
			return filename;
		}
		return this.resource(`/${uploadpath.uploaddir}/${uploadpath.documentdir}/${filename}`);
	},
	randomString() {
		return Math.random().toString(36).substring(2, 7);
  },
  deleteFile( type, filename ) {
		let location;
    if ( type === 'profile' ) { location = path.join( uploadpath.uploaddir, uploadpath.profiledir ) }
		else { location = uploadpath.uploaddir; }
		if (filename) {
			fs.unlink( path.join( location, filename ), () => {
				// in case we need to perform additional operations.
			});
		}
	},
	getPaymentMethodName( method ) {
		if ( method == 1 ) { return 'PayPal'; }
		else if ( method == 2 ) { return 'PayPal'; }
		else if ( method == 3 ) { return 'Instamojo'; }
		else { return 'Not Specified'; }
	},
	getCurrency(currency) {
		let allCurrency = {
			1: 'USD',
			2: 'INR',
		};

		if( allCurrency[currency] ) {
			return allCurrency[currency];
		} else {
			return allCurrency[1];
		}

	},
	verificationCode() {
		let code = Math.floor((Math.random()*999999)+111111);
		return code;
	}
};

export default helper;




================================================
FILE: dockerized-containers/e-Commerce-Admin/app/helper/email.ts
================================================
const path = require('path');
declare function require(name:string);

const nodemailer = require('nodemailer');
const url = global['configuration'].url;
const mailConfig = global['configuration'].email;

import emailConfig from '../config/email';
import { EmailTemplate } from 'email-templates';
// const Twillo = require('./twillo');

  const transport = nodemailer.createTransport({
    host: 'smtp.gmail.com',
    port: 465,
    secure: true,
    auth: {
      // type: 'OAuth2',
      user: mailConfig.auth.user,
      pass:  mailConfig.auth.pass
    },
  });
const Email = {
  welcome(user) {
    if (user.email) {
      let templateDir = path.join('app/global/templates', 'emails', 'welcome-email');
      let welcomeEmail = new EmailTemplate(templateDir);
      welcomeEmail.render({ user: user, activate_url: `${url.API}/auth/activate/${user.uuid}` }, (err, result) => {
        transport.sendMail(
          {
            from: emailConfig.global.from,
            to: user.email,
            subject: emailConfig.welcome.subject,
            html: result.html,
          }, (err, info) => {
            // some error occoured...
            console.log(err);
          }
        );
      });
    }
  },
  password_reset(user, password) {
    if (user.email) {
      let templateDir = path.join('app/global/templates', 'emails', 'password-reset-email');
      let passwordResetEmail = new EmailTemplate(templateDir);
      passwordResetEmail.render({ user: user, login_url: `${url.FE}/#/auth/login`, password: password }, (err, result) => {
        transport.sendMail(
          {
            from: emailConfig.global.from,
            to: user.email,
            subject: emailConfig.password_reset.subject,
            html: result.html,
          }, (err, info) => {
            // some error occoured...
          }
        );
      });
    }
    if (user.phone_verified) {
      // Twillo.password_reset_notification(user.phone);
    }

  },
};
export default Email;


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/helper/errorHandler.ts
================================================
import * as winston from 'winston';
import  ResponseTemplate from './responseTemplate';
/* eslint class-methods-use-this:0 */
const env = process.env.NODE_ENV;
const onDevEnv = env === 'dev' || env === 'test' || env === 'local';
class errorHandler {
  public internalServerError(err, req, res, next) {
    winston.log('info',err);
    if (err.isBoom) {
      // Error From  joi express validator
      const error = {
        message: err.output.payload.error,
        error: err.output.payload.message
      };
      res.status(400).json(ResponseTemplate.BadRequestFromJoi(error));
    } else { // internalServerError
      res.status(500).json({
        success: false,
        message: err.message,
        error: (onDevEnv) ? err.stack : {}
      });
    }
  }
  public PageNotFound(req, res, err) {
    res.status(404).json({ message: 'api not found' });
  }
}

export default new errorHandler();


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/helper/logger.ts
================================================
const winston = require('winston');

// define the custom settings for each transport (file, console)
const options = {
  console: {
    level: 'info',
    handleExceptions: true,
    json: true,
    colorize: true,
    prettyPrint: true,
    humanReadableUnhandledException: true
  }
};
const logger = new winston.Logger({
  transports: [
  //  new winston.transports.File(options.file),
    new winston
      .transports
      .Console(options.console),
  ],
  exceptionHandlers: [
    // new winston.transports.File(options.errorLog)
  ],
  exitOnError: false, // do not exit on handled exceptions
});

// create a stream object with a 'write' function that will be used by `morgan`
logger.stream = {
  write(message, encoding) {
    logger.info(message);
  }
};
export default logger;


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/helper/responseTemplate.ts
================================================
/* istanbul ignore file */
const data: any = {
  general(data) {
    return data;
  },
  successMessage(message) {
    return {
      success: true,
      message
    };
  },
  success(data, message) {
    return {
      success: true,
      message,
      data
    };
  },
  error(message, err, code= null) {
    return {
      success: false,
      message: message || 'some error occurred',
      error: err || 'error occurred on server, please try again after some time.'
    };
  },
  emptyContent() {
    return this.general({
      message: 'empty content found',
      description: 'you must provide valid data and it must not be empty.',
      helpful_links: ['http://stackoverflow.com/questions/18419428/what-is-the-minimum-valid-json']
    });
  },
  invalidContentType() {
    return this.general({
      message: 'invalid content type',
      description: 'you must specify content type and it must be application/json',
      helpful_links: ['http://stackoverflow.com/questions/477816/what-is-the-correct-json-content-type']
    });
  },
  BadRequestFromJoi(err) {
    return this.error(
      err.message,
      err.error
    );
  },
  userAlreadyExist(err) {
    return this.general({
      success: false,
      message: 'user already registered in System',
      description: 'user already registered in System'
    });
  },
  userdoesNotExist(err) {
    return this.general({
      success: false,
      message: err.message || 'user not registered in system',
      description: 'user account does not exist in system'
    });
  },
  commonAuthUserDataError() {
    return this.error(
       'Authentication error',
       'token verification failed, Please try again'
    );
  },
  tokenRequiredAuthError() {
    return this.error(
      'Authentication error, Token is required in Header',
      'token verification failed, Please try again'
    );
  },
};
export default data;


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/helper/twillo.ts
================================================
const twilioConfig = global['configuration'].twilio;
// import twilio from 'twilio';

const twillo = require('twilio')
const client = new twillo(twilioConfig.sid, twilioConfig.token);

let TwilioHelper = {

  phone_verification(phone_number, code, callback) {
    client.sendMessage({
      to: phone_number,
      from: twilioConfig.phone,
      body: `Hello from Bal Bla e-Commerce-Hub\nYour verification code is ${code}`,
    }, (err, message) => {
      callback(message);
    });
  },
  password_reset_notification(phone) {
    client.sendMessage({
      to: phone,
      from: twilioConfig.phone,
      body: `Bla Bla\nYour password has been successfully reset.`,
    }, (err, message) => {
      // 
    });
  },

  default_notification(phone, message) {
    console.log(client);
    client.sendMessage({
      to: phone,
      from: twilioConfig.phone,
      body: `e-Commerce-Hub-TM\n${message}`,
    }, (err, message) => {
      // 
    });
  }
}
export default TwilioHelper;




================================================
FILE: dockerized-containers/e-Commerce-Admin/app/lib/logger.ts
================================================
const winston = require('winston');
const moment = require('moment');

// define the custom settings for each transport (file, console)
const options = {
  console: {
    level: 'info',
    handleExceptions: true,
    json: true,
    colorize: true,
    timestamp() {
      return moment
        .utc()
        .format();
    },
    prettyPrint: true,
    humanReadableUnhandledException: true
  }
};
const logger = new winston.Logger({
  transports: [
  //  new winston.transports.File(options.file),
    new winston
      .transports
      .Console(options.console),
  ],
  exceptionHandlers: [
    // new winston.transports.File(options.errorLog)
  ],
  exitOnError: false, // do not exit on handled exceptions
});

// create a stream object with a 'write' function that will be used by `morgan`
logger.stream = {
  write(message, encoding) {
    logger.info(message);
  }
};
export default logger;


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/lib/mongoose.ts
================================================
/* eslint func-names:0 */
const mongoose = require('mongoose');
mongoose.promises = require('bluebird');
const { url } = global['configuration'].mongo;
const MongoConnect = function () {
  const db = mongoose.connect(url, { useNewUrlParser: true }, (error) => {
    if (error) {
      console.log(`Mongoose default connection error: ${error}`);
    } else {
      console.log('mongo Connected :)');
    }
  });
  mongoose.connection.on('connected', () => {
    console.log(`Mongoose default connection open to ${url}`);
  });

  // If the connection throws an error
  mongoose.connection.on('error', (err) => {
    console.log(`Mongoose default connection error: ${err}`);
  });

  // When the connection is disconnected
  mongoose.connection.on('disconnected', () => {
    console.log('Mongoose default connection disconnected');
  });

  // If the Node process ends, close the Mongoose connection
  process.on('SIGINT', () => {
    mongoose.connection.close(() => {
      console.log('Mongoose default connection disconnected through app termination');
      process.exit(0);
    });
  });
  return db;
};

export default MongoConnect;


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/lib/requestValidator.ts
================================================
const Joi = require('joi');

const validation = {
  loginUser : {
    body : {
    email: Joi.string().regex(/^[\w.]+@[\w]+?(\.[a-zA-Z]{2,3}){1,3}$/).required(),
    password: Joi.string().min(8).max(50).required()
    }
  },
  createUser: {
    body: {
      username: Joi.string().min(4).max(50).required(),
      password: Joi.string().min(8).max(50).required(),
      email: Joi.string().regex(/^[\w.]+@[\w]+?(\.[a-zA-Z]{2,3}){1,3}$/).required(),
      verify_password: Joi.string().min(6).max(50).required()
    },
  },
  resetPassword: {
    body: {
      email: Joi.string().regex(/^[\w.]+@[\w]+?(\.[a-zA-Z]{2,3}){1,3}$/).required(),
    }
  }
};
export default validation


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/middleware/authMiddleware.ts
================================================
const jwt = require("jsonwebtoken");
import responseTemplate from '../helper/responseTemplate';
import User from '../models/user';
const validation: any = {
  validateToken(req, res, next) {
    // validatr token here is its valid here
    const token = req.headers.authorization;
    if (token) {
      jwt.verify(token, "secretkey", (err, data) => {
        if (err) {
          res.status(403).json(responseTemplate.commonAuthUserDataError());
        } else {
          User.findById(data.id, (error, user) => {
            if(error){
              res.status(403).json(responseTemplate.commonAuthUserDataError());
            } 
            user.hasPassword = user.password ? true : false;
            req.user = user;
            next();
          })
        }
      });
    } else {
      res.status(403).json(responseTemplate.tokenRequiredAuthError());
    }
  }
};

export default validation;


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/middleware/requestValidator.ts
================================================

module.exports = {
  validatePayload(req, res, next) {
    // validatr token here is its valid here
    const token = req.body;
    if ((req.method === 'POST' || req.method === 'PUT') && req.body !== null) {
      next();
    }
    res.status(403).json({ message: 'payload is required for HTTP Post & Put ' });
  }
};


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/models/plugin/plugin.ts
================================================
const datePlugin  = function timestamp(schema) {
  // Add the two fields to the schema
  schema.add({ 
    createdAt: Date,
    updatedAt: Date
  })

  // Create a pre-save hook
  schema.pre('save', function (next) {
    let now = Date.now()
    
   
    this.updatedAt = now
    // Set a value for createdAt only if it is null
    if (!this.createdAt) {
      this.createdAt = now
    }
   // Call the next function in the pre-save chain
   next()    
  })
}

export default datePlugin;

================================================
FILE: dockerized-containers/e-Commerce-Admin/app/models/user.ts
================================================
const mongoose = require('mongoose');
const bcrypt = require('bcrypt-nodejs');
import helper from '../helper/bcrypt';
const { Schema } = mongoose;
import timestampPlugin from './plugin/plugin';
import Helper from '../../app/helper/bcrypt';
const userSchema = new Schema({
  provider: {
    type: String
  },
  username: {
    type: String
  },
  password: { type: String },
  email: {
    index: { unique: true },
    type: String
  },
  address: {
    type: String
  },
  meta: mongoose.Schema.Types.Mixed,
  picture : mongoose.Schema.Types.Mixed,
  /*
  reviews : [{
    type: mongoose.Schema.ObjectId,
    ref: 'Review'
  }],
  booking :  [{
    type: mongoose.Schema.ObjectId,
    ref: 'Booking'
  }],
  vehicles: [{
    type: mongoose.Schema.ObjectId,
    ref: 'Vehicle'
  }], */
  uuid: {
    type: String
  },
  type: {
    type: String,
    default: 1
  },
  status: {
    type: String,
    default: 1
  },
  profile_picture: mongoose.Schema.Types.Mixed,
  phone: String,
  email_verified: Boolean,
  phone_verified: Boolean,
  social: mongoose.Schema.Types.Mixed,
  documents: [mongoose.Schema.Types.Mixed],
  gender: Number, // 1: Male, 2: Female, 3: Unspecified
},{ toJSON: { virtuals: true } });

userSchema.set('toObject', { virtuals: true });
userSchema.set('toJSON', { virtuals: true });
userSchema.plugin(timestampPlugin)

const User = mongoose.model('User', userSchema);

export default User;



================================================
FILE: dockerized-containers/e-Commerce-Admin/app/routes/defaultRoutes.ts
================================================
import * as express from "express";
const router = express.Router();

import { Router } from "express";



export class DefaultRouter {
  router: Router;

  /**
   * Initialize the HeroRouter
   */
  constructor() {
    this.router = Router();
  }
  /**
 * @api {POST} /auth/reset-password update password sent in Mail
 * @apiName resetPassword
 * @apiGroup Auth
 * @apiSuccess {String} code HTTP status code from API.
 * @apiSuccess {String} message Message from API.
 */
  public sayHello(req, res) {
    res.status(200).json({ success: true, message: 'i am up and running .. ⚡️⚡️⚡️⚡️⚡️⚡️⚡️' });
  };

  init() {
    this.router.get("/", this.sayHello);
  }
}


// Create the HeroRouter, and export its configured Express.Router
const defaultRouter = new DefaultRouter();
defaultRouter.init();

export default defaultRouter.router;


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/routes/provider/Facebook.ts
================================================

import * as passport from 'passport';
const FacebookStrategy = require('passport-facebook');
import userController from '../../controller/UserController';
/* eslint no-underscore-dangle: 0 */

passport.use(new FacebookStrategy(
  {
    clientID: global.configuration.facebook.client_id,
    clientSecret: global.configuration.facebook.client_secret,
    callbackURL: global.configuration.facebook.callback_url,
    profileFields: ['id', 'displayName', 'photos', 'email'],
    passReqToCallback: true,
  },
  (req, accessToken, refreshToken, profile, done) => {
    const data = profile._json;
    if (!data.email) {
      data.email = 'ramnivas.yadav@srijan.net';
    }
    userController.registerSocial({
      provider: 'facebook',
      name: data.name,
      email: data.email,
      phone: '5436785432',
      meta: {
        provider: 'facebook',
        id: profile.id,
        token: accessToken,
      }
    }, (err, profileData) => {
      if (err) {
        done(err, null);
      }
      done(null, profileData);
    });

  }
));

const FacebookRoutes = {
  authenticate: () => passport.authenticate('facebook', { scope: ['email', 'public_profile', 'user_location'] }),
  callback: () => passport.authenticate('facebook', {
    failureRedirect: '/auth/failed'
  })

};

export default  FacebookRoutes;


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/routes/provider/Google.ts
================================================

export {}
const passport = require('passport');
const GoogleStrategy = require('passport-google-oauth20').Strategy;
import userController from '../../controller/UserController';
/* eslint no-underscore-dangle: 0 */

passport.use(new GoogleStrategy(
  {
    clientID: global.configuration.google.client_id,
    clientSecret: global.configuration.google.client_secret,
    callbackURL: `${global.configuration.url.API}/auth/callback/google`,
    profileFields: ['id', 'displayName', 'photos', 'email']
  },
  (accessToken, refreshToken, profile, done) => {
    const data = profile._json;
    console.log(data);
    userController.registerSocial({
      provider: 'google',
      username: data.displayName,
      email: data.emails[0].value,
      phone: '5436785432',
      picture : data.image.url,
      meta: {
        provider: 'google',
        id: data.id,
        token: accessToken,
      }
    }, (err, profileData) => {
      if (err) {
        done(err, null);
      }
      done(null, profileData);
    });
  }
));


const GoogleRoutes = {
  authenticate: () => passport.authenticate('google', { scope: ['profile', 'email'] }),

  callback: () => passport.authenticate('google', { failureRedirect: '/login' }),
  function(req, res) {
    // Successful authentication, redirect home.
    res.redirect('/');
  }
};


export default GoogleRoutes;


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/routes/provider/Linkedin.ts
================================================
export {}
const passport = require('passport');
const LinkedInStrategy = require('passport-linkedin');
import userController from '../../controller/UserController';
/* eslint no-underscore-dangle: 0 */
passport.use(new LinkedInStrategy(
  {
    consumerKey: global.configuration.linkedin.client_id,
    consumerSecret: global.configuration.linkedin.client_secret,
    callbackURL: global.configuration.linkedin.callback_url,
    profileFields: ['id', 'first-name', 'last-name', 'email-address', 'headline']
  },
  ((token, tokenSecret, profile, done) => {
    console.log(profile);
    const data = profile._json;
    userController.registerSocial({
      provider: 'linkedin',
      name: `${data.firstName} ${data.lastName}`,
      email: data.emailAddress,
      mobno: '5436785432',
      meta: {
        provider: 'linkedin',
        id: data.id,
        token,
      }
    }, (err, profileData) => {
      if (err) {
        done(err, null);
      }
      done(null, profileData);
    });
  })
));

const LinkedinRoutes = {
  authenticate: () => passport.authenticate('linkedin', { scope: ['r_basicprofile', 'r_emailaddress'] }),
  callback: () => passport.authenticate('linkedin', {
    failureRedirect: '/auth/failed'
  })

};

export default LinkedinRoutes;


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/routes/provider/Locale.ts
================================================
/* eslint prefer-destructuring:0 */
const passportModule = require('passport');
const LocalStrategy = require('passport-local');
import userController from '../../controller/UserController';
const User = require('../../models/user');
const helper = require('../../helper/bcrypt');


passportModule.use(new LocalStrategy(
  {
    usernameField: 'email',
    passwordField: 'password',
    passReqToCallback: true,
    session: false
  },
  ((req, email, password, done) => {
    // write code here to find user if it exists in system
    User.find({ email }, (err, data) => {
      if (err) {
        return done(null, null);
      } else if (data.length === 0) {
        return done(null, null);
      }
      const flag = helper.comparePassword(password, data[0].password);
      if (!flag) {
        return done(null, null);
      }
      return done(null, data);
    });
  })
));

const localRoutes = {
  authenticate() {
    return passportModule.authenticate('local', { session: false });
  },
  authenticate_with_callback: () => passportModule.authenticate('local', {
    successRedirect: '/auth/success',
    failureRedirect: '/auth/failed'
  }),
};


export default localRoutes;


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/routes/provider/Twitter.ts
================================================

const passport = require('passport');
const TwitterStrategy = require('passport-twitter').Strategy;
import userController from '../../controller/UserController';


passport.use(new TwitterStrategy(
  {
    consumerKey: global.configuration.twitter.client_id,
    consumerSecret: global.configuration.twitter.client_secret,
    callbackURL: 'http://127.0.0.1:3005/auth/callback/twitter'
  },
  (token, tokenSecret, profile, done) => {
    console.log('data>>>', profile);
    const data = profile;
    userController.registerSocial({
      provider: 'twitter',
      username: data.username,
      email: data.email || 'raam.yaadav@gmail.com',
      mobno: '5436785432',
      meta: {
        provider: 'twitter',
        id: data.id,
        token,
      }
    }, (err, profileData) => {
      if (err) {
        done(err, null);
      }
      done(null, profileData);
    });
  }
));

const TwitterRoutes = {
  authenticate: () => passport.authenticate('twitter'),
  callback: () => passport.authenticate('twitter', { failureRedirect: '/auth/failed' }),
  function(req, res) {
    // Successful authentication, redirect home.
    res.redirect('/');
  }
};


export default  TwitterRoutes;


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/routes/routes.ts
================================================
import * as express from "express";
import UserController from "../controller/UserController";
const jwt = require("jsonwebtoken");
// seralize user Object
const url = global['configuration'].url;
import LocaleRoute from "./provider/Locale";
import * as expressJoiValidator from "express-joi-validator";
import expressJoi from "../lib/requestValidator";
// import FacebookRoutes from "./provider/Facebook";
import GoogleRoutes from "./provider/Google";
// import LinkedinRoutes from "./provider/Linkedin";
import Template from "../helper/responseTemplate";
// import TwitterRoute from "./provider/Twitter";
import * as template from '../helper/responseTemplate';
const boom = require("express-boom");
import { Router, Request, Response, NextFunction } from "express";
import helper from '../helper/bcrypt';
import ValidAuthTokenMiddleware from '../middleware/authMiddleware';

export class AuthRouter {
  router: Router;

  /**
   * Initialize the HeroRouter
   */
  constructor() {
    this.router = Router();
    this.init();
  }
  public register(req: any, res: any) {
    UserController.registerDefault(req, res, (error, user) => {
      if (error) {
        res.status(400).json(Template.userAlreadyExist(error.message));
      } else {
        res.json({
          statusCode: 200,
          success: true,
          message: "user created successfully",
          user
        });
      }
    });
  }
  public login(req: any, res: any) {
    UserController.validateUser(req, res, (err, token) => {
      if (err) {
        res.status(401).json(Template.userdoesNotExist(err));
      } else {
        res.status(200).json({
          success: true,
          message: "success",
          token
        });
      }
    });
  }

  public redirectSocialUser(req, res) {
    jwt.sign(helper.buildUserToken(req.user), "secretkey", (tokError, token) => {
      if (tokError) {
        res.boom.badImplementation(tokError);
      } else {
        // redirect app to FE app routes with Token
        console.log('redirecting Now...');
        res.redirect(helper.authRedirectUrl(`?token=${token}`));
        /* res.json({
           statusCode: 200,
           message: "success",
           token
         }); */
      }
    });
  }
  public validate(req: any, res: any) {
    res.json({
      statusCode: 200,
      message: 'validated succsessfully',
      success: true,
      user : req.user
    });
  }

  /**
 * @api {POST} /auth/reset-password update password sent in Mail
 * @apiName resetPassword
 * @apiGroup Auth
 * @apiSuccess {String} code HTTP status code from API.
 * @apiSuccess {String} message Message from API.
 */
  public resetPassword(req, res) {
    UserController.resetPassword(req.body.email, (error, success) => {
      console.log(error)
      if (error) {
        res.status(403).json({ success: false, message: error, description: 'error occoured while resetting password' });
      } else {
        res.json({
          statusCode: 200,
          message: 'success',
          description: 'if this email is registered with us, you will receive a password reset email soon.',
        });
      }
    });
  };

  public activateUserAccount(req, res) {
    UserController.activateUserAccount(req.params.uuid, (error, success) => {
      if (error) {
        res.status(403).json({ success: false, message: error, description: 'error occoured while activating user' });
      } else {
        res.redirect(url.FE);
      }
    });
  }
  /**
   * Take each handler, and attach to one of the Express.Router's
   * endpoints.
   */
  init() {
    this.router.post("/login", expressJoiValidator(expressJoi.loginUser), this.login);
    this.router.get("/validate", ValidAuthTokenMiddleware.validateToken, this.validate);
    this.router.post("/register", expressJoiValidator(expressJoi.createUser), this.register);
    this.router.post("/reset-password", expressJoiValidator(expressJoi.resetPassword), this.resetPassword);
    this.router.get("/activate/:uuid", this.activateUserAccount);
    /**
     * @api {POST} /auth/login/facebook Social Login
     * @apiName google
     * @apiGroup Auth
     * @apiSuccess {String} code HTTP status code from API.
     * @apiSuccess {String} message Message from API.
     */
    /*
    this.router.get("/login/facebook", FacebookRoutes.authenticate());
    this.router.get(
      "/callback/facebook",
      FacebookRoutes.callback(),
      this.redirectSocialUser
    );
   */
    /**
     * @api {POST} /auth/login/google Social Login
     * @apiName google
     * @apiGroup Auth
     * @apiSuccess {String} code HTTP status code from API.
     * @apiSuccess {String} message Message from API.
     */
    this.router.get("/login/google", GoogleRoutes.authenticate());
    this.router.get(
      "/callback/google",
      GoogleRoutes.callback(),
      this.redirectSocialUser
    );

    /**
     * @api {POST} /auth/login/twitter Social Login
     * @apiName twitter
     * @apiGroup Auth
     * @apiSuccess {String} code HTTP status code from API.
     * @apiSuccess {String} message Message from API.
     */
    /*this.router.get("/login/twitter", TwitterRoute.authenticate("twitter"));
    this.router.get(
      "/callback/twitter",
      TwitterRoute.callback(),
      this.redirectSocialUser
    ); */

    /**
     * @api {POST} /auth/login/linkedin Social Login
     * @apiName linkedin
     * @apiGroup Auth
     * @apiSuccess {String} code HTTP status code from API.
     * @apiSuccess {String} message Message from API.
     */
    /*
    this.router.get("/login/likedin", LinkedinRoutes.authenticate());
    this.router.get("/login/linkedin", LinkedinRoutes.authenticate());
    this.router.get(
      "/callback/linkedin",
      LinkedinRoutes.callback(),
      this.redirectSocialUser
    ); */
  }
}

// Create the HeroRouter, and export its configured Express.Router
const authRoutes = new AuthRouter();
authRoutes.init();

export default authRoutes.router;


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/routes/userRoutes.ts
================================================
import * as express from "express";
const router = express.Router();
const passport = require("passport");
import UserController from "../controller/UserController";
const jwt = require("jsonwebtoken");
// seralize user Object
import  ResponseTemplate from '../global/templates/response';
import * as expressJoiValidator from "express-joi-validator";
import expressJoi from "../lib/requestValidator";
const boom = require("express-boom");
import { Router } from "express";
const path = require('path')
const fs = require('fs');
const { uploadpath } = global['configuration']
const multer = require('multer');
import Helper from '../helper/bcrypt';


let profileStorage = multer.diskStorage({
	destination: function (req, file, cb) {
		cb( null, path.join( uploadpath.uploaddir, uploadpath.profiledir ) );
	},
	filename: function (req, file, cb) {
		let extension = Helper.getFileExtension(file.originalname);
		cb( null, `${req.user.id}-${ Helper.randomString() }.${extension}` );
	}
})
let upload = multer({ storage: profileStorage });

let documentStorage = multer.diskStorage({
	destination: function (req, file, cb) {
		cb( null, path.join( uploadpath.uploaddir, uploadpath.documentdir ) );
	},
	filename: function (req, file, cb) {
		let extension = Helper.getFileExtension(file.originalname);
		cb( null, `${req.user.id}-${ Helper.randomString() }.${extension}` );
	}
})
let uploadDocuments = multer({ storage: documentStorage });


export class AuthRouter {
  router: Router;

  /**
   * Initialize the HeroRouter
   */
  constructor() {
    this.router = Router();
    this.init();
  }

  /**
 * @api {POST} /auth/reset-password update password sent in Mail
 * @apiName resetPassword
 * @apiGroup Auth
 * @apiSuccess {String} code HTTP status code from API.
 * @apiSuccess {String} message Message from API.
 */
public resetPassword(req, res){
		UserController.resetPassword( req.body.email, ( error, success) => {
			console.log(error)
			if ( error ) {
				res.status(403).json({success : false, message: error, description: 'error occoured while resetting password' });
			} else {
				res.json({
					statusCode: 200,
					message: 'success',
					description: 'if this email is registered with us, you will receive a password reset email soon.',
				});
			}
		});
};

public updateUser(req, res){
  UserController.updateUser(req.params.email, req.body ,( error, success) => {
    if ( error ) {
      res.status(403).json({success : false, message: error, description: 'error occoured while updating user' });
    } else {
      res.json({
        statusCode: 200,
        message: 'success',
        description: 'user updated successfully',
      });
    }
  });
}
public getUserByEmail(req, res){
  UserController.getUserByEmail(req.params.email ,( error, user) => {
    if ( error ) {
      res.status(403).json({success : false, message: error, description: 'error occoured while updating user' });
    } else {
      res.json({
        statusCode: 200,
        message: 'success',
        data: user
      });
    }
  });
}

public uploadProfilepicture(req, res){
  UserController.updateUser( req.user.email, { picture: req.file.filename }, ( error, user ) => {
		if ( error ) {
			res.json( ResponseTemplate.updateErrorOccoured(error) );
		} else {
			res.json( ResponseTemplate.success(
				'your profile picture has been successfully uploaded',
				{ picture: Helper.avatarURL(user.picture) })
			);
		  Helper.deleteFile( 'profile', req.user.picture );
		}
	});
}
// upload users profile picture.
public uploadDocuments(req, res){
  let documents:any = {};
	req.files.map( (file) => {
		documents.url = file.filename;
		documents.originalname = file.originalname;
		documents.timestamp = new Date();
	});

	UserController.updateUser( req.user.email, { document: documents }, ( error, user ) => {
		if ( error ) {
			res.json( ResponseTemplate.updateErrorOccoured(error) );
		} else {
			let userDocuments = [];
			if ( user.documents ) {
				user.documents.map( (doc) => {
					userDocuments.push( Helper.userDocumentURL(doc.url) );
				});
			}
			res.json( ResponseTemplate.success(
				'host documents have been successfully uploaded',
				{ documents: userDocuments })
			);
		}
	});
}

  /**
   * Take each handler, and attach to one of the Express.Router's
   * endpoints.
   */
  init() {
    this.router.get("/:email", this.getUserByEmail);
    this.router.get("/reset-password/:email",expressJoiValidator(expressJoi.resetPassword),  this.resetPassword);
    this.router.put("/update/:email", this.updateUser);
    this.router.post('/upload-profile-picture', upload.single('avatar'), this.uploadProfilepicture);
    this.router.post('/upload-documents', uploadDocuments.array('documents'), this.uploadDocuments);
  }
}

// Create the HeroRouter, and export its configured Express.Router
const authRoutes = new AuthRouter();
authRoutes.init();

export default authRoutes.router;


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/routes.ts
================================================
/* eslint func-names: ["error", "never"] */
/* eslint prefer-destructuring: 0 */
import * as express from 'express';
const expressRouter= express.Router();
import authRoutes from './routes/routes';
import userRoutes from './routes/userRoutes';
import defaultRoutes from './routes/defaultRoutes';
import validAuthTokenMiddleware from './middleware/authMiddleware';
expressRouter.use('/', defaultRoutes);
expressRouter.use('/uploads/', express.static('uploads'));
expressRouter.use('/auth', authRoutes);
expressRouter.use('/user',validAuthTokenMiddleware.validateToken, userRoutes);



export default expressRouter;


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/seed/seedUsers.ts
================================================
import User from '../models/user';

const mongoose = require('mongoose');

const dbName = 'blabla';
mongoose.connect(`mongodb://localhost/${dbName}`);
/* eslint quote-props:0 */
/* Aquí vamos a requerir el mongoose, en donde tengo el modelo y la base de datos que creo */

const users = [
  {
    'username': 'tarun',
    'email': 'tarun@gmail.com',
    'email_verified': true,
    'phone_verified': false,
    'gender': null,
    'address': 'goa India',
    'geo': {
      'lat': 15.5377266,
      'lng': 73.8316141
    },
    'password': '$2a$10$S7FH2SqOls7bdAwosDlo0O0fw0wNW7a8e/hF.BqrE.qC9nybWnj0.',
    'documents': [],
    'status': '1',
    'type': '2'
  }, {
    'username': 'tarun1',
    'email': 'tarun1222@gmail.com',
    'email_verified': true,
    'phone_verified': false,
    'gender': null,
    'address': 'goa India',
    'geo': {
      'lat': 15.5377266,
      'lng': 73.8316141
    },
    'password': '$2a$10$S7FH2SqOls7bdAwosDlo0O0fw0wNW7a8e/hF.BqrE.qC9nybWnj0.',
    'documents': [],
    'status': '1',
    'type': '2'
  }, {
    'username': 'tarun1',
    'email': 'tarun22@gmail.com',
    'email_verified': true,
    'phone_verified': false,
    'gender': null,
    'address': 'goa India',
    'geo': {
      'lat': 15.5377266,
      'lng': 73.8316141
    },
    'password': '$2a$10$S7FH2SqOls7bdAwosDlo0O0fw0wNW7a8e/hF.BqrE.qC9nybWnj0.',
    'documents': [],
    'status': '1',
    'type': '2'
  }, {
    'username': 'tarun1',
    'email': 'tarun5@gmail.com',
    'email_verified': true,
    'phone_verified': false,
    'gender': null,
    'address': 'goa India',
    'geo': {
      'lat': 15.5377266,
      'lng': 73.8316141
    },
    'password': '$2a$10$S7FH2SqOls7bdAwosDlo0O0fw0wNW7a8e/hF.BqrE.qC9nybWnj0.',
    'documents': [],
    'status': '1',
    'type': '2'
  }, {
    'username': 'tarun1',
    'email': 'tarun1@gmail.com',
    'email_verified': true,
    'phone_verified': false,
    'gender': null,
    'address': 'goa India',
    'geo': {
      'lat': 15.5377266,
      'lng': 73.8316141
    },
    'password': '$2a$10$S7FH2SqOls7bdAwosDlo0O0fw0wNW7a8e/hF.BqrE.qC9nybWnj0.',
    'documents': [],
    'status': '1',
    'type': '2'
  }, {
    'username': 'tarun1',
    'email': 'tarun6@gmail.com',
    'email_verified': true,
    'phone_verified': false,
    'gender': null,
    'address': 'goa India',
    'geo': {
      'lat': 15.5377266,
      'lng': 73.8316141
    },
    'password': '$2a$10$S7FH2SqOls7bdAwosDlo0O0fw0wNW7a8e/hF.BqrE.qC9nybWnj0.',
    'documents': [],
    'status': '1',
    'type': '2'
  }, {
    'username': 'tarun1',
    'email': 'asdfg@gmail.com',
    'email_verified': true,
    'phone_verified': false,
    'gender': null,
    'address': 'goa India',
    'geo': {
      'lat': 15.5377266,
      'lng': 73.8316141
    },
    'password': '$2a$10$S7FH2SqOls7bdAwosDlo0O0fw0wNW7a8e/hF.BqrE.qC9nybWnj0.',
    'documents': [],
    'status': '1',
    'type': '2'
  }, {
    'username': 'tarun1',
    'email': 'tgfdsa@gmail.com',
    'email_verified': true,
    'phone_verified': false,
    'gender': null,
    'address': 'goa India',
    'geo': {
      'lat': 15.5377266,
      'lng': 73.8316141
    },
    'password': '$2a$10$S7FH2SqOls7bdAwosDlo0O0fw0wNW7a8e/hF.BqrE.qC9nybWnj0.',
    'documents': [],
    'status': '1',
    'type': '2'
  },
  {
    'username': 'tarun1',
    'email': 'tarunfgds8@gmail.com',
    'email_verified': true,
    'phone_verified': false,
    'gender': null,
    'address': 'goa India',
    'geo': {
      'lat': 15.5377266,
      'lng': 73.8316141
    },
    'password': '$2a$10$S7FH2SqOls7bdAwosDlo0O0fw0wNW7a8e/hF.BqrE.qC9nybWnj0.',
    'documents': [],
    'status': '1',
    'type': '2'
  },{
    'username': 'tarun1',
    'email': 'asdfcv@gmail.com',
    'email_verified': true,
    'phone_verified': false,
    'gender': null,
    'address': 'goa India',
    'geo': {
      'lat': 15.5377266,
      'lng': 73.8316141
    },
    'password': '$2a$10$S7FH2SqOls7bdAwosDlo0O0fw0wNW7a8e/hF.BqrE.qC9nybWnj0.',
    'documents': [],
    'status': '1',
    'type': '2'
  },{
    'username': 'tarun1',
    'email': 'dekoo@gmail.com',
    'email_verified': true,
    'phone_verified': false,
    'gender': null,
    'address': 'goa India',
    'geo': {
      'lat': 15.5377266,
      'lng': 73.8316141
    },
    'password': '$2a$10$S7FH2SqOls7bdAwosDlo0O0fw0wNW7a8e/hF.BqrE.qC9nybWnj0.',
    'documents': [],
    'status': '1',
    'type': '2'
  },{
    'username': 'tarun1',
    'email': 'hellodemo@gmail.com',
    'email_verified': true,
    'phone_verified': false,
    'gender': null,
    'address': 'goa India',
    'geo': {
      'lat': 15.5377266,
      'lng': 73.8316141
    },
    'password': '$2a$10$S7FH2SqOls7bdAwosDlo0O0fw0wNW7a8e/hF.BqrE.qC9nybWnj0.',
    'documents': [],
    'status': '1',
    'type': '2'
  },{
    'username': 'tarun1',
    'email': 'gmail@gmail.com',
    'email_verified': true,
    'phone_verified': false,
    'gender': null,
    'address': 'goa India',
    'geo': {
      'lat': 16.5377266,
      'lng': 79.8316141
    },
    'password': '$2a$10$S7FH2SqOls7bdAwosDlo0O0fw0wNW7a8e/hF.BqrE.qC9nybWnj0.',
    'documents': [],
    'status': '1',
    'type': '2'
  }
];

User.collection.drop();

User.create(users, (err) => {
  if (err) {
    throw (err);
  }
  console.log(`Created ${users.length} User`);
  mongoose.connection.close();
});


/* Para que se cree esta base de datos tengo que poner en terminal, en otra terminal:
node ./bin/seeds.js. De esta manera se crea la base de datos */


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/seed/seedVehicle.ts
================================================
import User from '../models/user';

const mongoose = require('mongoose');

const dbName = 'blabla';
mongoose.connect(`mongodb://localhost/${dbName}`);
/* eslint quote-props:0 */
/* Aquí vamos a requerir el mongoose, en donde tengo el modelo y la base de datos que creo */

const users = [
  {
    'username': 'tarun',
    'email': 'tarun@gmail.com',
    'email_verified': true,
    'phone_verified': false,
    'gender': null,
    'address': 'goa India',
    'geo': {
      'lat': 15.5377266,
      'lng': 73.8316141
    },
    'password': '$2a$10$S7FH2SqOls7bdAwosDlo0O0fw0wNW7a8e/hF.BqrE.qC9nybWnj0.',
    'documents': [],
    'status': '1',
    'type': '2'
  }, {
    'username': 'tarun1',
    'email': 'tarun1222@gmail.com',
    'email_verified': true,
    'phone_verified': false,
    'gender': null,
    'address': 'goa India',
    'geo': {
      'lat': 15.5377266,
      'lng': 73.8316141
    },
    'password': '$2a$10$S7FH2SqOls7bdAwosDlo0O0fw0wNW7a8e/hF.BqrE.qC9nybWnj0.',
    'documents': [],
    'status': '1',
    'type': '2'
  }, {
    'username': 'tarun1',
    'email': 'tarun22@gmail.com',
    'email_verified': true,
    'phone_verified': false,
    'gender': null,
    'address': 'goa India',
    'geo': {
      'lat': 15.5377266,
      'lng': 73.8316141
    },
    'password': '$2a$10$S7FH2SqOls7bdAwosDlo0O0fw0wNW7a8e/hF.BqrE.qC9nybWnj0.',
    'documents': [],
    'status': '1',
    'type': '2'
  }, {
    'username': 'tarun1',
    'email': 'tarun5@gmail.com',
    'email_verified': true,
    'phone_verified': false,
    'gender': null,
    'address': 'goa India',
    'geo': {
      'lat': 15.5377266,
      'lng': 73.8316141
    },
    'password': '$2a$10$S7FH2SqOls7bdAwosDlo0O0fw0wNW7a8e/hF.BqrE.qC9nybWnj0.',
    'documents': [],
    'status': '1',
    'type': '2'
  }, {
    'username': 'tarun1',
    'email': 'tarun1@gmail.com',
    'email_verified': true,
    'phone_verified': false,
    'gender': null,
    'address': 'goa India',
    'geo': {
      'lat': 15.5377266,
      'lng': 73.8316141
    },
    'password': '$2a$10$S7FH2SqOls7bdAwosDlo0O0fw0wNW7a8e/hF.BqrE.qC9nybWnj0.',
    'documents': [],
    'status': '1',
    'type': '2'
  }, {
    'username': 'tarun1',
    'email': 'tarun6@gmail.com',
    'email_verified': true,
    'phone_verified': false,
    'gender': null,
    'address': 'goa India',
    'geo': {
      'lat': 15.5377266,
      'lng': 73.8316141
    },
    'password': '$2a$10$S7FH2SqOls7bdAwosDlo0O0fw0wNW7a8e/hF.BqrE.qC9nybWnj0.',
    'documents': [],
    'status': '1',
    'type': '2'
  }, {
    'username': 'tarun1',
    'email': 'tarun7@gmail.com',
    'email_verified': true,
    'phone_verified': false,
    'gender': null,
    'address': 'goa India',
    'geo': {
      'lat': 15.5377266,
      'lng': 73.8316141
    },
    'password': '$2a$10$S7FH2SqOls7bdAwosDlo0O0fw0wNW7a8e/hF.BqrE.qC9nybWnj0.',
    'documents': [],
    'status': '1',
    'type': '2'
  }, {
    'username': 'tarun1',
    'email': 'tarun8@gmail.com',
    'email_verified': true,
    'phone_verified': false,
    'gender': null,
    'address': 'goa India',
    'geo': {
      'lat': 15.5377266,
      'lng': 73.8316141
    },
    'password': '$2a$10$S7FH2SqOls7bdAwosDlo0O0fw0wNW7a8e/hF.BqrE.qC9nybWnj0.',
    'documents': [],
    'status': '1',
    'type': '2'
  }
];

User.collection.drop();

User.create(users, (err) => {
  if (err) {
    throw (err);
  }
  console.log(`Created ${users.length} User`);
  mongoose.connection.close();
});


/* Para que se cree esta base de datos tengo que poner en terminal, en otra terminal:
node ./bin/seeds.js. De esta manera se crea la base de datos */


================================================
FILE: dockerized-containers/e-Commerce-Admin/app/transformer/userTransformer.ts
================================================
'use strict';

import _ from 'lodash';
// import ReviewTransformer from './ReviewTransformer';


let UserTransformer = {
  xx : (users) =>{
    if ( Array.isArray(users) ) {
			let output = [];
			users.forEach(( user ) => {
				output.push( UserTransformer._transformUsers(user) );
			});
			return output;
		}
		else {
			return UserTransformer._transformUsers(users);
		}
  },
  transform: (users) => {
    if (Array.isArray(users)) {
      let output = [];
      users.forEach((user) => {
        output.push(UserTransformer._transform(user));
      });
      return output;
    }
    else {
      return UserTransformer._transform(users);
    }
  },
  calculateUsers: (users: any | null) => {
    if (Array.isArray(users)) {
      return {
        Users : users.length ? users.length : 100,
        vehicles : (users['vehicle'] ) ? users['vehicle'].length : 1000,
        cities :100
      }
    }
  },

  _transform: (user) => {
    if (!user) { return {}; }
    let user_status = (user.status === 1) ? 'active' : 'disabled';
    return {
      id: user._id,
      username : user.username,
      status: user_status,
      name: user.name,
      email: user.email,
      password: (user.password) ? true : false,
      phone: user.phone || '',
      gender: user.gender || '',
      birthday: user.birthday || '',
      type: user.type || 1,
      meta: user.meta || {},
      social : user.social || [],
      phone_verified: user.phone_verified ? true : false,
      email_verified: user.email_verified ? true : false,
      profile_picture: user.profile_picture ? null : null // will fix later
    };
  },
  transformUsers: ( users ) => {
		if ( Array.isArray(users) ) {
			let output = [];
			users.forEach(( user ) => {
				output.push( UserTransformer._transformUsers(user) );
			});
			return output;
		}
		else {
			return UserTransformer._transformUsers(users);
		}
	},
	_transformUsers: ( user ) => {
		if ( ! user ) { return {}; }
    let user_status = ( user.status === '1' ) ? 'active' : 'disabled';
    const obj:any = {};

		return Object.assign({}, {
      id: user._id,
      username : user.username,
      status: user_status,
      name: user.name,
      email_verified:user.email_verified,
      phone_verified :user.phone_verified,
      reviews : user.reviews,
      vehciles : user.vehciles,
      email: user.email,
      date : user.createdAt,
      type: user.type || 1,
		}, obj);
  }
}

export default UserTransformer;



================================================
FILE: dockerized-containers/e-Commerce-Admin/app/types/global.d.ts
================================================
declare namespace NodeJS {
    export interface Global {
      configuration: any
    }
  }

================================================
FILE: dockerized-containers/e-Commerce-Admin/app/types/vendor.d.ts
================================================

declare namespace NodeJS {
  export interface Global {
    configuration: any
  }
}

================================================
FILE: dockerized-containers/e-Commerce-Admin/env.sh
================================================
# this environment vairables needs to be set in .env file in applciaiton root directory
# copy this file as .env and add the appropriate values as per environment.
# node & mysql
export NODE_ENV="dev"
export PORT="3002"
export MONGOURL="mongodb://ms_commerce_mongo/blabla"
export EXPRESS_SESSION_SECRET="######################"
export F_CLIENTID="###################"
export F_CLIENTSECRET="###########################"
export F_CALLBACK="/auth/callback/facebook"
export G_CLIENTID="@@@@@@@@@@@@@-###############.apps.%%%%%%%%%%%.com"
export G_CLIENTSECRET="k##########@@@@@@@@@@@@Ub"
export G_CALLBACK="/auth/callback/google"
export L_CLIENTID="##################"
export L_CLIENTSECRET="############"
export L_CALLBACK="/auth/callback/linkedin"

export T_CLIENTID="##################"
export T_CLIENTSECRET="######################"
export T_CALLBACK="/auth/callback/twitter"
export FE_URL="localhost:3000"
export API_KEY='XX0xxxxx-xX0X0XxXXxXxXXXxX0x'
export SMTP_HOST='smtp.mandrillapp.com'
export SMTP_PORT='587'
export SMTP_USER='#############.net'
export SMTP_PASSWORD='##############'
export SID='XX0xxxxx-xX0X0XxXXxXxXXXxX0x'
export TOKEN='XX0xxxxx-xX0X0XxXXxXxXXXxX0x'
export PHONE='+9716156786'
export FE='http://localhost:3000'
export API='http://localhost:3005'
export UPLOAD_DIR='uploads'
export PROFILE_PICTURE_DIR='profile'
export DOCUMENT_UPLOAD_DIR='documents'


================================================
FILE: dockerized-containers/e-Commerce-Admin/express.ts
================================================
import router from './app/routes';
import * as boom from 'express-boom';
import * as expressSession from 'express-session';
import  * as cookieParser from 'cookie-parser';
import * as passport from 'passport';
import * as helmet from 'helmet';
import * as cors from 'cors';
import * as path from 'path';
import * as express from 'express';
import * as logger from 'morgan';
import * as bodyParser from 'body-parser';
import errorHandlers from './app/helper/errorHandler';

// Creates and configures an ExpressJS web server.
class App {
  // ref to Express instance
  public express: express.Application;
  //Run configuration methods on the Express instance.
  constructor() {
    this.express = express();
    this.middleware();
    this.routes();
  }

  // Configure Express middleware.
  private middleware(): void {
    this.express.use(passport.initialize());
    // required for passport to initlize it
    this.express.use(expressSession({ secret: 'bla bla' }));
    this.express.use(passport.session());
    // initlize session
    this.express.use(logger('dev'));
    this.express.disable('x-powered-by');
    this.express.disable('etag');
    this.express.use(helmet());
    this.express.use(boom());
    this.express.use(helmet.noCache({ noEtag: true })); // set Cache-Control header
    this.express.use(helmet.noSniff()); // set X-Content-Type-Options header
    this.express.use(helmet.frameguard()); // set X-Frame-Options header
    this.express.use(helmet.xssFilter()); // set X-XSS-Protection header
    // logger logs on console
    this.express.use(bodyParser.urlencoded({ extended: false, limit: '5mb' })); // parse application/x-www-form-urlencoded
    this.express.use(bodyParser.json()); // parse application/json
    // enable CORS
    this.express.use((req, res, next) => {
      res.header('Access-Control-Allow-Origin', '*');
      res.header('Access-Control-Allow-Methods', 'GET, POST, DELETE, PUT, PATCH, OPTIONS');
      res.header('Access-Control-Allow-Headers', 'Content-Type, api_key, Authorization, Referer');
      next();
    });
    // register all custom Middleware
    this.express.use(cors({ optionsSuccessStatus: 200 }));
    this.express.use(cookieParser()); // cookies-parser
    // manage session by cookies
    this.express.set('views', path.join(__dirname, 'views')); // setting views
    this.express.set('view engine', 'hbs');
    // server side template rendering
    this.express.use(express.static(path.join(__dirname, 'public')));
    this.express.use(logger('dev'));
    this.express.use(bodyParser.json());
    this.express.use(bodyParser.urlencoded({ extended: false }));
  }

  // Configure API endpoints.
  private routes(): void {
    passport.serializeUser((user, done) => {
      done(null, user);
    });
    passport.deserializeUser((user, done) => {
      done(null, user);
    });
    /* This is just to get up and running, and to make sure what we've got is
     * working so far. This function will change when we start to add more
     * API endpoints */
    this.express.use('/api/v1', router);
    this.express.use(errorHandlers.internalServerError);
    this.express.use(errorHandlers.PageNotFound);
  }

}

export default new App().express;

================================================
FILE: dockerized-containers/e-Commerce-Admin/package.json
================================================
{
  "name": "e-commerce-hub",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "start": "cd dist &&  nodemon server.js",
    "prestart": "tsc && cp -r uploads dist/ && cp -r app/global dist/app/",
    "startdev": ". ./env.sh  && cd dist &&  nodemon server.js",
    "clean": "rm -rf dist",
    "watch": "tsc",
    "copy": "cp -r uploads dist/",
    "test": ". ./env.sh  && NODE_ENV=test && mocha ",
    "debug": ". ./env.sh && NODE_ENV=test && cd dist && nodemon --inspect=0.0.0.0:9230 server.js",
    "prestartdev": " npm run clean && tsc &&  npm run copy && npm run watch",
    "watchserver" : "tsc --watch",
    "dev": ". ./env.sh && ts-node server.ts",
    "start-tsc": ". ./env.sh && nodemon ./dist/server.js",
    "buildAndstart": ". ./env.sh && npm run build && npm run start"
  },
  "dependencies": {
    "@types/express": "^4.11.1",
    "assert": "^1.4.1",
    "axios": "^0.18.0",
    "bcrypt-nodejs": "0.0.3",
    "bluebird": "^3.5.3",
    "body-parser": "^1.18.3",
    "cookie-parser": "^1.4.3",
    "cors": "^2.8.5",
    "dotenv": "^6.1.0",
    "email-templates": "^2.7.1",
    "express": "^4.16.4",
    "express-boom": "^2.0.0",
    "express-joi-validator": "^2.0.0",
    "express-session": "^1.15.6",
    "fast-csv": "^2.4.1",
    "hbs": "^4.0.1",
    "helmet": "^3.15.0",
    "joi": "^14.1.1",
    "jsonwebtoken": "^8.4.0",
    "mocha": "^5.2.0",
    "moment": "^2.22.2",
    "mongoose": "^4.5.9",
    "morgan": "^1.9.0",
    "multer": "^1.2.0",
    "nodemailer": "2.5.0",
    "nodemon": "^1.18.6",
    "passport": "0.3.2",
    "passport-facebook": "2.1.1",
    "passport-google-oauth": "1.0.0",
    "passport-google-oauth20": "^1.0.0",
    "passport-instagram": "1.0.0",
    "passport-linkedin": "^1.0.0",
    "passport-local": "1.0.0",
    "passport-twitter": "1.0.4",
    "pug": "2.0.0-beta6",
    "serve-favicon": "^2.5.0",
    "ts-lint": "^4.5.1",
    "ts-node": "^7.0.1",
    "twilio": "^2.11.1",
    "typescript": "^3.1.6",
    "uuid": "^3.3.2",
    "winston": "^2.4.2"
  },
  "devDependencies": {
    "@types/async": "^2.0.45",
    "@types/bcrypt-nodejs": "^0.0.30",
    "@types/bluebird": "^3.5.20",
    "@types/body-parser": "^1.16.8",
    "@types/express": "^4.11.1",
    "@types/mongoose": "^4.7.34",
    "@types/morgan": "^1.7.35",
    "@types/node": "^9.6.39",
    "@types/nodemailer": "^4.3.4",
    "@types/passport": "^0.4.3",
    "babel-eslint": "^8.0.1",
    "eslint": "^4.19.1",
    "eslint-config-airbnb-base": "^12.1.0",
    "eslint-plugin-import": "^2.9.0",
    "eslint-plugin-node": "^5.2.1"
  }
}


================================================
FILE: dockerized-containers/e-Commerce-Admin/public/javascripts/script.js
================================================
document.addEventListener('DOMContentLoaded', () => {

  console.log('IronGenerator JS imported successfully!');

}, false);


================================================
FILE: dockerized-containers/e-Commerce-Admin/public/style.scss
================================================
body {
  padding: 50px;
  font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
}

a {
  color: #00B7FF;
}

.h1 {
  font-size: 40px;
}


================================================
FILE: dockerized-containers/e-Commerce-Admin/server.ts
================================================
import * as http from 'http';
import * as debug from 'debug';
// After you declare "app"
const env = process.env.NODE_ENV || 'dev'
console.log(` using ${process.env.NODE_ENV} to run application`);
global.configuration = require(`./app/config/environments/${env}`);
import App from './express';

const port = (process.env.PORT);
const logger = require('winston');
import mongoose from './app/lib/mongoose';
mongoose();

const server = http.createServer(App);
server.listen(process.env.PORT);
server.on('error', onError);
server.on('listening', onListening);


function onError(error: NodeJS.ErrnoException): void {
  if (error.syscall !== 'listen') throw error;
  let bind = (typeof port === 'string') ? 'Pipe ' + port : 'Port ' + port;
  switch(error.code) {
    case 'EACCES':
      console.error(`${bind} requires elevated privileges`);
      process.exit(1);
      break;
    case 'EADDRINUSE':
      console.error(`${bind} is already in use`);
      process.exit(1);
      break;
    default:
      throw error;
  }
}

const gracefulStopServer = function () {
  // Wait 10 secs for existing connection to close and then exit.
  setTimeout(() => {
    logger.info('Shutting down server');
    process.exit(0);
  }, 1000);
};

process.on('uncaughtException', (err) => {
  logger.error(err, 'Uncaught exception');
  process.exit(1);
});

process.on('unhandledRejection', (reason, promise) => {
  logger.error({
    promise,
    reason
  }, 'unhandledRejection');
  process.exit(1);
});

process.on('SIGINT', gracefulStopServer);
process.on('SIGTERM', gracefulStopServer);

function onListening(): void {
  let addr = server.address();
  let bind = (typeof addr === 'string') ? `pipe ${addr}` : `port ${addr.port}`;
  debug(`Listening on ${bind}`);
}

================================================
FILE: dockerized-containers/e-Commerce-Admin/tsconfig.json
================================================
{
    "compilerOptions": {
        "module": "commonjs",
        "moduleResolution": "node",
        "pretty": true,
        "sourceMap": true,
        "target": "es6",
        "outDir": "./dist",
        "experimentalDecorators": false,
        "emitDecoratorMetadata": false,
        "skipDefaultLibCheck": false,
        "baseUrl": "./lib"
    },
    "files" : [
        "./app/types/vendor.d.ts"
    ],
    "include": [
        "/**/*.ts"
    ],
    "exclude": [
        "node_modules"
    ]
}

================================================
FILE: dockerized-containers/e-Commerce-Admin/tslint.json
================================================


================================================
FILE: dockerized-containers/e-Commerce-Admin/uploads/documents/.gitkeep
================================================


================================================
FILE: dockerized-containers/e-Commerce-Admin/uploads/profile/.gitkeep
================================================


================================================
FILE: dockerized-containers/e-Commerce-Auth/Dockerfile
================================================
FROM node:carbon

# Create app directory
WORKDIR /usr/src/app

# Bundle app source
COPY . .

# npm install
RUN npm install

EXPOSE 3001 9201
CMD [ "npm", "run", "watchserver" ]
CMD [ "npm", "run", "startdev" ]


================================================
FILE: dockerized-containers/e-Commerce-Auth/README.md
================================================
# Application for e-commerce Hub


REST API to support application features

  - Express as web framework with Typescript
  - Passport js for social authentication 
  - Express CORS enabled
  - boom for error codes & Joi for Validation
  - Winston for logging and express minitor for monitoring
  - Mongoose as ODM driver
  - eslint validation extending airbnb styleguide 
  - git hooks & CI/CD in place
  - Typescript based compilation tsc compiler
  - TDD in progress with Mocha
  - JWT based authentication
  - multiple Mongoose collection with referencing
  - payment gateway Integration
  - Heroku deployment
  - Mini e-commerce platform 

# Cart Application #

"It's just simple application to provide REST APIs for mini e-commerce platform where individual can buy products and can pay the bills

```
# Application Execution
```javascript
git clone  repo
npm install
npm run startdev
tsc -- watch
```
# Application configuration
```javascript
env.sh need to be added locally 
export NODE_ENV="dev"
export PORT="3005"
export MONGOURL="mongodb://mongo/hello"
export EXPRESS_SESSION_SECRET="************************"
export F_CLIENTID="**************"
export F_CLIENTSECRET="**********************"
```

# Application NPM Script
```javascript
"start": "cd dist &&  nodemon server.js",
"prestart": "tsc && cp -r uploads dist/ && cp -r app/global dist/app/",
"clean" : "rm -rf dist",
"copy" : "cp -r uploads dist/ && cp -r app/global dist/app/"
```


================================================
FILE: dockerized-containers/e-Commerce-Auth/app/config/email.ts
================================================
'use strict';

export default {

  global: {
    from: 'info@kpilibrary.com',
  },
  welcome: {
    subject: 'Welcome to KPI Library',
  },
  password_reset: {
    subject: 'KPI Library: Reset your password',
  },
  event_booked_guest: {
    subject: 'KPI Library: Your Booking Has Been Confirmed',
  },
  event_booked_host: {
    subject: 'KPI Library: Your Event Has Been Booked',
  },
  event_booked_guests_notification: {
    subject: 'KPI Library: Your Booking Has Been Confirmed',
  },
  message_received: {
    subject: 'KPI Library: New Message Received',
  },
  guest_review_email: {
    subject: 'KPI Library: Event Completed',
  },
  alacarte_booked_guest: {
    subject: 'KPI Library: Alacarte Booking Details',
  },
  alacarte_booked_host: {
    subject: 'KPI Library: Your Alacarte Has Been Booked',
  }
}



================================================
FILE: dockerized-containers/e-Commerce-Auth/app/config/environments/dev.ts
================================================
/* eslint quote-props: 0 */
export { }
const configuration: any = {};

configuration.db = {
  mysql: {
    user: process.env.USERNAME,
    password: process.env.PASSWORD,
    database: process.env.DATABASE,
    host: process.env.HOST,
    connectTimeout: 100000
  },
  mongo: {
    host: process.env.MONGO_HOST,
    port: process.env.MONGO_PORT,
    uername: process.env.MONGO_USERNAME,
    password: process.env.MONGO_PASSWORD,
    database: process.env.MONGO_DATABASE
  }
};

configuration.URL = {
  frontEnd: process.env.FE_URL
}
configuration.facebook = {
  client_id: process.env.F_CLIENTID,
  client_secret: process.env.F_CLIENTSECRET,
  callback_url: process.env.F_CALLBACK
};
configuration.google = {
  client_id: process.env.G_CLIENTID,
  client_secret: process.env.G_CLIENTSECRET,
  callback_url: process.env.G_CALLBACK
};
configuration.linkedin = {
  client_id: process.env.L_CLIENTID,
  client_secret: process.env.L_CLIENTSECRET,
  callback_url: process.env.L_CALLBACK
};
configuration.twitter = {
  client_id: process.env.T_CLIENTID,
  client_secret: process.env.T_CLIENTSECRET,
  callback_url: process.env.T_CALLBACK
};
configuration.email = {
  apiKey: process.env.API_KEY,
  host: process.env.SMTP_HOST,
  port: process.env.SMTP_PORT,
  auth: {
    user: process.env.SMTP_USER,
    pass: process.env.SMTP_PASSWORD,
  }
}
configuration.twilio = {
  sid: process.env.SID,
  token: process.env.TOKEN,
  phone: process.env.PHONE,
}
configuration.url = {
  FE: process.env.FE,
  API: process.env.API,
}
configuration.uploadpath = {
  uploaddir: process.env.UPLOAD_DIR,
  profiledir: process.env.PROFILE_PICTURE_DIR
}

module.exports = configuration;

================================================
FILE: dockerized-containers/e-Commerce-Auth/app/config/environments/qa.ts
================================================
/* eslint quote-props: 0 */
export { }
const configuration: any = {};
configuration.mongo = {
  url:  process.env.MONGODB_URI || process.env.MONGOURL,
};
configuration.URL = {
  frontEnd: process.env.FE_URL
}
configuration.facebook = {
  client_id: process.env.F_CLIENTID,
  client_secret: process.env.F_CLIENTSECRET,
  callback_url: process.env.F_CALLBACK
};
configuration.google = {
  client_id: process.env.G_CLIENTID,
  client_secret: process.env.G_CLIENTSECRET,
  callback_url: process.env.G_CALLBACK
};
configuration.linkedin = {
  client_id: process.env.L_CLIENTID,
  client_secret: process.env.L_CLIENTSECRET,
  callback_url: process.env.L_CALLBACK
};
configuration.twitter = {
  client_id: process.env.T_CLIENTID,
  client_secret: process.env.T_CLIENTSECRET,
  callback_url: process.env.T_CALLBACK
};
configuration.email = {
  apiKey: process.env.API_KEY,
  host: process.env.SMTP_HOST,
  port: process.env.SMTP_PORT,
  auth: {
    user: process.env.SMTP_USER,
    pass: process.env.SMTP_PASSWORD,
  }
}
configuration.twilio = {
  sid: process.env.SID,
  token: process.env.TOKEN,
  phone: process.env.PHONE,
}
configuration.url = {
  FE: process.env.FE,
  API: process.env.API,
}
configuration.uploadpath = {
  uploaddir: process.env.UPLOAD_DIR,
  profiledir: process.env.PROFILE_PICTURE_DIR
}
module.exports = configuration;


================================================
FILE: dockerized-containers/e-Commerce-Auth/app/config/environments/test.ts
================================================
/* eslint quote-props: 0 */
export { }
const configuration: any = {};
configuration.mongo = {
  url:  process.env.MONGODB_URI || process.env.MONGOURL,
};
configuration.URL = {
  frontEnd: process.env.FE_URL
}
configuration.facebook = {
  client_id: process.env.F_CLIENTID,
  client_secret: process.env.F_CLIENTSECRET,
  callback_url: process.env.F_CALLBACK
};
configuration.google = {
  client_id: process.env.G_CLIENTID,
  client_secret: process.env.G_CLIENTSECRET,
  callback_url: process.env.G_CALLBACK
};
configuration.linkedin = {
  client_id: process.env.L_CLIENTID,
  client_secret: process.env.L_CLIENTSECRET,
  callback_url: process.env.L_CALLBACK
};
configuration.twitter = {
  client_id: process.env.T_CLIENTID,
  client_secret: process.env.T_CLIENTSECRET,
  callback_url: process.env.T_CALLBACK
};
configuration.email = {
  apiKey: process.env.API_KEY,
  host: process.env.SMTP_HOST,
  port: process.env.SMTP_PORT,
  auth: {
    user: process.env.SMTP_USER,
    pass: process.env.SMTP_PASSWORD,
  }
}
configuration.twilio = {
  sid: process.env.SID,
  token: process.env.TOKEN,
  phone: process.env.PHONE,
}
configuration.url = {
  FE: process.env.FE,
  API: process.env.API,
}
configuration.uploadpath = {
  uploaddir: process.env.UPLOAD_DIR,
  profiledir: process.env.PROFILE_PICTURE_DIR
}
module.exports = configuration;


================================================
FILE: dockerized-containers/e-Commerce-Auth/app/controller/UserController.ts
================================================
const uuidv4 = require('uuid/v4');
import User from '../models/user';
declare function require(name: string);
import Helper from '../helper/bcrypt';
const jwt = require('jsonwebtoken');
import helper from '../helper/bcrypt';
import mailEvents from '../events/notification';
import logger from '../helper/logger';
import email from '../helper/email';

const saltRounds = 10;
class userController {

  static getUserByEmail(email, cb) {
    User.findOne({ 'email': email }, (error, user) => {
      if (user) {
        cb(null, user);
      } else {
        cb('User does not exist in system', null);
      }
    });
  }
  static validateUser(req, res, cb) {
    const { body } = req;
    User.find({ email: body.email })
      .then((data) => {
        if (data && data.length) {
          const flag = helper.comparePassword(body.password, data[0].password)
          if (flag) {
            jwt.sign(helper.buildUserToken(data[0]), 'secretkey', (tokError, token) => {
              cb(null, token);
            });
          } else {
            cb(new Error('username password does not match'), null);
          }
        }
        else {
          cb(new Error('no user found with this account email'), null);
        }
      }).catch((err)=>{
        console.log(err);
        cb(new Error('no user found with this account email'), null);
      })
  }
  static registerDefault(req, res, cb) {
    const { body } = req;
    const { location } = req;
    const hash = helper.generateSaltValue(body.password);
    return User.find({ email: body.email }).then((user) => {
      if (user && user.length > 0) {
        cb(new Error('user already regitsered with us'), null);
      } else {
        return User.create(this.buildUser(body, hash, location)
          , (error, user) => {
            if (error) {
              cb(error, null);
            } else {
              logger.info('emitting user create event');
              mailEvents.emit("welcome", user);
              cb(null, user);
            }
          });
      }
    });
  }
  static buildUser(body, hash = null, location = null) {

    const build = {
      username: body.username,
      phone: body.phone,
      email: body.email,
      email_verified: false,
      phone_verified: false,
      picture: body.picture ? body.picture : null,
      status: 1,
      gender: null,
      documents: [],
      type: 1,
      social: body.meta,
      uuid: uuidv4()
    }
    return hash ? Object.assign({}, build, { password: hash }) : build;
  }
  static registerSocial(user, callback) {
      User.findOne({ email: user.email }, (error, existingUser) => {
        if (existingUser) {
          callback(null, (existingUser));
        } else {
          User.create(this.buildUser(user, null), (err, user) => {
            if (err) {
              callback(err, null);
            } else {
              callback(null, user);
              mailEvents.emit("welcome", user);
            }
          });
        }
      });

  }

  static activateUserAccount(uuid, cb) {
    User.findOne({ 'uuid': uuid }, (error, foundUser) => {
      if (foundUser) {
        foundUser.email_verified = true;
        foundUser.save(function (err) {
          if (err) {
            cb('error occoured while updating record');
          } else {
            cb(null, 'done');
          }
        });
      } else {
        cb('User does not exist in system');
      }
    });
  }
  static resetPassword(email, callback) {
    // just generate password and send new password on mail
    User.findOne({ 'email': email }, (error, foundUser) => {
      if (foundUser) {
        let password = Math.random().toString(36).slice(2);
        const hash = helper.generateSaltValue(password);
        foundUser.password = hash;
        foundUser.save(function (err) {
          if (err) {
            callback('error occoured while updating record');
          } else {
            mailEvents.emit("forgotPassword", foundUser, password);
            callback(null, 'done');
          }
        });
      } else {
        callback('User does not exist in system with this email');
      }
    });
  }

  static changeUserRole(req, callback) {
    const email = req.params.email
    const body = req.body
    User.findOne({ 'email': email }, (error, user) => {
      if (user) {
        user.type = 2;
        user.save(function (err, updated_user) {
          if (err) {
            callback('error occoured while chaging role');
          } else {
            callback(null, updated_user);
          }
        });
      }
      else {
        callback('user not found in system', null);
      }
    });
  }
  static updateUser(email, data, callback) {
    User.findOne({ 'email': email }, (error, user) => {
      if (user) {
        if (data.username) { user.username = data.username; }
        if (data.gender) { user.gender = data.gender; }
        if (data.phone) { user.phone = data.phone; }
        if (data.profile_picture) { user.profile_picture = data.profile_picture; }
        if (data.password && data.password === data.confirm_password) {
          const hash = helper.generateSaltValue(data.password);
          user.password = hash;
        }
        if ( data.picture ) { user.picture = Helper.avatarURL(data.picture) }

        if (data.phone_verified) {
          user.phone_verified = true;
        }
        if (data.document) {
          user.documents.push(data.document);
        }
        if (data.meta) {
          user.meta = {
            about: data.meta.about || '',
            fun_fact: data.meta.fun_fact || '',
            payment: data.meta.payment || '',
          }
        }
        user.save(function (err, updated_user) {
          if (err) {
            callback('error occoured while updating record');
          } else {
            callback(null, updated_user);
          }
        });
      } else {
        callback('user not found', null);
      }
    });
  }
}

export default userController;


================================================
FILE: dockerized-containers/e-Commerce-Auth/app/events/notification.ts
================================================

import Email from '../helper/email';
declare function require(name: string);

const events = require('events');
const winston = require('winston');
// import Twillo from '../helper/twillo';

const eventEmitter = new events.EventEmitter();
eventEmitter.on('welcome', (user) => {
  winston.log('info', `sending welcome email to ${user.email}`);
  // Twillo.default_notification(user.phone, 'welcome')
  Email.welcome(user);
});
eventEmitter.on('forgotPassword', (user, password, uuid) => {
  winston.log('info', `sending forgotPassword email to ${user.email}`);
  Email.password_reset(user, password);
  // Twillo.default_notification(user.phone, 'welcome')
});

export default eventEmitter;


================================================
FILE: dockerized-containers/e-Commerce-Auth/app/global/templates/emails/password-reset-email/html.pug
================================================
html(lang='en')
  head
    meta(charset='utf-8')
    meta(name='viewport', content='width=device-width, initial-scale=1, shrink-to-fit=no')
    title  password has successfully been reset
    link(href='https://fonts.googleapis.com/css?family=Rubik:300,300i,400,400i,500,500i,700,700i,900,900i', rel='stylesheet')
    link(rel='shortcut icon', type='image/x-icon', href='images/favicon.ico')
    link(rel='stylesheet', href='../assets/styles/style.css', type='text/css')
  body(data-gr-c-s-loaded='true', style='')
    .template-wrapper
    table.body(border='0', cellpadding='0', cellspacing='0')
      tbody
        tr
          td  
          td.container
            .content
              table.main
                tbody
                  tr
                    td.wrapper
                      table(border='0', cellpadding='0', cellspacing='0')
                        tbody
                          tr
                            td
                              a.template-logo(href='../index.html')
                                img(src='https://kekasrijan.herokuapp.com/static/media/kpi.88a7c7c4.png', alt='')
                              p.lead
                                | Hello #{user.email}, 
                                br
                                | Your password has successfully been reset
                              table(border='0', cellpadding='0', cellspacing='0')
                                tbody
                                  tr
                                    td.mt30.mb30(align='center')
                                      table(border='0', cellpadding='0', cellspacing='0')
                                        tbody
                                          tr
                                            td
                                              p.user-text
                                                span  Your new password is #[pre #{password}]
                                                br
                                                a.btn-primary(href= login_url) Login 
                              p Thank you
                              p.mb0
                                | If you have any problems, please contact me at 
                                a.click-link(href='#') admin@gmail.com
              table.help-section
                tbody
                  tr
                    td.wrapper
                      table(border='0', cellpadding='0', cellspacing='0')
                        tbody
                          tr
                            td
                              h2.text-center.mb0 Need more help?
                              a.support-link(href='#') We're here,ready to here
              table
                tbody
                  tr
                    td.wrapper
                      table(border='0', cellpadding='0', cellspacing='0')
                        tbody
                          tr
                            td
                              p
                                | You received this email beacuse you just signed up for new account. If it look weird
                                a.default-link(href='#') view it in your browser
                  .footer
                    table(border='0', cellpadding='0', cellspacing='0')
                      tbody
                        tr
                          td.content-block
                            p.text-center
                              | © 2018 KPI App, Goa India
                              br
                              |  If these emails get annoying, please feel to 
                              a(href='#') unsubscribe
          td  


================================================
FILE: dockerized-containers/e-Commerce-Auth/app/global/templates/emails/password-reset-email/style.css
================================================
@charset "UTF-8";
/* -------------------------------------
          GLOBAL RESETS
      ------------------------------------- */

.container {
  display: block;
  Margin: 0 auto !important;
  max-width: 580px;
  padding: 10px;
  width: 580px;
  position: relative;
  bottom: 140px;
}

img {
  border: none;
  -ms-interpolation-mode: bicubic;
  max-width: 100%;
}

body {
  background-color: #f6f6f6;
  font-family: 'Rubik', sans-serif;
  font-size: 15px;
  line-height: 28px;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

table {
  border-collapse: separate;
  mso-table-lspace: 0pt;
  mso-table-rspace: 0pt;
  width: 100%;
}

table td {
  font-family: sans-serif;
  font-size: 14px;
  vertical-align: top;
}

/* -------------------------------------
          BODY & CONTAINER
      ------------------------------------- */

.body {
  background-color: #f6f6f6;
  width: 100%;
}

.lead {
  font-size: 18px;
}

.mt30 {
  margin-top: 30px;
  display: block;
}

.mb30 {
  margin-bottom: 30px;
  display: block;
}

/* Set a max-width, and make it display as block so it will automatically stretch to that width, but will also shrink down on a phone or something */

.container {
  display: block;
  Margin: 0 auto !important;
  /* makes it centered */
  max-width: 580px;
  padding: 10px;
  width: 580px;
  position: relative;
  bottom: 140px;
}

/* This should also be a block element, so that it will fill 100% of the .container */

.content {
  box-sizing: border-box;
  display: block;
  Margin: 0 auto;
  max-width: 580px;
  padding: 10px;
}

/* -------------------------------------
          HEADER, FOOTER, MAIN
      ------------------------------------- */

.template-wrapper {
  background-color: #03A9F4;
  width: 100%;
  height: 250px;
  position: relative;
}

.click-link {
  color: #03A9F4;
  display: inline-block;
  margin-bottom: 20px;
}

.help-section {
  background-color: #ffdcdc;
  border-radius: 3px;
  width: 100%;
  text-align: center;
}

.mb0 {
  margin-bottom: 0px;
}

.support-link {
  color: #03A9F4;
  display: inline-block;
  font-size: 19px;
  margin-bottom: 0px;
}

.template-logo {
  display: block;
  margin-bottom: 40px;
  margin: auto;
}

.user-text {
  font-size: 18px;
  font-weight: 500;
}

.user-text span {
  font-weight: 600;
}

.text-secondary {
  color: #218ef4 !important
}

.main {
  background: #ffffff;
  border-radius: 3px;
  width: 100%;
  margin-bottom: 20px;
}

.wrapper {
  box-sizing: border-box;
  padding: 40px 25px;
}

.content-block {
  padding-bottom: 10px;
  padding-top: 10px;
  line-height: 2;
}

.footer {
  clear: both;
  text-align: center;
  width: 100%;
}

.footer td, .footer p, .footer span, .footer a {
  color: #999999;
  font-size: 12px;
  text-align: center;
}

/* -------------------------------------
          TYPOGRAPHY
      ------------------------------------- */

h1, h2, h3, h4 {
  color: #000000;
  font-family: sans-serif;
  font-weight: 400;
  line-height: 1.4;
  margin: 0;
  Margin-bottom: 30px;
}

h1 {
  font-size: 35px;
  font-weight: 300;
  text-align: center;
  text-transform: capitalize;
}

p, ul, ol {
  font-family: sans-serif;
  font-size: 15px;
  font-weight: normal;
  margin: 0;
  margin-bottom: 15px;
}

p li, ul li, ol li {
  list-style-position: inside;
  margin-left: 5px;
}

a {
  color: #3498db;
  text-decoration: underline;
}

/* -------------------------------------
          BUTTONS
      ------------------------------------- */

.btn {
  box-sizing: border-box;
  width: 100%;
}

.btn>tbody>tr>td {
  padding-bottom: 15px;
}

.btn table {
  width: auto;
}

.btn table td {
  background-color: #ffffff;
  border-radius: 5px;
  text-align: center;
}

.btn a {
  background-color: #ffffff;
  border: solid 1px #3498db;
  border-radius: 5px;
  box-sizing: border-box;
  color: #3498db;
  cursor: pointer;
  display: inline-block;
  font-size: 14px;
  font-weight: bold;
  margin: 0;
  padding: 12px 25px;
  text-decoration: none;
  text-transform: capitalize;
}

.btn-primary table td {
  background-color: #3498db;
}

.btn-primary a {
  background-color: #03A9F4;
  border-color: #03A9F4;
  color: #ffffff;
}

.default-link {
  color: #03A9F4;
}

.default-link:hover {
  color: #03A9F4;
}

/* -------------------------------------
          OTHER STYLES THAT MIGHT BE USEFUL
      ------------------------------------- */

.last {
  margin-bottom: 0;
}

.first {
  margin-top: 0;
}

.align-center {
  text-align: center;
}

.align-right {
  text-align: right;
}

.align-left {
  text-align: left;
}

.clear {
  clear: both;
}

.mt0 {
  margin-top: 0;
}

.mb0 {
  margin-bottom: 0;
}

.preheader {
  color: transparent;
  display: none;
  height: 0;
  max-height: 0;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  visibility: hidden;
  width: 0;
}

.powered-by a {
  text-decoration: none;
}

hr {
  border: 0;
  border-bottom: 1px solid #f6f6f6;
  Margin: 20px 0;
}

/* -------------------------------------
          RESPONSIVE AND MOBILE FRIENDLY STYLES
      ------------------------------------- */

@media only screen and (max-width: 620px) {
  table[class=body] h1 {
    font-size: 28px !important;
    margin-bottom: 10px !important;
  }
  table[class=body] p, table[class=body] ul, table[class=body] ol, table[class=body] td, table[class=body] span, table[class=body] a {
    font-size: 16px !important;
  }
  table[class=body] .wrapper, table[class=body] .article {
    padding: 10px !important;
  }
  table[class=body] .content {
    padding: 0 !important;
  }
  table[class=body] .container {
    padding: 0 !important;
    width: 100% !important;
  }
  table[class=body] .main {
    border-left-width: 0 !important;
    border-radius: 0 !important;
    border-right-width: 0 !important;
  }
  table[class=body] .btn table {
    width: 100% !important;
  }
  table[class=body] .btn a {
    width: 100% !important;
  }
  table[class=body] .img-responsive {
    height: auto !important;
    max-width: 100% !important;
    width: auto !important;
  }
}

/* -------------------------------------
          PRESERVE THESE STYLES IN THE HEAD
      ------------------------------------- */

@media all {
  .ExternalClass {
    width: 100%;
  }
  .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {
    line-height: 100%;
  }
  .apple-link a {
    color: inherit !important;
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    text-decoration: none !important;
  }
  .btn-primary table td:hover {
    background-color: #34495e !important;
  }
  .btn-primary a:hover {
    background-color: #03A9F4 !important;
    border-color: #03A9F4 !important;
  }
}
.btn-primary {
  text-decoration: none;
  color: #FFF;
  background-color: #03A9F4;
  border: solid #03A9F4;
  border-width: 6px 18px;
  line-height: 2em;
  /* 2em * 14px = 28px, use px to get airier line-height also in Thunderbird, and Yahoo!, Outlook.com, AOL webmail clients */
  /*line-height: 28px;*/
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  display: inline-block;
  border-radius: 4px;
  text-transform: capitalize;
}

================================================
FILE: dockerized-containers/e-Commerce-Auth/app/global/templates/emails/welcome-email/html.pug
================================================
html(lang='en')
  head
    meta(charset='utf-8')
    meta(name='viewport', content='width=device-width, initial-scale=1, shrink-to-fit=no')
    title Account Activation email || KPI Library
    link(href='https://fonts.googleapis.com/css?family=Rubik:300,300i,400,400i,500,500i,700,700i,900,900i', rel='stylesheet')
    link(rel='shortcut icon', type='image/x-icon', href='images/favicon.ico')
    link(rel='stylesheet', href='../assets/styles/style.css', type='text/css')
  body(data-gr-c-s-loaded='true', style='')
    .template-wrapper
    table.body(border='0', cellpadding='0', cellspacing='0')
      tbody
        tr
          td  
          td.container
            .content
              table.main
                tbody
                  tr
                    td.wrapper
                      table(border='0', cellpadding='0', cellspacing='0')
                        tbody
                          tr
                            td
                              a.template-logo(href='../index.html')
                                img(src='https://kekasrijan.herokuapp.com/static/media/kpi.88a7c7c4.png', alt='')
                              p.lead
                                | Hello KPI Library, 
                                br
                                | Thanks for Signup on KPI App
                                br
                                | We have sent User Account Activation Link below
                              table(border='0', cellpadding='0', cellspacing='0')
                                tbody
                                  tr
                                    td.mt30.mb30(align='center')
                                      table(border='0', cellpadding='0', cellspacing='0')
                                        tbody
                                          tr
                                            td
                                              p.user-text
                                                | Hi,
                                                span #{user.email},
                                                br
                                                br
                                                a.btn-primary(href= activate_url) Activate  your Account
                              p Thank you
                              p.mb0
                                | If you have any problems, please contact me at 
                                a.click-link(href='#') admin@gmail.com
              table.help-section
                tbody
                  tr
                    td.wrapper
                      table(border='0', cellpadding='0', cellspacing='0')
                        tbody
                          tr
                            td
                              h2.text-center.mb0 Need more help?
                              a.support-link(href='#') We're here,ready to here
              table
                tbody
                  tr
                    td.wrapper
                      table(border='0', cellpadding='0', cellspacing='0')
                        tbody
                          tr
                            td
                              p
                                | You received this email beacuse you just signed up for new account. If it look weird
                                a.default-link(href='#') view it in your browser
                  .footer
                    table(border='0', cellpadding='0', cellspacing='0')
                      tbody
                        tr
                          td.content-block
                            p.text-center
                              | © 2018 KPI App, Goa India
                              br
                              |  If these emails get annoying, please feel to 
                              a(href='#') unsubscribe
          td  


================================================
FILE: dockerized-containers/e-Commerce-Auth/app/global/templates/emails/welcome-email/style.css
================================================
@charset "UTF-8";
/* -------------------------------------
          GLOBAL RESETS
      ------------------------------------- */

.container {
  display: block;
  Margin: 0 auto !important;
  max-width: 580px;
  padding: 10px;
  width: 580px;
  position: relative;
  bottom: 140px;
}

img {
  border: none;
  -ms-interpolation-mode: bicubic;
  max-width: 100%;
}

body {
  background-color: #f6f6f6;
  font-family: 'Rubik', sans-serif;
  font-size: 15px;
  line-height: 28px;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

table {
  border-collapse: separate;
  mso-table-lspace: 0pt;
  mso-table-rspace: 0pt;
  width: 100%;
}

table td {
  font-family: sans-serif;
  font-size: 14px;
  vertical-align: top;
}

/* -------------------------------------
          BODY & CONTAINER
      ------------------------------------- */

.body {
  background-color: #f6f6f6;
  width: 100%;
}

.lead {
  font-size: 18px;
}

.mt30 {
  margin-top: 30px;
  display: block;
}

.mb30 {
  margin-bottom: 30px;
  display: block;
}

/* Set a max-width, and make it display as block so it will automatically stretch to that width, but will also shrink down on a phone or something */

.container {
  display: block;
  Margin: 0 auto !important;
  /* makes it centered */
  max-width: 580px;
  padding: 10px;
  width: 580px;
  position: relative;
  bottom: 140px;
}

/* This should also be a block element, so that it will fill 100% of the .container */

.content {
  box-sizing: border-box;
  display: block;
  Margin: 0 auto;
  max-width: 580px;
  padding: 10px;
}

/* -------------------------------------
          HEADER, FOOTER, MAIN
      ------------------------------------- */

.template-wrapper {
  background-color: #03A9F4;
  width: 100%;
  height: 250px;
  position: relative;
}

.click-link {
  color: #03A9F4;
  display: inline-block;
  margin-bottom: 20px;
}

.help-section {
  background-color: #ffdcdc;
  border-radius: 3px;
  width: 100%;
  text-align: center;
}

.mb0 {
  margin-bottom: 0px;
}

.support-link {
  color: #03A9F4;
  display: inline-block;
  font-size: 19px;
  margin-bottom: 0px;
}

.template-logo {
  display: block;
  margin-bottom: 40px;
  margin: auto;
}

.user-text {
  font-size: 18px;
  font-weight: 500;
}

.user-text span {
  font-weight: 600;
}

.text-secondary {
  color: #218ef4 !important
}

.main {
  background: #ffffff;
  border-radius: 3px;
  width: 100%;
  margin-bottom: 20px;
}

.wrapper {
  box-sizing: border-box;
  padding: 40px 25px;
}

.content-block {
  padding-bottom: 10px;
  padding-top: 10px;
  line-height: 2;
}

.footer {
  clear: both;
  text-align: center;
  width: 100%;
}

.footer td, .footer p, .footer span, .footer a {
  color: #999999;
  font-size: 12px;
  text-align: center;
}

/* -------------------------------------
          TYPOGRAPHY
      ------------------------------------- */

h1, h2, h3, h4 {
  color: #000000;
  font-family: sans-serif;
  font-weight: 400;
  line-height: 1.4;
  margin: 0;
  Margin-bottom: 30px;
}

h1 {
  font-size: 35px;
  font-weight: 300;
  text-align: center;
  text-transform: capitalize;
}

p, ul, ol {
  font-family: sans-serif;
  font-size: 15px;
  font-weight: normal;
  margin: 0;
  margin-bottom: 15px;
}

p li, ul li, ol li {
  list-style-position: inside;
  margin-left: 5px;
}

a {
  color: #3498db;
  text-decoration: underline;
}

/* -------------------------------------
          BUTTONS
      ------------------------------------- */

.btn {
  box-sizing: border-box;
  width: 100%;
}

.btn>tbody>tr>td {
  padding-bottom: 15px;
}

.btn table {
  width: auto;
}

.btn table td {
  background-color: #ffffff;
  border-radius: 5px;
  text-align: center;
}

.btn a {
  background-color: #ffffff;
  border: solid 1px #3498db;
  border-radius: 5px;
  box-sizing: border-box;
  color: #3498db;
  cursor: pointer;
  display: inline-block;
  font-size: 14px;
  font-weight: bold;
  margin: 0;
  padding: 12px 25px;
  text-decoration: none;
  text-transform: capitalize;
}

.btn-primary table td {
  background-color: #3498db;
}

.btn-primary a {
  background-color: #3498db;
  border-color: #3498db;
  color: #ffffff;
}

.default-link {
  color: #3498db;
}

.default-link:hover {
  color: #3498db;
}

/* -------------------------------------
          OTHER STYLES THAT MIGHT BE USEFUL
      ------------------------------------- */

.last {
  margin-bottom: 0;
}

.first {
  margin-top: 0;
}

.align-center {
  text-align: center;
}

.align-right {
  text-align: right;
}

.align-left {
  text-align: left;
}

.clear {
  clear: both;
}

.mt0 {
  margin-top: 0;
}

.mb0 {
  margin-bottom: 0;
}

.preheader {
  color: transparent;
  display: none;
  height: 0;
  max-height: 0;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  visibility: hidden;
  width: 0;
}

.powered-by a {
  text-decoration: none;
}

hr {
  border: 0;
  border-bottom: 1px solid #f6f6f6;
  Margin: 20px 0;
}

/* -------------------------------------
          RESPONSIVE AND MOBILE FRIENDLY STYLES
      ------------------------------------- */

@media only screen and (max-width: 620px) {
  table[class=body] h1 {
    font-size: 28px !important;
    margin-bottom: 10px !important;
  }
  table[class=body] p, table[class=body] ul, table[class=body] ol, table[class=body] td, table[class=body] span, table[class=body] a {
    font-size: 16px !important;
  }
  table[class=body] .wrapper, table[class=body] .article {
    padding: 10px !important;
  }
  table[class=body] .content {
    padding: 0 !important;
  }
  table[class=body] .container {
    padding: 0 !important;
    width: 100% !important;
  }
  table[class=body] .main {
    border-left-width: 0 !important;
    border-radius: 0 !important;
    border-right-width: 0 !important;
  }
  table[class=body] .btn table {
    width: 100% !important;
  }
  table[class=body] .btn a {
    width: 100% !important;
  }
  table[class=body] .img-responsive {
    height: auto !important;
    max-width: 100% !important;
    width: auto !important;
  }
}

/* -------------------------------------
          PRESERVE THESE STYLES IN THE HEAD
      ------------------------------------- */

@media all {
  .ExternalClass {
    width: 100%;
  }
  .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {
    line-height: 100%;
  }
  .apple-link a {
    color: inherit !important;
  
Download .txt
gitextract_2afopmxn/

├── README.md
├── api-gateway-and-service-doscovery/
│   ├── .gitignore
│   ├── README.md
│   ├── ServicesSetup.sh
│   ├── ServicesStart.sh
│   ├── api-gateway/
│   │   ├── Dockerbuild.sh
│   │   ├── Dockerfile
│   │   ├── api/
│   │   │   ├── account/
│   │   │   │   ├── login.js
│   │   │   │   └── signup.js
│   │   │   └── crm/
│   │   │       └── orders/
│   │   │           └── orders.js
│   │   ├── api-gateway.js
│   │   ├── config.js
│   │   ├── config.json
│   │   ├── package.json
│   │   ├── server.js
│   │   └── services-helper.js
│   ├── service-log/
│   │   ├── Dockerbuild.sh
│   │   ├── Dockerfile
│   │   ├── config.js
│   │   ├── config.json
│   │   ├── log.js
│   │   ├── package.json
│   │   └── server.js
│   ├── service-login/
│   │   ├── Dockerbuild.sh
│   │   ├── Dockerfile
│   │   ├── config.js
│   │   ├── config.json
│   │   ├── login.js
│   │   ├── package.json
│   │   └── server.js
│   ├── service-orders/
│   │   ├── Dockerbuild.sh
│   │   ├── Dockerfile
│   │   ├── config.js
│   │   ├── config.json
│   │   ├── orders.js
│   │   ├── package.json
│   │   └── server.js
│   └── service-signup/
│       ├── Dockerbuild.sh
│       ├── Dockerfile
│       ├── config.js
│       ├── config.json
│       ├── package.json
│       ├── server.js
│       └── signup.js
├── dockerized-containers/
│   ├── .eslintrc.js
│   ├── .gitignore
│   ├── .travis.yml
│   ├── README.md
│   ├── docker-compose.yml
│   ├── e-Commerce-Admin/
│   │   ├── Dockerfile
│   │   ├── README.md
│   │   ├── app/
│   │   │   ├── config/
│   │   │   │   ├── email.ts
│   │   │   │   └── environments/
│   │   │   │       ├── dev.ts
│   │   │   │       ├── qa.ts
│   │   │   │       └── test.ts
│   │   │   ├── controller/
│   │   │   │   └── UserController.ts
│   │   │   ├── events/
│   │   │   │   └── notification.ts
│   │   │   ├── global/
│   │   │   │   └── templates/
│   │   │   │       ├── emails/
│   │   │   │       │   ├── password-reset-email/
│   │   │   │       │   │   ├── html.pug
│   │   │   │       │   │   └── style.css
│   │   │   │       │   └── welcome-email/
│   │   │   │       │       ├── html.pug
│   │   │   │       │       └── style.css
│   │   │   │       └── response/
│   │   │   │           └── index.ts
│   │   │   ├── helper/
│   │   │   │   ├── bcrypt.ts
│   │   │   │   ├── email.ts
│   │   │   │   ├── errorHandler.ts
│   │   │   │   ├── logger.ts
│   │   │   │   ├── responseTemplate.ts
│   │   │   │   └── twillo.ts
│   │   │   ├── lib/
│   │   │   │   ├── logger.ts
│   │   │   │   ├── mongoose.ts
│   │   │   │   └── requestValidator.ts
│   │   │   ├── middleware/
│   │   │   │   ├── authMiddleware.ts
│   │   │   │   └── requestValidator.ts
│   │   │   ├── models/
│   │   │   │   ├── plugin/
│   │   │   │   │   └── plugin.ts
│   │   │   │   └── user.ts
│   │   │   ├── routes/
│   │   │   │   ├── defaultRoutes.ts
│   │   │   │   ├── provider/
│   │   │   │   │   ├── Facebook.ts
│   │   │   │   │   ├── Google.ts
│   │   │   │   │   ├── Linkedin.ts
│   │   │   │   │   ├── Locale.ts
│   │   │   │   │   └── Twitter.ts
│   │   │   │   ├── routes.ts
│   │   │   │   └── userRoutes.ts
│   │   │   ├── routes.ts
│   │   │   ├── seed/
│   │   │   │   ├── seedUsers.ts
│   │   │   │   └── seedVehicle.ts
│   │   │   ├── transformer/
│   │   │   │   └── userTransformer.ts
│   │   │   └── types/
│   │   │       ├── global.d.ts
│   │   │       └── vendor.d.ts
│   │   ├── env.sh
│   │   ├── express.ts
│   │   ├── package.json
│   │   ├── public/
│   │   │   ├── javascripts/
│   │   │   │   └── script.js
│   │   │   └── style.scss
│   │   ├── server.ts
│   │   ├── tsconfig.json
│   │   ├── tslint.json
│   │   └── uploads/
│   │       ├── documents/
│   │       │   └── .gitkeep
│   │       └── profile/
│   │           └── .gitkeep
│   ├── e-Commerce-Auth/
│   │   ├── Dockerfile
│   │   ├── README.md
│   │   ├── app/
│   │   │   ├── config/
│   │   │   │   ├── email.ts
│   │   │   │   └── environments/
│   │   │   │       ├── dev.ts
│   │   │   │       ├── qa.ts
│   │   │   │       └── test.ts
│   │   │   ├── controller/
│   │   │   │   └── UserController.ts
│   │   │   ├── events/
│   │   │   │   └── notification.ts
│   │   │   ├── global/
│   │   │   │   └── templates/
│   │   │   │       ├── emails/
│   │   │   │       │   ├── password-reset-email/
│   │   │   │       │   │   ├── html.pug
│   │   │   │       │   │   └── style.css
│   │   │   │       │   └── welcome-email/
│   │   │   │       │       ├── html.pug
│   │   │   │       │       └── style.css
│   │   │   │       └── response/
│   │   │   │           └── index.ts
│   │   │   ├── helper/
│   │   │   │   ├── bcrypt.ts
│   │   │   │   ├── email.ts
│   │   │   │   ├── errorHandler.ts
│   │   │   │   ├── logger.ts
│   │   │   │   ├── responseTemplate.ts
│   │   │   │   └── twillo.ts
│   │   │   ├── lib/
│   │   │   │   ├── logger.ts
│   │   │   │   ├── mongoose.ts
│   │   │   │   └── requestValidator.ts
│   │   │   ├── middleware/
│   │   │   │   ├── authMiddleware.ts
│   │   │   │   └── requestValidator.ts
│   │   │   ├── models/
│   │   │   │   ├── plugin/
│   │   │   │   │   └── plugin.ts
│   │   │   │   └── user.ts
│   │   │   ├── routes/
│   │   │   │   ├── defaultRoutes.ts
│   │   │   │   ├── provider/
│   │   │   │   │   ├── Facebook.ts
│   │   │   │   │   ├── Google.ts
│   │   │   │   │   ├── Linkedin.ts
│   │   │   │   │   ├── Locale.ts
│   │   │   │   │   └── Twitter.ts
│   │   │   │   ├── routes.ts
│   │   │   │   └── userRoutes.ts
│   │   │   ├── routes.ts
│   │   │   ├── seed/
│   │   │   │   ├── seedUsers.ts
│   │   │   │   └── seedVehicle.ts
│   │   │   ├── transformer/
│   │   │   │   └── userTransformer.ts
│   │   │   └── types/
│   │   │       ├── global.d.ts
│   │   │       └── vendor.d.ts
│   │   ├── env.sh
│   │   ├── express.ts
│   │   ├── package.json
│   │   ├── public/
│   │   │   ├── javascripts/
│   │   │   │   └── script.js
│   │   │   └── style.scss
│   │   ├── server.ts
│   │   ├── tsconfig.json
│   │   ├── tslint.json
│   │   └── uploads/
│   │       ├── documents/
│   │       │   └── .gitkeep
│   │       └── profile/
│   │           └── .gitkeep
│   ├── e-Commerce-Cart/
│   │   ├── .sequelizerc
│   │   ├── Dockerfile
│   │   ├── README.md
│   │   ├── app/
│   │   │   ├── config/
│   │   │   │   └── environments/
│   │   │   │       ├── dev.ts
│   │   │   │       ├── qa.ts
│   │   │   │       └── test.ts
│   │   │   ├── events/
│   │   │   │   └── processEvent.ts
│   │   │   ├── helper/
│   │   │   │   ├── errorHandler.ts
│   │   │   │   ├── errors.ts
│   │   │   │   ├── logger.ts
│   │   │   │   └── responseTemplate.ts
│   │   │   ├── lib/
│   │   │   │   ├── logger.ts
│   │   │   │   ├── mysql.ts
│   │   │   │   └── requestValidator.ts
│   │   │   ├── middleware/
│   │   │   │   └── requestValidator.ts
│   │   │   ├── models/
│   │   │   │   └── data/
│   │   │   │       └── cart.ts
│   │   │   ├── routes/
│   │   │   │   └── defaultRoutes.ts
│   │   │   ├── routes.ts
│   │   │   └── types/
│   │   │       ├── global.d.ts
│   │   │       └── vendor.d.ts
│   │   ├── config/
│   │   │   └── config.js
│   │   ├── env.sh
│   │   ├── express.ts
│   │   ├── mysql/
│   │   │   └── schema.sql
│   │   ├── package.json
│   │   ├── public/
│   │   │   ├── javascripts/
│   │   │   │   └── script.js
│   │   │   └── style.scss
│   │   ├── server.ts
│   │   ├── tsconfig.json
│   │   ├── tslint.json
│   │   └── uploads/
│   │       ├── documents/
│   │       │   └── .gitkeep
│   │       └── profile/
│   │           └── .gitkeep
│   ├── e-Commerce-Client/
│   │   ├── Dockerfile
│   │   ├── README.md
│   │   ├── env.sh
│   │   ├── firebase.json
│   │   ├── package.json
│   │   ├── public/
│   │   │   ├── index.html
│   │   │   ├── manifest.json
│   │   │   └── normalize.css
│   │   └── src/
│   │       ├── api/
│   │       │   └── index.js
│   │       ├── components/
│   │       │   ├── App/
│   │       │   │   └── index.js
│   │       │   ├── Checkbox/
│   │       │   │   └── index.js
│   │       │   ├── FloatCart/
│   │       │   │   ├── CartProduct/
│   │       │   │   │   └── index.js
│   │       │   │   ├── index.js
│   │       │   │   └── style.scss
│   │       │   ├── Selectbox/
│   │       │   │   └── index.js
│   │       │   ├── Shelf/
│   │       │   │   ├── Filter/
│   │       │   │   │   ├── index.js
│   │       │   │   │   └── style.scss
│   │       │   │   ├── ProductList/
│   │       │   │   │   ├── Product/
│   │       │   │   │   │   └── index.js
│   │       │   │   │   └── index.js
│   │       │   │   ├── ShelfHeader/
│   │       │   │   │   └── index.js
│   │       │   │   ├── Sort/
│   │       │   │   │   └── index.js
│   │       │   │   ├── index.js
│   │       │   │   └── style.scss
│   │       │   ├── Spinner/
│   │       │   │   ├── index.js
│   │       │   │   └── style.scss
│   │       │   └── Thumb/
│   │       │       └── index.js
│   │       ├── config/
│   │       │   ├── index.js
│   │       │   └── server.js
│   │       ├── index.js
│   │       ├── index.scss
│   │       ├── layout/
│   │       │   ├── Auth.js
│   │       │   └── Public.js
│   │       ├── services/
│   │       │   ├── auth/
│   │       │   │   ├── Login.js
│   │       │   │   ├── Logout.js
│   │       │   │   ├── Register.js
│   │       │   │   ├── ResetPassword.js
│   │       │   │   ├── ValidateToken.js
│   │       │   │   ├── action.js
│   │       │   │   ├── actionTypes.js
│   │       │   │   ├── auth.scss
│   │       │   │   └── reducer.js
│   │       │   ├── cart/
│   │       │   │   ├── actionTypes.js
│   │       │   │   ├── actions.js
│   │       │   │   └── reducer.js
│   │       │   ├── filters/
│   │       │   │   ├── actionTypes.js
│   │       │   │   ├── actions.js
│   │       │   │   └── reducer.js
│   │       │   ├── reducers.js
│   │       │   ├── shelf/
│   │       │   │   ├── actionTypes.js
│   │       │   │   ├── actions.js
│   │       │   │   └── reducer.js
│   │       │   ├── sort/
│   │       │   │   ├── actionTypes.js
│   │       │   │   ├── actions.js
│   │       │   │   └── reducer.js
│   │       │   ├── store.js
│   │       │   ├── total/
│   │       │   │   ├── actionTypes.js
│   │       │   │   ├── actions.js
│   │       │   │   └── reducer.js
│   │       │   └── util.js
│   │       ├── setupTests.js
│   │       └── util/
│   │           ├── helper/
│   │           │   └── index.js
│   │           └── middleware/
│   │               ├── auth.js
│   │               └── index.js
│   └── proxy/
│       ├── default.conf
│       ├── hosts
│       └── ssl/
│           ├── pac.crt
│           └── pac.key
├── event-driven-microservices-docker/
│   ├── .githooks/
│   │   ├── pre-commit
│   │   ├── pre-commit.d/
│   │   │   ├── articles-management-service
│   │   │   ├── events-management-service
│   │   │   ├── notification-service
│   │   │   └── user-management-service
│   │   ├── pre-push
│   │   └── pre-push.d/
│   │       ├── articles-management-service
│   │       ├── events-management-service
│   │       ├── notification-service
│   │       └── user-management-service
│   ├── .gitignore
│   ├── docker-compose.yml
│   ├── run_all_tests
│   └── services/
│       ├── articles-management/
│       │   ├── .dockerignore
│       │   ├── .eslintignore
│       │   ├── .eslintrc.yml
│       │   ├── .gitignore
│       │   ├── Dockerfile
│       │   ├── package.json
│       │   ├── src/
│       │   │   ├── app.js
│       │   │   ├── controllers/
│       │   │   │   ├── __mocks__/
│       │   │   │   │   └── article.controller.js
│       │   │   │   └── article.controller.js
│       │   │   ├── environment/
│       │   │   │   └── config.js
│       │   │   ├── message-bus/
│       │   │   │   └── send/
│       │   │   │       ├── __mocks__/
│       │   │   │       │   └── article.added.js
│       │   │   │       └── article.added.js
│       │   │   ├── middlewares/
│       │   │   │   ├── __mocks__/
│       │   │   │   │   └── jwt.js
│       │   │   │   └── jwt.js
│       │   │   ├── models/
│       │   │   │   ├── __mocks__/
│       │   │   │   │   └── article.model.js
│       │   │   │   └── article.model.js
│       │   │   ├── routes/
│       │   │   │   └── article.routes.js
│       │   │   └── server.js
│       │   └── tests/
│       │       └── unit/
│       │           ├── __snapshots__/
│       │           │   └── article.added.message.send.test.js.snap
│       │           ├── app.test.js
│       │           ├── article.added.message.send.test.js
│       │           ├── article.controller.test.js
│       │           ├── article.model.test.js
│       │           ├── article.routes.test.js
│       │           ├── config.test.js
│       │           └── server.test.js
│       ├── authentication/
│       │   ├── .dockerignore
│       │   ├── .eslintrc.yml
│       │   ├── .gitignore
│       │   ├── .gitkeep
│       │   ├── .snyk
│       │   ├── Dockerfile
│       │   ├── package.json
│       │   └── src/
│       │       ├── app.js
│       │       ├── controllers/
│       │       │   └── auth.controller.js
│       │       ├── environment/
│       │       │   └── config.js
│       │       ├── message-bus/
│       │       │   └── recieve/
│       │       │       └── user.added.js
│       │       ├── models/
│       │       │   └── auth.model.js
│       │       ├── routes/
│       │       │   └── auth.routes.js
│       │       └── server.js
│       ├── events-management/
│       │   ├── .dockerignore
│       │   ├── .eslintrc.yml
│       │   ├── .gitignore
│       │   ├── Dockerfile
│       │   ├── package.json
│       │   ├── src/
│       │   │   ├── app.js
│       │   │   ├── controllers/
│       │   │   │   ├── __mocks__/
│       │   │   │   │   └── event.controller.js
│       │   │   │   └── event.controller.js
│       │   │   ├── environment/
│       │   │   │   └── config.js
│       │   │   ├── middlewares/
│       │   │   │   ├── __mocks__/
│       │   │   │   │   └── jwt.js
│       │   │   │   └── jwt.js
│       │   │   ├── models/
│       │   │   │   ├── __mocks__/
│       │   │   │   │   └── event.model.js
│       │   │   │   └── event.model.js
│       │   │   ├── routes/
│       │   │   │   └── event.routes.js
│       │   │   └── server.js
│       │   └── tests/
│       │       └── unit/
│       │           ├── app.test.js
│       │           ├── config.test.js
│       │           ├── event.controller.test.js
│       │           ├── event.model.test.js
│       │           ├── event.routes.test.js
│       │           └── server.test.js
│       ├── media-management/
│       │   └── .gitkeep
│       ├── notification/
│       │   ├── .eslintrc.yml
│       │   ├── .gitignore
│       │   ├── Dockerfile
│       │   ├── __mocks__/
│       │   │   ├── amqp-ts-async.js
│       │   │   ├── koa.js
│       │   │   ├── nodemailer.js
│       │   │   └── winston.js
│       │   ├── package.json
│       │   ├── src/
│       │   │   ├── environment/
│       │   │   │   └── config.js
│       │   │   ├── message-controllers/
│       │   │   │   ├── __mocks__/
│       │   │   │   │   └── articles.js
│       │   │   │   └── articles.js
│       │   │   ├── modules/
│       │   │   │   └── email/
│       │   │   │       ├── __mocks__/
│       │   │   │       │   ├── email.js
│       │   │   │       │   └── email.templates.js
│       │   │   │       ├── email.js
│       │   │   │       └── email.templates.js
│       │   │   ├── server.js
│       │   │   └── subscriptions/
│       │   │       ├── __mocks__/
│       │   │       │   └── article.added.js
│       │   │       └── article.added.js
│       │   └── tests/
│       │       └── unit/
│       │           ├── __snapshots__/
│       │           │   ├── config.test.js.snap
│       │           │   ├── email.templates.test.js.snap
│       │           │   └── email.test.js.snap
│       │           ├── article.added.subscription.test.js
│       │           ├── article.message.controller.test.js
│       │           ├── config.test.js
│       │           ├── email.templates.test.js
│       │           ├── email.test.js
│       │           └── server.test.js
│       ├── search/
│       │   └── .gitkeep
│       └── user-management/
│           ├── .dockerignore
│           ├── .eslintrc.yml
│           ├── .gitignore
│           ├── .gitkeep
│           ├── Dockerfile
│           ├── __mocks__/
│           │   ├── amqp-ts-async.js
│           │   └── winston.js
│           ├── package.json
│           ├── src/
│           │   ├── app.js
│           │   ├── controllers/
│           │   │   ├── __mocks__/
│           │   │   │   └── user.controller.js
│           │   │   └── user.controller.js
│           │   ├── environment/
│           │   │   └── config.js
│           │   ├── message-bus/
│           │   │   └── send/
│           │   │       └── user.added.js
│           │   ├── middlewares/
│           │   │   ├── __mocks__/
│           │   │   │   └── jwt.js
│           │   │   └── jwt.js
│           │   ├── models/
│           │   │   ├── __mocks__/
│           │   │   │   └── user.model.js
│           │   │   └── user.model.js
│           │   ├── routes/
│           │   │   └── user.routes.js
│           │   └── server.js
│           └── tests/
│               └── unit/
│                   ├── __snapshots__/
│                   │   ├── user.added.message.send.test.js.snap
│                   │   └── user.controller.test.js.snap
│                   ├── app.test.js
│                   ├── config.test.js
│                   ├── server.test.js
│                   ├── user.added.message.send.test.js
│                   ├── user.controller.test.js
│                   ├── user.model.test.js
│                   └── user.routes.test.js
├── node js-with-serverless/
│   ├── .gitignore
│   ├── README.md
│   ├── functions/
│   │   ├── delete_item.ts
│   │   ├── edit_item.ts
│   │   ├── read_all.ts
│   │   ├── read_single_item.ts
│   │   └── write_item.ts
│   ├── models/
│   │   └── table_schema.ts
│   ├── package.json
│   ├── serverless.yml
│   └── shared/
│       ├── create_dynamo.ts
│       └── update_dynamo.ts
├── node-js-lambda-sqs-serverless/
│   ├── .gitignore
│   ├── README.md
│   ├── data.json
│   ├── db.js
│   ├── handler.js
│   ├── models/
│   │   └── note.js
│   ├── package.json
│   ├── serverless.yml
│   └── sqs.js
├── node-microservice-starter/
│   ├── .dockerignore
│   ├── .editorconfig
│   ├── .gitattributes
│   ├── .gitignore
│   ├── README.md
│   ├── docker-compose.yml
│   ├── nginx/
│   │   ├── Dockerfile
│   │   └── nginx.conf
│   └── users/
│       ├── .eslintrc.js
│       ├── .prettierrc
│       ├── Dockerfile
│       ├── README.md
│       ├── nest-cli.json
│       ├── package.json
│       ├── src/
│       │   ├── app.controller.spec.ts
│       │   ├── app.controller.ts
│       │   ├── app.module.ts
│       │   ├── app.service.ts
│       │   └── main.ts
│       ├── test/
│       │   ├── app.e2e-spec.ts
│       │   └── jest-e2e.json
│       ├── tsconfig.build.json
│       └── tsconfig.json
├── nodejs-cqrs-pattern/
│   ├── .dockerignore
│   ├── .gitignore
│   ├── Dockerfile
│   ├── README.md
│   ├── config.ts
│   ├── docker-compose.yml
│   ├── docs/
│   │   └── README.md
│   ├── githooks/
│   │   └── README.md
│   ├── nest-cli.json
│   ├── nodemon-debug.json
│   ├── nodemon.json
│   ├── package.json
│   ├── scripts/
│   │   ├── down.sh
│   │   └── up.sh
│   ├── src/
│   │   ├── app.module.ts
│   │   ├── core/
│   │   │   └── event-store/
│   │   │       ├── event-store.class.ts
│   │   │       ├── event-store.interface.ts
│   │   │       ├── event-store.module.ts
│   │   │       ├── event-store.provider.ts
│   │   │       └── event-store.ts
│   │   ├── main.ts
│   │   └── users/
│   │       ├── commands/
│   │       │   ├── handlers/
│   │       │   │   ├── create-user.handler.ts
│   │       │   │   ├── delete-user.handler.ts
│   │       │   │   ├── index.ts
│   │       │   │   ├── update-user.handler.ts
│   │       │   │   └── welcome-user.handler.ts
│   │       │   └── impl/
│   │       │       ├── create-user.command.ts
│   │       │       ├── delete-user.command.ts
│   │       │       ├── update-user.command.ts
│   │       │       └── welcome-user.command.ts
│   │       ├── controllers/
│   │       │   ├── users.controller.spec.ts
│   │       │   └── users.controller.ts
│   │       ├── dtos/
│   │       │   └── users.dto.ts
│   │       ├── events/
│   │       │   ├── handlers/
│   │       │   │   ├── index.ts
│   │       │   │   ├── user-created.handler.ts
│   │       │   │   ├── user-deleted.handler.ts
│   │       │   │   ├── user-updated.handler.ts
│   │       │   │   └── user-welcomed.handler.ts
│   │       │   └── impl/
│   │       │       ├── user-created.event.ts
│   │       │       ├── user-deleted.event.ts
│   │       │       ├── user-updated.event.ts
│   │       │       └── user-welcomed.event.ts
│   │       ├── models/
│   │       │   └── user.model.ts
│   │       ├── repository/
│   │       │   └── user.repository.ts
│   │       ├── sagas/
│   │       │   └── users.sagas.ts
│   │       ├── services/
│   │       │   └── users.service.ts
│   │       └── users.module.ts
│   ├── test/
│   │   ├── app.e2e-spec.ts
│   │   └── jest-e2e.json
│   ├── tsconfig.json
│   ├── tsconfig.spec.json
│   └── tslint.json
├── nodejs-express-typescript/
│   ├── .editorconfig
│   ├── .eslintignore
│   ├── .eslintrc.js
│   ├── .gitignore
│   ├── .prettierrc.json
│   ├── LICENSE
│   ├── Procfile
│   ├── README.md
│   ├── jest.config.js
│   ├── nodemon.json
│   ├── package.json
│   ├── src/
│   │   ├── api/
│   │   │   ├── index.ts
│   │   │   ├── middlewares/
│   │   │   │   ├── index.ts
│   │   │   │   └── isAuth.ts
│   │   │   └── routes/
│   │   │       └── auth.ts
│   │   ├── app.ts
│   │   ├── config/
│   │   │   └── index.ts
│   │   ├── interfaces/
│   │   │   └── IUser.ts
│   │   ├── loaders/
│   │   │   ├── dependencyInjector.ts
│   │   │   ├── express.ts
│   │   │   ├── index.ts
│   │   │   ├── logger.ts
│   │   │   └── mongoose.ts
│   │   ├── models/
│   │   │   └── user.ts
│   │   ├── services/
│   │   │   └── auth.ts
│   │   └── types/
│   │       └── express/
│   │           └── index.d.ts
│   ├── tests/
│   │   ├── .gitkeep
│   │   ├── sample.test.ts
│   │   └── services/
│   │       └── .gitkeep
│   └── tsconfig.json
├── nodejs-microservice-using-docker-Part-1/
│   ├── .gitignore
│   ├── .travis.yml
│   ├── docker-compose.yml
│   ├── nginx/
│   │   ├── Dockerfile
│   │   └── nginx.conf
│   └── server/
│       ├── .babelrc
│       ├── .editorconfig
│       ├── .gitignore
│       ├── .jshintrc
│       ├── .jshintrc-spec
│       ├── Dockerfile
│       ├── Procfile
│       ├── api/
│       │   ├── service/
│       │   │   ├── index.js
│       │   │   ├── index.spec.js
│       │   │   ├── service.controller.js
│       │   │   ├── service.events.js
│       │   │   ├── service.integration.js
│       │   │   ├── service.model.js
│       │   │   └── service.socket.js
│       │   └── utils.js
│       ├── app.js
│       ├── config/
│       │   ├── app.conf.js
│       │   ├── db.conf.js
│       │   ├── routes.conf.js
│       │   └── socket.conf.js
│       ├── gulpfile.babel.js
│       ├── index.js
│       ├── mocha.conf.js
│       └── package.json
└── nodejs-microservice-using-docker-Part-2/
    ├── .gitignore
    ├── docker-compose.yml
    ├── nginx/
    │   ├── Dockerfile
    │   ├── Dockerfile_custom
    │   └── nginx.conf
    ├── node/
    │   ├── Dockerfile
    │   ├── index.js
    │   ├── package.json
    │   └── test/
    │       └── dummyTest.js
    └── redis/
        └── Dockerfile
Download .txt
SYMBOL INDEX (472 symbols across 125 files)

FILE: api-gateway-and-service-doscovery/api-gateway/config.js
  function Config (line 7) | function Config() {

FILE: api-gateway-and-service-doscovery/api-gateway/services-helper.js
  function ServiceHelper (line 5) | function ServiceHelper(services) {

FILE: api-gateway-and-service-doscovery/service-log/config.js
  function Config (line 7) | function Config() {

FILE: api-gateway-and-service-doscovery/service-login/config.js
  function Config (line 7) | function Config() {

FILE: api-gateway-and-service-doscovery/service-orders/config.js
  function Config (line 7) | function Config() {

FILE: api-gateway-and-service-doscovery/service-signup/config.js
  function Config (line 7) | function Config() {

FILE: dockerized-containers/e-Commerce-Admin/app/controller/UserController.ts
  class userController (line 13) | class userController {
    method getUserByEmail (line 15) | static getUserByEmail(email, cb) {
    method validateUser (line 24) | static validateUser(req, res, cb) {
    method registerDefault (line 43) | static registerDefault(req, res, cb) {
    method buildUser (line 64) | static buildUser(body, hash = null, location = null) {
    method registerSocial (line 82) | static registerSocial(user, callback) {
    method activateUserAccount (line 100) | static activateUserAccount(uuid, cb) {
    method resetPassword (line 116) | static resetPassword(email, callback) {
    method changeUserRole (line 137) | static changeUserRole(req, callback) {
    method updateUser (line 157) | static updateUser(email, data, callback) {

FILE: dockerized-containers/e-Commerce-Admin/app/global/templates/response/index.ts
  class ResponseTemplate (line 1) | class ResponseTemplate {
    method general (line 2) | static general(data) {
    method error (line 5) | static error(code, message, description) {
    method authError (line 12) | static authError() {
    method invalidAuthError (line 19) | static invalidAuthError() {
    method emptyContent (line 26) | static emptyContent() {
    method invalidContentType (line 34) | static invalidContentType() {
    method routeNotFound (line 42) | static routeNotFound() {
    method userNotFound (line 49) | static userNotFound() {
    method updateErrorOccoured (line 56) | static updateErrorOccoured(error) {
    method success (line 63) | static success(description, data=null) {

FILE: dockerized-containers/e-Commerce-Admin/app/helper/bcrypt.ts
  method generateSaltValue (line 9) | generateSaltValue(password) {
  method comparePassword (line 14) | comparePassword(userPassword, password ) {
  method authRedirectUrl (line 20) | authRedirectUrl( path ) {
  method buildUserToken (line 24) | buildUserToken(data) {
  method resource (line 34) | resource( path ) {
  method getFileExtension (line 37) | getFileExtension( file ) {
  method avatarURL (line 45) | avatarURL( filename ) {
  method userDocumentURL (line 51) | userDocumentURL( filename ) {
  method randomString (line 57) | randomString() {
  method deleteFile (line 60) | deleteFile( type, filename ) {
  method getPaymentMethodName (line 70) | getPaymentMethodName( method ) {
  method getCurrency (line 76) | getCurrency(currency) {
  method verificationCode (line 89) | verificationCode() {

FILE: dockerized-containers/e-Commerce-Admin/app/helper/email.ts
  method welcome (line 23) | welcome(user) {
  method password_reset (line 42) | password_reset(user, password) {

FILE: dockerized-containers/e-Commerce-Admin/app/helper/errorHandler.ts
  class errorHandler (line 6) | class errorHandler {
    method internalServerError (line 7) | public internalServerError(err, req, res, next) {
    method PageNotFound (line 24) | public PageNotFound(req, res, err) {

FILE: dockerized-containers/e-Commerce-Admin/app/helper/logger.ts
  method write (line 29) | write(message, encoding) {

FILE: dockerized-containers/e-Commerce-Admin/app/helper/responseTemplate.ts
  method general (line 3) | general(data) {
  method successMessage (line 6) | successMessage(message) {
  method success (line 12) | success(data, message) {
  method error (line 19) | error(message, err, code= null) {
  method emptyContent (line 26) | emptyContent() {
  method invalidContentType (line 33) | invalidContentType() {
  method BadRequestFromJoi (line 40) | BadRequestFromJoi(err) {
  method userAlreadyExist (line 46) | userAlreadyExist(err) {
  method userdoesNotExist (line 53) | userdoesNotExist(err) {
  method commonAuthUserDataError (line 60) | commonAuthUserDataError() {
  method tokenRequiredAuthError (line 66) | tokenRequiredAuthError() {

FILE: dockerized-containers/e-Commerce-Admin/app/helper/twillo.ts
  method phone_verification (line 9) | phone_verification(phone_number, code, callback) {
  method password_reset_notification (line 18) | password_reset_notification(phone) {
  method default_notification (line 28) | default_notification(phone, message) {

FILE: dockerized-containers/e-Commerce-Admin/app/lib/logger.ts
  method timestamp (line 11) | timestamp() {
  method write (line 35) | write(message, encoding) {

FILE: dockerized-containers/e-Commerce-Admin/app/middleware/authMiddleware.ts
  method validateToken (line 5) | validateToken(req, res, next) {

FILE: dockerized-containers/e-Commerce-Admin/app/middleware/requestValidator.ts
  method validatePayload (line 3) | validatePayload(req, res, next) {

FILE: dockerized-containers/e-Commerce-Admin/app/routes/defaultRoutes.ts
  class DefaultRouter (line 8) | class DefaultRouter {
    method constructor (line 14) | constructor() {
    method sayHello (line 24) | public sayHello(req, res) {
    method init (line 28) | init() {

FILE: dockerized-containers/e-Commerce-Admin/app/routes/provider/Google.ts
  method function (line 43) | function(req, res) {

FILE: dockerized-containers/e-Commerce-Admin/app/routes/provider/Locale.ts
  method authenticate (line 34) | authenticate() {

FILE: dockerized-containers/e-Commerce-Admin/app/routes/provider/Twitter.ts
  method function (line 38) | function(req, res) {

FILE: dockerized-containers/e-Commerce-Admin/app/routes/routes.ts
  class AuthRouter (line 20) | class AuthRouter {
    method constructor (line 26) | constructor() {
    method register (line 30) | public register(req: any, res: any) {
    method login (line 44) | public login(req: any, res: any) {
    method redirectSocialUser (line 58) | public redirectSocialUser(req, res) {
    method validate (line 74) | public validate(req: any, res: any) {
    method resetPassword (line 90) | public resetPassword(req, res) {
    method activateUserAccount (line 105) | public activateUserAccount(req, res) {
    method init (line 118) | init() {

FILE: dockerized-containers/e-Commerce-Admin/app/routes/userRoutes.ts
  class AuthRouter (line 42) | class AuthRouter {
    method constructor (line 48) | constructor() {
    method resetPassword (line 60) | public resetPassword(req, res){
    method updateUser (line 75) | public updateUser(req, res){
    method getUserByEmail (line 88) | public getUserByEmail(req, res){
    method uploadProfilepicture (line 102) | public uploadProfilepicture(req, res){
    method uploadDocuments (line 116) | public uploadDocuments(req, res){
    method init (line 146) | init() {

FILE: dockerized-containers/e-Commerce-Admin/app/types/global.d.ts
  type Global (line 2) | interface Global {

FILE: dockerized-containers/e-Commerce-Admin/app/types/vendor.d.ts
  type Global (line 3) | interface Global {

FILE: dockerized-containers/e-Commerce-Admin/express.ts
  class App (line 15) | class App {
    method constructor (line 19) | constructor() {
    method middleware (line 26) | private middleware(): void {
    method routes (line 65) | private routes(): void {

FILE: dockerized-containers/e-Commerce-Admin/server.ts
  function onError (line 20) | function onError(error: NodeJS.ErrnoException): void {
  function onListening (line 61) | function onListening(): void {

FILE: dockerized-containers/e-Commerce-Auth/app/controller/UserController.ts
  class userController (line 12) | class userController {
    method getUserByEmail (line 14) | static getUserByEmail(email, cb) {
    method validateUser (line 23) | static validateUser(req, res, cb) {
    method registerDefault (line 45) | static registerDefault(req, res, cb) {
    method buildUser (line 66) | static buildUser(body, hash = null, location = null) {
    method registerSocial (line 84) | static registerSocial(user, callback) {
    method activateUserAccount (line 102) | static activateUserAccount(uuid, cb) {
    method resetPassword (line 118) | static resetPassword(email, callback) {
    method changeUserRole (line 139) | static changeUserRole(req, callback) {
    method updateUser (line 158) | static updateUser(email, data, callback) {

FILE: dockerized-containers/e-Commerce-Auth/app/global/templates/response/index.ts
  class ResponseTemplate (line 1) | class ResponseTemplate {
    method general (line 2) | static general(data) {
    method error (line 5) | static error(code, message, description) {
    method authError (line 12) | static authError() {
    method invalidAuthError (line 19) | static invalidAuthError() {
    method emptyContent (line 26) | static emptyContent() {
    method invalidContentType (line 34) | static invalidContentType() {
    method routeNotFound (line 42) | static routeNotFound() {
    method userNotFound (line 49) | static userNotFound() {
    method updateErrorOccoured (line 56) | static updateErrorOccoured(error) {
    method success (line 63) | static success(description, data=null) {

FILE: dockerized-containers/e-Commerce-Auth/app/helper/bcrypt.ts
  method generateSaltValue (line 9) | generateSaltValue(password) {
  method comparePassword (line 14) | comparePassword(userPassword, password ) {
  method authRedirectUrl (line 20) | authRedirectUrl( path ) {
  method buildUserToken (line 24) | buildUserToken(data) {
  method resource (line 34) | resource( path ) {
  method getFileExtension (line 37) | getFileExtension( file ) {
  method avatarURL (line 45) | avatarURL( filename ) {
  method userDocumentURL (line 51) | userDocumentURL( filename ) {
  method randomString (line 57) | randomString() {
  method deleteFile (line 60) | deleteFile( type, filename ) {
  method getPaymentMethodName (line 70) | getPaymentMethodName( method ) {
  method getCurrency (line 76) | getCurrency(currency) {
  method verificationCode (line 89) | verificationCode() {

FILE: dockerized-containers/e-Commerce-Auth/app/helper/email.ts
  method welcome (line 23) | welcome(user) {
  method password_reset (line 42) | password_reset(user, password) {

FILE: dockerized-containers/e-Commerce-Auth/app/helper/errorHandler.ts
  class errorHandler (line 6) | class errorHandler {
    method internalServerError (line 7) | public internalServerError(err, req, res, next) {
    method PageNotFound (line 24) | public PageNotFound(req, res, err) {

FILE: dockerized-containers/e-Commerce-Auth/app/helper/logger.ts
  method write (line 29) | write(message, encoding) {

FILE: dockerized-containers/e-Commerce-Auth/app/helper/responseTemplate.ts
  method general (line 3) | general(data) {
  method successMessage (line 6) | successMessage(message) {
  method success (line 12) | success(data, message) {
  method error (line 19) | error(message, err, code= null) {
  method emptyContent (line 26) | emptyContent() {
  method invalidContentType (line 33) | invalidContentType() {
  method BadRequestFromJoi (line 40) | BadRequestFromJoi(err) {
  method userAlreadyExist (line 46) | userAlreadyExist(err) {
  method userdoesNotExist (line 53) | userdoesNotExist(err) {
  method commonAuthUserDataError (line 60) | commonAuthUserDataError() {
  method tokenRequiredAuthError (line 66) | tokenRequiredAuthError() {

FILE: dockerized-containers/e-Commerce-Auth/app/helper/twillo.ts
  method phone_verification (line 9) | phone_verification(phone_number, code, callback) {
  method password_reset_notification (line 18) | password_reset_notification(phone) {
  method default_notification (line 28) | default_notification(phone, message) {

FILE: dockerized-containers/e-Commerce-Auth/app/lib/logger.ts
  method timestamp (line 11) | timestamp() {
  method write (line 35) | write(message, encoding) {

FILE: dockerized-containers/e-Commerce-Auth/app/middleware/authMiddleware.ts
  method validateToken (line 5) | validateToken(req, res, next) {

FILE: dockerized-containers/e-Commerce-Auth/app/middleware/requestValidator.ts
  method validatePayload (line 3) | validatePayload(req, res, next) {

FILE: dockerized-containers/e-Commerce-Auth/app/routes/defaultRoutes.ts
  class DefaultRouter (line 8) | class DefaultRouter {
    method constructor (line 14) | constructor() {
    method sayHello (line 24) | public sayHello(req, res) {
    method init (line 28) | init() {

FILE: dockerized-containers/e-Commerce-Auth/app/routes/provider/Google.ts
  method function (line 43) | function(req, res) {

FILE: dockerized-containers/e-Commerce-Auth/app/routes/provider/Locale.ts
  method authenticate (line 34) | authenticate() {

FILE: dockerized-containers/e-Commerce-Auth/app/routes/provider/Twitter.ts
  method function (line 38) | function(req, res) {

FILE: dockerized-containers/e-Commerce-Auth/app/routes/routes.ts
  class AuthRouter (line 20) | class AuthRouter {
    method constructor (line 26) | constructor() {
    method register (line 30) | public register(req: any, res: any) {
    method login (line 44) | public login(req: any, res: any) {
    method redirectSocialUser (line 58) | public redirectSocialUser(req, res) {
    method validate (line 74) | public validate(req: any, res: any) {
    method resetPassword (line 90) | public resetPassword(req, res) {
    method activateUserAccount (line 105) | public activateUserAccount(req, res) {
    method init (line 118) | init() {

FILE: dockerized-containers/e-Commerce-Auth/app/routes/userRoutes.ts
  class AuthRouter (line 42) | class AuthRouter {
    method constructor (line 48) | constructor() {
    method resetPassword (line 60) | public resetPassword(req, res){
    method updateUser (line 75) | public updateUser(req, res){
    method getUserByEmail (line 88) | public getUserByEmail(req, res){
    method uploadProfilepicture (line 102) | public uploadProfilepicture(req, res){
    method uploadDocuments (line 116) | public uploadDocuments(req, res){
    method init (line 146) | init() {

FILE: dockerized-containers/e-Commerce-Auth/app/types/global.d.ts
  type Global (line 2) | interface Global {

FILE: dockerized-containers/e-Commerce-Auth/app/types/vendor.d.ts
  type Global (line 3) | interface Global {

FILE: dockerized-containers/e-Commerce-Auth/express.ts
  class App (line 14) | class App {
    method constructor (line 18) | constructor() {
    method middleware (line 25) | private middleware(): void {
    method routes (line 64) | private routes(): void {

FILE: dockerized-containers/e-Commerce-Auth/server.ts
  function onError (line 19) | function onError(error: NodeJS.ErrnoException): void {
  function onListening (line 60) | function onListening(): void {

FILE: dockerized-containers/e-Commerce-Cart/app/helper/errorHandler.ts
  class errorHandler (line 6) | class errorHandler {
    method internalServerError (line 7) | public internalServerError(err, req, res, next) {
    method PageNotFound (line 24) | public PageNotFound(req, res, err) {

FILE: dockerized-containers/e-Commerce-Cart/app/helper/errors.ts
  class APIError (line 1) | class APIError extends Error {
    method constructor (line 2) | constructor(message, ErrorID, code = null) {

FILE: dockerized-containers/e-Commerce-Cart/app/helper/responseTemplate.ts
  method general (line 3) | general(data) {
  method successMessage (line 6) | successMessage(message) {
  method success (line 12) | success(data, message) {
  method error (line 19) | error(message, err, code= null) {
  method emptyContent (line 26) | emptyContent() {
  method invalidContentType (line 33) | invalidContentType() {
  method BadRequestFromJoi (line 40) | BadRequestFromJoi(err) {
  method userAlreadyExist (line 46) | userAlreadyExist(err) {
  method userdoesNotExist (line 53) | userdoesNotExist(err) {
  method commonAuthUserDataError (line 60) | commonAuthUserDataError() {
  method tokenRequiredAuthError (line 66) | tokenRequiredAuthError() {

FILE: dockerized-containers/e-Commerce-Cart/app/middleware/requestValidator.ts
  method validatePayload (line 3) | validatePayload(req, res, next) {

FILE: dockerized-containers/e-Commerce-Cart/app/routes/defaultRoutes.ts
  class DefaultRouter (line 8) | class DefaultRouter {
    method constructor (line 14) | constructor() {
    method sayHello (line 24) | public sayHello(req, res) {
    method getProducts (line 27) | public getProducts(req, res) {
    method init (line 31) | init() {

FILE: dockerized-containers/e-Commerce-Cart/app/types/global.d.ts
  type Global (line 2) | interface Global {

FILE: dockerized-containers/e-Commerce-Cart/app/types/vendor.d.ts
  type Global (line 3) | interface Global {

FILE: dockerized-containers/e-Commerce-Cart/express.ts
  class App (line 15) | class App {
    method constructor (line 19) | constructor() {
    method middleware (line 26) | private middleware(): void {
    method routes (line 65) | private routes(): void {

FILE: dockerized-containers/e-Commerce-Cart/mysql/schema.sql
  type `carts` (line 8) | CREATE TABLE `carts` (
  type `categories` (line 25) | CREATE TABLE `categories` (
  type `customers` (line 39) | CREATE TABLE `customers` (
  type `lines_item` (line 56) | CREATE TABLE `lines_item` (
  type `orders` (line 80) | CREATE TABLE `orders` (
  type `products` (line 99) | CREATE TABLE `products` (

FILE: dockerized-containers/e-Commerce-Cart/server.ts
  function onError (line 35) | function onError(error: NodeJS.ErrnoException): void {
  function onListening (line 76) | function onListening(): void {

FILE: dockerized-containers/e-Commerce-Client/src/api/index.js
  function url (line 4) | function url(resource) {
  function setAuthToken (line 11) | function setAuthToken(token) {
  function setGeoLocation (line 18) | function setGeoLocation(location) {
  function getAuthToken (line 25) | function getAuthToken() {

FILE: dockerized-containers/e-Commerce-Client/src/components/App/index.js
  class App (line 7) | class App extends Component {
    method render (line 8) | render() {

FILE: dockerized-containers/e-Commerce-Client/src/components/Checkbox/index.js
  class Checkbox (line 4) | class Checkbox extends Component {
    method render (line 24) | render() {

FILE: dockerized-containers/e-Commerce-Client/src/components/FloatCart/CartProduct/index.js
  class CartProduct (line 7) | class CartProduct extends Component {
    method render (line 25) | render() {

FILE: dockerized-containers/e-Commerce-Client/src/components/FloatCart/index.js
  class FloatCart (line 12) | class FloatCart extends Component {
    method componentWillReceiveProps (line 26) | componentWillReceiveProps(nextProps) {
    method render (line 93) | render() {

FILE: dockerized-containers/e-Commerce-Client/src/components/Selectbox/index.js
  class Selectbox (line 4) | class Selectbox extends Component {
    method render (line 26) | render() {

FILE: dockerized-containers/e-Commerce-Client/src/components/Shelf/Filter/index.js
  class Filter (line 12) | class Filter extends Component {
    method componentDidMount (line 18) | componentDidMount() {
    method render (line 43) | render() {

FILE: dockerized-containers/e-Commerce-Client/src/components/Shelf/Sort/index.js
  class Sort (line 14) | class Sort extends Component {
    method render (line 24) | render() {

FILE: dockerized-containers/e-Commerce-Client/src/components/Shelf/index.js
  class Shelf (line 13) | class Shelf extends Component {
    method componentDidMount (line 25) | componentDidMount() {
    method componentWillReceiveProps (line 29) | componentWillReceiveProps(nextProps) {
    method render (line 51) | render() {

FILE: dockerized-containers/e-Commerce-Client/src/layout/Public.js
  class PublicPage (line 20) | class PublicPage extends Component {
    method constructor (line 22) | constructor(props) {
    method render (line 46) | render() {

FILE: dockerized-containers/e-Commerce-Client/src/services/auth/action.js
  function stopLoading (line 38) | function stopLoading() {
  function initiateLoading (line 43) | function initiateLoading() {
  function reduxResetState (line 48) | function reduxResetState() {
  function fetchProfileSuccess (line 53) | function fetchProfileSuccess(data) {
  function fetchProfile (line 61) | function fetchProfile() {
  function authUpdateRegisterFormField (line 79) | function authUpdateRegisterFormField(data) {
  function authSubmitRegisterForm (line 82) | function authSubmitRegisterForm(data) {
  function authInvalidateRegisterForm (line 85) | function authInvalidateRegisterForm(data) {
  function authResetRegisterFormFields (line 88) | function authResetRegisterFormFields() {
  function authServerRegisterUser (line 92) | function authServerRegisterUser(data) {
  function authUpdateLoginFormField (line 121) | function authUpdateLoginFormField(data) {
  function authSubmitLoginForm (line 124) | function authSubmitLoginForm(status) {
  function authInvalidateLoginForm (line 127) | function authInvalidateLoginForm(data) {
  function authResetLoginFormFields (line 131) | function authResetLoginFormFields() {
  function authUpdateUserData (line 135) | function authUpdateUserData(data) {
  function authUpdateUserField (line 139) | function authUpdateUserField(data) {
  function authResetUserData (line 143) | function authResetUserData() {
  function authServerLoginUser (line 147) | function authServerLoginUser(data) {
  function authSubmitResetPasswordForm (line 193) | function authSubmitResetPasswordForm(status) {
  function authUpdateResetPasswordStatusField (line 196) | function authUpdateResetPasswordStatusField(data) {
  function authInvalidateResetPasswordForm (line 200) | function authInvalidateResetPasswordForm(data) {
  function authServerResetPassword (line 204) | function authServerResetPassword(data) {
  function userProfileLoaded (line 238) | function userProfileLoaded(data) {
  function userUpdateProfile (line 242) | function userUpdateProfile(data) {
  function userUpdateProfileField (line 246) | function userUpdateProfileField(data) {
  function userDeleteProfileField (line 250) | function userDeleteProfileField(data) {
  function updateField (line 254) | function updateField( data ) {
  function updateSection (line 260) | function updateSection( data ) {
  function updateTabs (line 267) | function updateTabs( data ) {
  function updateLoaded (line 274) | function updateLoaded( data ) {

FILE: dockerized-containers/e-Commerce-Client/src/services/auth/actionTypes.js
  constant HELLO_WORLD (line 1) | const HELLO_WORLD = 'HELLO_WORLD';
  constant REDUX_RESET_STATE (line 2) | const REDUX_RESET_STATE = 'REDUX_RESET_STATE';
  constant ADMIN_GET_ALL_MENU (line 5) | const ADMIN_GET_ALL_MENU = 'GET_ALL_MENU';
  constant ADMIN_GET_ALL_MENU_SUCCESS (line 6) | const ADMIN_GET_ALL_MENU_SUCCESS = 'GET_ALL_MENU_SUCCESS';
  constant ADMIN_UPDATE_NAVPATH (line 7) | const ADMIN_UPDATE_NAVPATH = 'UPDATE_NAVPATH';
  constant ADMIN_FETCH_PROFILE_PENDING (line 9) | const ADMIN_FETCH_PROFILE_PENDING = 'FETCH_PROFILE_PENDING';
  constant ADMIN_FETCH_PROFILE_SUCCESS (line 10) | const ADMIN_FETCH_PROFILE_SUCCESS = 'FETCH_PROFILE_SUCCESS';
  constant ADMIN_LOGIN_PENDING (line 11) | const ADMIN_LOGIN_PENDING = 'LOGIN_PENDING';
  constant ADMIN_LOGIN_SUCCESS (line 12) | const ADMIN_LOGIN_SUCCESS = 'LOGIN_SUCCESS';
  constant ADMIN_LOGIN_ERROR (line 13) | const ADMIN_LOGIN_ERROR = 'LOGIN_ERROR';
  constant LOGOUT_SUCCESS (line 15) | const LOGOUT_SUCCESS = 'LOGOUT_SUCCESS';
  constant AUTH_UPDATE_REGISTER_FORM_FIELD (line 18) | const AUTH_UPDATE_REGISTER_FORM_FIELD = 'AUTH_UPDATE_REGISTER_FORM_FIELD';
  constant AUTH_SUBMIT_REGISTER_FORM (line 19) | const AUTH_SUBMIT_REGISTER_FORM = 'AUTH_SUBMIT_REGISTER_FORM';
  constant AUTH_INVALIDATE_REGISTER_FORM (line 20) | const AUTH_INVALIDATE_REGISTER_FORM = 'AUTH_INVALIDATE_REGISTER_FORM';
  constant AUTH_RESET_REGISTER_FORM_FIELDS (line 21) | const AUTH_RESET_REGISTER_FORM_FIELDS = 'AUTH_RESET_REGISTER_FORM_FIELDS';
  constant AUTH_UPDATE_USER_DATA (line 23) | const AUTH_UPDATE_USER_DATA = 'AUTH_UPDATE_USER_DATA';
  constant AUTH_RESET_USER_DATA (line 24) | const AUTH_RESET_USER_DATA = 'AUTH_RESET_USER_DATA';
  constant AUTH_UPDATE_USER_FIELD (line 25) | const AUTH_UPDATE_USER_FIELD = 'AUTH_UPDATE_USER_FIELD';
  constant AUTH_UPDATE_LOGIN_FORM_FIELD (line 27) | const AUTH_UPDATE_LOGIN_FORM_FIELD = 'AUTH_UPDATE_LOGIN_FORM_FIELD';
  constant AUTH_SUBMIT_LOGIN_FORM (line 28) | const AUTH_SUBMIT_LOGIN_FORM = 'AUTH_SUBMIT_LOGIN_FORM';
  constant AUTH_INVALIDATE_LOGIN_FORM (line 29) | const AUTH_INVALIDATE_LOGIN_FORM = 'AUTH_INVALIDATE_LOGIN_FORM';
  constant AUTH_RESET_LOGIN_FORM_FIELDS (line 30) | const AUTH_RESET_LOGIN_FORM_FIELDS = 'AUTH_RESET_LOGIN_FORM_FIELDS';
  constant AUTH_SUBMIT_RESET_PASSWORD_FORM (line 32) | const AUTH_SUBMIT_RESET_PASSWORD_FORM = 'AUTH_SUBMIT_RESET_PASSWORD_FORM';
  constant AUTH_UPDATE_RESET_PASSWORD_STATUS_FIELD (line 33) | const AUTH_UPDATE_RESET_PASSWORD_STATUS_FIELD = 'AUTH_UPDATE_RESET_PASSW...
  constant AUTH_INVALIDATE_RESET_PASSWORD_FORM (line 34) | const AUTH_INVALIDATE_RESET_PASSWORD_FORM = 'AUTH_INVALIDATE_RESET_PASSW...
  constant USER_PROFILE_LOADED (line 36) | const USER_PROFILE_LOADED = 'USER_PROFILE_LOADED';
  constant USER_UPDATE_PROFILE (line 37) | const USER_UPDATE_PROFILE = 'USER_UPDATE_PROFILE';
  constant USER_UPDATE_PROFILE_FIELD (line 38) | const USER_UPDATE_PROFILE_FIELD = 'USER_UPDATE_PROFILE_FIELD';
  constant USER_DELETE_PROFILE_FIELD (line 39) | const USER_DELETE_PROFILE_FIELD = 'USER_DELETE_PROFILE_FIELD';
  constant UI_MODALS_UPDATE_FIELD (line 42) | const UI_MODALS_UPDATE_FIELD = 'UI_MODALS_UPDATE_FIELD';
  constant UI_PROCESSING_UPDATE_FIELD (line 43) | const UI_PROCESSING_UPDATE_FIELD = 'UI_PROCESSING_UPDATE_FIELD';
  constant UI_LOADED_UPDATE_FIELD (line 44) | const UI_LOADED_UPDATE_FIELD = 'UI_LOADED_UPDATE_FIELD';
  constant APP_CONFIG_TOGGLE_ASIDE (line 47) | const APP_CONFIG_TOGGLE_ASIDE = 'APP_CONFIG_TOGGLE_ASIDE';
  constant INITIATE_LOADING (line 48) | const INITIATE_LOADING = 'INITIATE_LOADING';
  constant STOP_LOADING (line 49) | const STOP_LOADING = 'STOP_LOADING';
  constant COMMON_LOAD_VEHICLES (line 51) | const COMMON_LOAD_VEHICLES = 'COMMON_LOAD_VEHICLES'
  constant COMMON_LOAD_REVIEWS (line 52) | const COMMON_LOAD_REVIEWS = 'COMMON_LOAD_REVIEWS'
  constant COMMON_LOAD_VENDORS (line 53) | const COMMON_LOAD_VENDORS = 'COMMON_LOAD_VENDORS'
  constant COMMON_SET_GEO (line 54) | const COMMON_SET_GEO= 'COMMON_SET_GEO'
  constant COMMON_SET_GLOBAL_COUNT (line 55) | const COMMON_SET_GLOBAL_COUNT= 'COMMON_SET_GLOBAL_COUNT'
  constant UPDATE_FIELD (line 57) | const UPDATE_FIELD = 'UPDATE_FIELD';
  constant UPDATE_SECTION (line 58) | const UPDATE_SECTION = 'UPDATE_SECTION';
  constant UPDATE_TABS (line 59) | const UPDATE_TABS = 'UPDATE_TABS';
  constant UPDATE_LOADED (line 60) | const UPDATE_LOADED = 'UPDATE_LOADED';
  constant SET_MESSAGES (line 61) | const SET_MESSAGES = 'SET_MESSAGES';
  constant UPDATE_MESSAGES (line 62) | const UPDATE_MESSAGES = 'UPDATE_MESSAGES';
  constant SET_USER_LANGUAGE (line 63) | const SET_USER_LANGUAGE = 'SET_USER_LANGUAGE';

FILE: dockerized-containers/e-Commerce-Client/src/services/auth/reducer.js
  function auth (line 57) | function auth( auth = application_default_data, action ) {

FILE: dockerized-containers/e-Commerce-Client/src/services/cart/actionTypes.js
  constant LOAD_CART (line 1) | const LOAD_CART = 'LOAD_CART';
  constant ADD_PRODUCT (line 2) | const ADD_PRODUCT = 'ADD_PRODUCT';
  constant REMOVE_PRODUCT (line 3) | const REMOVE_PRODUCT = 'REMOVE_PRODUCT';
  constant UPDATE_CART (line 4) | const UPDATE_CART = 'UPDATE_CART';

FILE: dockerized-containers/e-Commerce-Client/src/services/filters/actionTypes.js
  constant UPDATE_FILTER (line 1) | const UPDATE_FILTER = 'UPDATE_FILTER';

FILE: dockerized-containers/e-Commerce-Client/src/services/shelf/actionTypes.js
  constant FETCH_PRODUCTS (line 1) | const FETCH_PRODUCTS = 'FETCH_PRODUCTS';

FILE: dockerized-containers/e-Commerce-Client/src/services/sort/actionTypes.js
  constant UPDATE_SORT (line 1) | const UPDATE_SORT = 'UPDATE_SORT';

FILE: dockerized-containers/e-Commerce-Client/src/services/total/actionTypes.js
  constant UPDATE_CART (line 1) | const UPDATE_CART = 'UPDATE_CART';

FILE: dockerized-containers/e-Commerce-Client/src/util/helper/index.js
  class Util (line 2) | class Util{
    method validateEmail (line 3) | static validateEmail(email){
    method getFileName (line 7) | static getFileName( url ) {
    method uid (line 10) | static uid() {

FILE: dockerized-containers/e-Commerce-Client/src/util/middleware/index.js
  function authenticatedUsersOnly (line 4) | function authenticatedUsersOnly( nextState, replace ) {
  function userTypeHostOnly (line 22) | function userTypeHostOnly( nextState, replace, store ) {
  function notLoggedIn (line 33) | function notLoggedIn( nextState, replace ) {
  function logoutUser (line 42) | function logoutUser( nextState, replace ) {

FILE: node js-with-serverless/models/table_schema.ts
  type eventData (line 1) | interface eventData {
  type schema (line 8) | interface schema extends eventData{
  type dbItem (line 12) | interface dbItem {

FILE: node-microservice-starter/users/src/app.controller.ts
  class AppController (line 5) | class AppController {
    method constructor (line 6) | constructor(private readonly appService: AppService) {}
    method getHello (line 9) | getHello(): string {

FILE: node-microservice-starter/users/src/app.module.ts
  class AppModule (line 10) | class AppModule {}

FILE: node-microservice-starter/users/src/app.service.ts
  class AppService (line 4) | class AppService {
    method getHello (line 5) | getHello(): string {

FILE: node-microservice-starter/users/src/main.ts
  function bootstrap (line 4) | async function bootstrap() {

FILE: nodejs-cqrs-pattern/src/app.module.ts
  class AppModule (line 12) | class AppModule implements OnModuleInit {
    method onModuleInit (line 13) | async onModuleInit() {}

FILE: nodejs-cqrs-pattern/src/core/event-store/event-store.class.ts
  class EventStore (line 7) | class EventStore {
    method constructor (line 13) | constructor() {
    method connect (line 18) | connect(config) {
    method getClient (line 23) | getClient() {
    method newEvent (line 27) | newEvent(name, payload) {
    method close (line 31) | close() {

FILE: nodejs-cqrs-pattern/src/core/event-store/event-store.interface.ts
  type EventStoreMessage (line 1) | interface EventStoreMessage {

FILE: nodejs-cqrs-pattern/src/core/event-store/event-store.module.ts
  class EventStoreModule (line 22) | class EventStoreModule {
    method forRoot (line 23) | static forRoot(): DynamicModule {
    method forFeature (line 29) | static forFeature(): DynamicModule {

FILE: nodejs-cqrs-pattern/src/core/event-store/event-store.ts
  class EventStore (line 20) | class EventStore implements IEventPublisher, IMessageSource {
    method constructor (line 25) | constructor(@Inject('EVENT_STORE_PROVIDER') eventStore: any) {
    method publish (line 36) | async publish<T extends IEvent>(event: T) {
    method bridgeEventsTo (line 52) | async bridgeEventsTo<T extends IEvent>(subject: Subject<T>) {
    method setEventHandlers (line 89) | setEventHandlers(eventHandlers) {

FILE: nodejs-cqrs-pattern/src/main.ts
  function bootstrap (line 8) | async function bootstrap() {

FILE: nodejs-cqrs-pattern/src/users/commands/handlers/create-user.handler.ts
  class CreateUserHandler (line 7) | class CreateUserHandler
    method constructor (line 9) | constructor(
    method execute (line 14) | async execute(command: CreateUserCommand, resolve: (value?) => void) {

FILE: nodejs-cqrs-pattern/src/users/commands/handlers/delete-user.handler.ts
  class DeleteUserHandler (line 7) | class DeleteUserHandler
    method constructor (line 9) | constructor(
    method execute (line 14) | async execute(command: DeleteUserCommand, resolve: (value?) => void) {

FILE: nodejs-cqrs-pattern/src/users/commands/handlers/update-user.handler.ts
  class UpdateUserHandler (line 7) | class UpdateUserHandler
    method constructor (line 9) | constructor(
    method execute (line 14) | async execute(command: UpdateUserCommand, resolve: (value?) => void) {

FILE: nodejs-cqrs-pattern/src/users/commands/handlers/welcome-user.handler.ts
  class WelcomeUserHandler (line 7) | class WelcomeUserHandler
    method constructor (line 9) | constructor(
    method execute (line 14) | async execute(command: WelcomeUserCommand, resolve: (value?) => void) {

FILE: nodejs-cqrs-pattern/src/users/commands/impl/create-user.command.ts
  class CreateUserCommand (line 4) | class CreateUserCommand implements ICommand {
    method constructor (line 5) | constructor(

FILE: nodejs-cqrs-pattern/src/users/commands/impl/delete-user.command.ts
  class DeleteUserCommand (line 4) | class DeleteUserCommand implements ICommand {
    method constructor (line 5) | constructor(

FILE: nodejs-cqrs-pattern/src/users/commands/impl/update-user.command.ts
  class UpdateUserCommand (line 4) | class UpdateUserCommand implements ICommand {
    method constructor (line 5) | constructor(

FILE: nodejs-cqrs-pattern/src/users/commands/impl/welcome-user.command.ts
  class WelcomeUserCommand (line 3) | class WelcomeUserCommand implements ICommand {
    method constructor (line 4) | constructor(

FILE: nodejs-cqrs-pattern/src/users/controllers/users.controller.ts
  class UsersController (line 9) | class UsersController {
    method constructor (line 10) | constructor(private readonly usersService: UsersService) { }
    method createUser (line 17) | async createUser(@Body() userDto: UserDto): Promise<UserDto> {
    method updateUser (line 27) | async updateUser(@Param() userId: UserIdRequestParamsDto, @Body() user...
    method deleteUser (line 36) | async deleteUser(@Param() userId: UserIdRequestParamsDto) {
    method findUsers (line 45) | async findUsers(@Param() param) {
    method findOneUser (line 54) | async findOneUser(@Param() userId: UserIdRequestParamsDto) {

FILE: nodejs-cqrs-pattern/src/users/dtos/users.dto.ts
  class UserIdRequestParamsDto (line 3) | class UserIdRequestParamsDto {
  class UserDto (line 8) | class UserDto {

FILE: nodejs-cqrs-pattern/src/users/events/handlers/user-created.handler.ts
  class UserCreatedHandler (line 7) | class UserCreatedHandler
    method handle (line 9) | handle(event: UserCreatedEvent) {

FILE: nodejs-cqrs-pattern/src/users/events/handlers/user-deleted.handler.ts
  class UserDeletedHandler (line 6) | class UserDeletedHandler
    method handle (line 8) | handle(event: UserDeletedEvent) {

FILE: nodejs-cqrs-pattern/src/users/events/handlers/user-updated.handler.ts
  class UserUpdatedHandler (line 6) | class UserUpdatedHandler
    method handle (line 8) | handle(event: UserUpdatedEvent) {

FILE: nodejs-cqrs-pattern/src/users/events/handlers/user-welcomed.handler.ts
  class UserWelcomedHandler (line 6) | class UserWelcomedHandler
    method handle (line 8) | handle(event: UserWelcomedEvent) {

FILE: nodejs-cqrs-pattern/src/users/events/impl/user-created.event.ts
  class UserCreatedEvent (line 4) | class UserCreatedEvent implements IEvent {
    method constructor (line 5) | constructor(

FILE: nodejs-cqrs-pattern/src/users/events/impl/user-deleted.event.ts
  class UserDeletedEvent (line 3) | class UserDeletedEvent implements IEvent {
    method constructor (line 4) | constructor(

FILE: nodejs-cqrs-pattern/src/users/events/impl/user-updated.event.ts
  class UserUpdatedEvent (line 4) | class UserUpdatedEvent implements IEvent {
    method constructor (line 5) | constructor(

FILE: nodejs-cqrs-pattern/src/users/events/impl/user-welcomed.event.ts
  class UserWelcomedEvent (line 3) | class UserWelcomedEvent implements IEvent {
    method constructor (line 4) | constructor(

FILE: nodejs-cqrs-pattern/src/users/models/user.model.ts
  class User (line 8) | class User extends AggregateRoot {
    method constructor (line 11) | constructor(private readonly id: string | undefined) {
    method setData (line 15) | setData(data) {
    method createUser (line 19) | createUser() {
    method updateUser (line 23) | updateUser() {
    method welcomeUser (line 27) | welcomeUser() {
    method deleteUser (line 31) | deleteUser() {

FILE: nodejs-cqrs-pattern/src/users/repository/user.repository.ts
  class UserRepository (line 5) | class UserRepository {
    method createUser (line 6) | async createUser(userDto) {
    method updateUser (line 13) | async updateUser(userDto) {
    method deleteUser (line 20) | async deleteUser(userDto) {
    method welcomeUser (line 26) | async welcomeUser(userDto) {

FILE: nodejs-cqrs-pattern/src/users/sagas/users.sagas.ts
  class UsersSagas (line 9) | class UsersSagas {

FILE: nodejs-cqrs-pattern/src/users/services/users.service.ts
  class UsersService (line 10) | class UsersService {
    method constructor (line 11) | constructor(private readonly commandBus: CommandBus) {}
    method createUser (line 13) | async createUser(user: UserDto) {
    method updateUser (line 19) | async updateUser(user: UserDto) {
    method deleteUser (line 25) | async deleteUser(user: UserIdRequestParamsDto) {
    method findUsers (line 31) | async findUsers() {

FILE: nodejs-cqrs-pattern/src/users/users.module.ts
  class UsersModule (line 31) | class UsersModule implements OnModuleInit {
    method constructor (line 32) | constructor(
    method onModuleInit (line 40) | onModuleInit() {

FILE: nodejs-express-typescript/src/app.ts
  function startServer (line 5) | async function startServer() {

FILE: nodejs-express-typescript/src/interfaces/IUser.ts
  type IUser (line 1) | interface IUser {
  type IUserInputDTO (line 9) | interface IUserInputDTO {

FILE: nodejs-express-typescript/src/services/auth.ts
  class AuthService (line 9) | class AuthService {
    method constructor (line 10) | constructor(
    method SignUp (line 15) | public async SignUp(userInputDTO: IUserInputDTO): Promise<{ user: IUse...
    method SignIn (line 49) | public async SignIn(email: string, password: string): Promise<{ user: ...
    method generateToken (line 76) | private generateToken(user) {

FILE: nodejs-express-typescript/src/types/express/index.d.ts
  type Request (line 5) | interface Request {
  type UserModel (line 11) | type UserModel = Model<IUser & Document>;

FILE: nodejs-microservice-using-docker-Part-1/server/api/service/service.controller.js
  function index (line 40) | function index(req, res) {
  function show (line 52) | function show(req, res) {
  function create (line 65) | function create(req, res) {
  function update (line 77) | function update(req, res) {
  function destroy (line 95) | function destroy(req, res) {

FILE: nodejs-microservice-using-docker-Part-1/server/api/service/service.events.js
  function emitEvent (line 47) | function emitEvent(event) {

FILE: nodejs-microservice-using-docker-Part-1/server/api/service/service.socket.js
  function register (line 20) | function register(socket) {
  function createListener (line 36) | function createListener(event, socket) {
  function removeListener (line 48) | function removeListener(event, listener) {

FILE: nodejs-microservice-using-docker-Part-1/server/api/utils.js
  function respondWithResult (line 9) | function respondWithResult(res, statusCode) {
  function saveUpdates (line 24) | function saveUpdates(updates) {
  function removeEntity (line 37) | function removeEntity(res) {
  function handleEntityNotFound (line 53) | function handleEntityNotFound(res) {
  function handleError (line 69) | function handleError(res, statusCode) {
  function validationError (line 80) | function validationError(res, statusCode) {

FILE: nodejs-microservice-using-docker-Part-1/server/config/app.conf.js
  class ApplicationConfig (line 7) | class ApplicationConfig {
    method init (line 8) | static init(app) {

FILE: nodejs-microservice-using-docker-Part-1/server/config/db.conf.js
  class DBConfig (line 6) | class DBConfig {
    method init (line 7) | static init() {

FILE: nodejs-microservice-using-docker-Part-1/server/config/routes.conf.js
  function initRoutes (line 3) | function initRoutes (app) {

FILE: nodejs-microservice-using-docker-Part-1/server/config/socket.conf.js
  function onDisconnect (line 6) | function onDisconnect(socket) {
  function onConnect (line 10) | function onConnect(socket) {
  function initSocket (line 19) | function initSocket (socketio) {

FILE: nodejs-microservice-using-docker-Part-1/server/gulpfile.babel.js
  function onServerLog (line 40) | function onServerLog(log) {
Condensed preview — 544 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (724K chars).
[
  {
    "path": "README.md",
    "chars": 355,
    "preview": "# nodejs-microservces-patterns\nnodejs-microservces-patterns\n\n- Simple Microservices Demo\n- Simple Auth and Autnz setup\n-"
  },
  {
    "path": "api-gateway-and-service-doscovery/.gitignore",
    "chars": 77,
    "preview": "node_modules\ndocs\n\nnode/node_modules\n.DS_Store\n\nnode/npm-debug.log\n.DS_Store\n"
  },
  {
    "path": "api-gateway-and-service-doscovery/README.md",
    "chars": 6837,
    "preview": "\n#What is this?\n\nThis porject/turotial explains how to implement a NodeJs Api Gateway, into a Microservices Architecture"
  },
  {
    "path": "api-gateway-and-service-doscovery/ServicesSetup.sh",
    "chars": 195,
    "preview": "cd service-login\nsudo npm install\n\ncd ..\ncd service-orders\nsudo npm install\n\ncd ..\ncd service-signup\nsudo npm install\n\nc"
  },
  {
    "path": "api-gateway-and-service-doscovery/ServicesStart.sh",
    "chars": 233,
    "preview": "cd service-login\nDEBUG=http node server &\n\ncd ..\ncd service-orders\nDEBUG=http node server &\n\ncd ..\ncd service-signup\nDEB"
  },
  {
    "path": "api-gateway-and-service-doscovery/api-gateway/Dockerbuild.sh",
    "chars": 171,
    "preview": "docker build -t micro-node-service-api-gateway:latest .\nwinpty docker run -it --rm -p 8080:8080 --name micro-node-servic"
  },
  {
    "path": "api-gateway-and-service-doscovery/api-gateway/Dockerfile",
    "chars": 35,
    "preview": "FROM node:6.2.0-onbuild\nEXPOSE 8080"
  },
  {
    "path": "api-gateway-and-service-doscovery/api-gateway/api/account/login.js",
    "chars": 341,
    "preview": "/**\n * Created by domenicovacchiano on 10/07/16.\n */\n\nvar express = require('express'),\n    router = express.Router(),\n "
  },
  {
    "path": "api-gateway-and-service-doscovery/api-gateway/api/account/signup.js",
    "chars": 343,
    "preview": "/**\n * Created by domenicovacchiano on 10/07/16.\n */\n\nvar express = require('express'),\n    router = express.Router(),\n "
  },
  {
    "path": "api-gateway-and-service-doscovery/api-gateway/api/crm/orders/orders.js",
    "chars": 346,
    "preview": "/**\n * Created by domenicovacchiano on 10/07/16.\n */\n\nvar express = require('express'),\n    router = express.Router(),\n "
  },
  {
    "path": "api-gateway-and-service-doscovery/api-gateway/api-gateway.js",
    "chars": 1678,
    "preview": "/**\n * Created by domenicovacchiano on 10/07/16.\n */\n\nvar debug = require('debug')('http'),\n    config= require ('./conf"
  },
  {
    "path": "api-gateway-and-service-doscovery/api-gateway/config.js",
    "chars": 874,
    "preview": "/**\n * Created by domenicovacchiano on 25/05/16.\n */\n\nvar fs = require('fs');\n\nfunction Config() {\n    var config = JSON"
  },
  {
    "path": "api-gateway-and-service-doscovery/api-gateway/config.json",
    "chars": 1113,
    "preview": "{\n  \"server\":{\n    \"id\":\"MicroNodeApiGateway\",\n    \"port\":8080,\n    \"isCluster\":true,\n    \"https\":{\n      \"isEnabled\":fa"
  },
  {
    "path": "api-gateway-and-service-doscovery/api-gateway/package.json",
    "chars": 810,
    "preview": "{\n  \"name\": \"DoorApiGateway\",\n  \"version\": \"0.0.1\",\n  \"description\": \"Api Gateway\",\n  \"author\": {\n    \"name\": \"Domenico "
  },
  {
    "path": "api-gateway-and-service-doscovery/api-gateway/server.js",
    "chars": 2839,
    "preview": "/**\n * Created by domenicovacchiano on 10/07/16.\n */\n\nvar config= require ('./config')(),\n    express=require('express')"
  },
  {
    "path": "api-gateway-and-service-doscovery/api-gateway/services-helper.js",
    "chars": 846,
    "preview": "/**\n * Created by domenicovacchiano on 11/07/16.\n */\n\nfunction ServiceHelper(services) {\n    return{\n        getServiceW"
  },
  {
    "path": "api-gateway-and-service-doscovery/service-log/Dockerbuild.sh",
    "chars": 147,
    "preview": "docker build -t micro-node-service-log:latest .\nwinpty docker run -it --rm -p 8084:8084 --name micro-node-service-log mi"
  },
  {
    "path": "api-gateway-and-service-doscovery/service-log/Dockerfile",
    "chars": 35,
    "preview": "FROM node:6.2.0-onbuild\nEXPOSE 8084"
  },
  {
    "path": "api-gateway-and-service-doscovery/service-log/config.js",
    "chars": 849,
    "preview": "/**\n * Created by domenicovacchiano on 07/07/16.\n */\n\nvar fs = require('fs');\n\nfunction Config() {\n    var config = JSON"
  },
  {
    "path": "api-gateway-and-service-doscovery/service-log/config.json",
    "chars": 800,
    "preview": "{\n  \"server\":{\n    \"id\":\"ServiceLog\",\n    \"port\":8084,\n    \"isCluster\":true,\n    \"https\":{\n      \"isEnabled\":false,\n    "
  },
  {
    "path": "api-gateway-and-service-doscovery/service-log/log.js",
    "chars": 345,
    "preview": "/**\n * Created by domenicovacchiano on 07/07/16.\n */\n\nvar express = require('express'),\n    router = express.Router(),\n "
  },
  {
    "path": "api-gateway-and-service-doscovery/service-log/package.json",
    "chars": 843,
    "preview": "{\n  \"name\": \"MicroNodeService\",\n  \"version\": \"0.0.1\",\n  \"description\": \"Micro Node Tutorial\",\n  \"author\": {\n    \"name\": "
  },
  {
    "path": "api-gateway-and-service-doscovery/service-log/server.js",
    "chars": 4932,
    "preview": "/**\n * Created by domenicovacchiano on 07/07/16.\n */\n\nvar config= require ('./config')(),\n    address = require('network"
  },
  {
    "path": "api-gateway-and-service-doscovery/service-login/Dockerbuild.sh",
    "chars": 153,
    "preview": "docker build -t micro-node-service-login:latest .\nwinpty docker run -it --rm -p 8081:8081 --name micro-node-service-logi"
  },
  {
    "path": "api-gateway-and-service-doscovery/service-login/Dockerfile",
    "chars": 35,
    "preview": "FROM node:6.2.0-onbuild\nEXPOSE 8081"
  },
  {
    "path": "api-gateway-and-service-doscovery/service-login/config.js",
    "chars": 849,
    "preview": "/**\n * Created by domenicovacchiano on 07/07/16.\n */\n\nvar fs = require('fs');\n\nfunction Config() {\n    var config = JSON"
  },
  {
    "path": "api-gateway-and-service-doscovery/service-login/config.json",
    "chars": 809,
    "preview": "{\n  \"server\":{\n    \"id\":\"ServiceLogin\",\n    \"port\":8081,\n    \"isCluster\":true,\n    \"https\":{\n      \"isEnabled\":false,\n  "
  },
  {
    "path": "api-gateway-and-service-doscovery/service-login/login.js",
    "chars": 347,
    "preview": "/**\n * Created by domenicovacchiano on 07/07/16.\n */\n\nvar express = require('express'),\n    router = express.Router(),\n "
  },
  {
    "path": "api-gateway-and-service-doscovery/service-login/package.json",
    "chars": 843,
    "preview": "{\n  \"name\": \"MicroNodeService\",\n  \"version\": \"0.0.1\",\n  \"description\": \"Micro Node Tutorial\",\n  \"author\": {\n    \"name\": "
  },
  {
    "path": "api-gateway-and-service-doscovery/service-login/server.js",
    "chars": 4937,
    "preview": "/**\n * Created by domenicovacchiano on 07/07/16.\n */\n\nvar config= require ('./config')(),\n    address = require('network"
  },
  {
    "path": "api-gateway-and-service-doscovery/service-orders/Dockerbuild.sh",
    "chars": 156,
    "preview": "docker build -t micro-node-service-orders:latest .\nwinpty docker run -it --rm -p 8083:8083 --name micro-node-service-ord"
  },
  {
    "path": "api-gateway-and-service-doscovery/service-orders/Dockerfile",
    "chars": 35,
    "preview": "FROM node:6.2.0-onbuild\nEXPOSE 8083"
  },
  {
    "path": "api-gateway-and-service-doscovery/service-orders/config.js",
    "chars": 849,
    "preview": "/**\n * Created by domenicovacchiano on 07/07/16.\n */\n\nvar fs = require('fs');\n\nfunction Config() {\n    var config = JSON"
  },
  {
    "path": "api-gateway-and-service-doscovery/service-orders/config.json",
    "chars": 812,
    "preview": "{\n  \"server\":{\n    \"id\":\"ServiceOrders\",\n    \"port\":8083,\n    \"isCluster\":true,\n    \"https\":{\n      \"isEnabled\":false,\n "
  },
  {
    "path": "api-gateway-and-service-doscovery/service-orders/orders.js",
    "chars": 348,
    "preview": "/**\n * Created by domenicovacchiano on 07/07/16.\n */\n\nvar express = require('express'),\n    router = express.Router(),\n "
  },
  {
    "path": "api-gateway-and-service-doscovery/service-orders/package.json",
    "chars": 843,
    "preview": "{\n  \"name\": \"MicroNodeService\",\n  \"version\": \"0.0.1\",\n  \"description\": \"Micro Node Tutorial\",\n  \"author\": {\n    \"name\": "
  },
  {
    "path": "api-gateway-and-service-doscovery/service-orders/server.js",
    "chars": 4923,
    "preview": "/**\n * Created by domenicovacchiano on 07/07/16.\n */\n\nvar config= require ('./config')(),\n    address = require('network"
  },
  {
    "path": "api-gateway-and-service-doscovery/service-signup/Dockerbuild.sh",
    "chars": 156,
    "preview": "docker build -t micro-node-service-signup:latest .\nwinpty docker run -it --rm -p 8082:8082 --name micro-node-service-sig"
  },
  {
    "path": "api-gateway-and-service-doscovery/service-signup/Dockerfile",
    "chars": 35,
    "preview": "FROM node:6.2.0-onbuild\nEXPOSE 8082"
  },
  {
    "path": "api-gateway-and-service-doscovery/service-signup/config.js",
    "chars": 849,
    "preview": "/**\n * Created by domenicovacchiano on 07/07/16.\n */\n\nvar fs = require('fs');\n\nfunction Config() {\n    var config = JSON"
  },
  {
    "path": "api-gateway-and-service-doscovery/service-signup/config.json",
    "chars": 812,
    "preview": "{\n  \"server\":{\n    \"id\":\"ServiceSignup\",\n    \"port\":8082,\n    \"isCluster\":true,\n    \"https\":{\n      \"isEnabled\":false,\n "
  },
  {
    "path": "api-gateway-and-service-doscovery/service-signup/package.json",
    "chars": 843,
    "preview": "{\n  \"name\": \"MicroNodeService\",\n  \"version\": \"0.0.1\",\n  \"description\": \"Micro Node Tutorial\",\n  \"author\": {\n    \"name\": "
  },
  {
    "path": "api-gateway-and-service-doscovery/service-signup/server.js",
    "chars": 4929,
    "preview": "/**\n * Created by domenicovacchiano on 07/07/16.\n */\n\nvar config= require ('./config')(),\n    address = require('network"
  },
  {
    "path": "api-gateway-and-service-doscovery/service-signup/signup.js",
    "chars": 348,
    "preview": "/**\n * Created by domenicovacchiano on 07/07/16.\n */\n\nvar express = require('express'),\n    router = express.Router(),\n "
  },
  {
    "path": "dockerized-containers/.eslintrc.js",
    "chars": 142,
    "preview": "module.exports = {\n  \"extends\": \"airbnb-base\",\n  \"rules\": {\n      \"comma-dangle\": 0,\n      \"no-console\": 0,\n      \"no-un"
  },
  {
    "path": "dockerized-containers/.gitignore",
    "chars": 796,
    "preview": "# Created by .ignore support plugin (hsz.mobi)\n### Node template\n# Logs\nlogs\n*.log\nnpm-debug.log*\n/dist\n.vscode\n/test\n/*"
  },
  {
    "path": "dockerized-containers/.travis.yml",
    "chars": 91,
    "preview": "language: node_js\nsudo: false\nnode_js:\n  - 10\ninstall:\n  - npm install\nscript:\n  - npm test"
  },
  {
    "path": "dockerized-containers/README.md",
    "chars": 2161,
    "preview": "# Application for e-commerce Hub\n\n\nREST API to support application features\n  - Express as web framework with Typescript"
  },
  {
    "path": "dockerized-containers/docker-compose.yml",
    "chars": 2252,
    "preview": "version: '3.5'\nservices:\n  gateway:\n    image: nginx:1.11\n    ports:\n      - 80:80\n      - 443:443\n    volumes:\n      - "
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/Dockerfile",
    "chars": 258,
    "preview": "FROM node:carbon\n\n# Create app directory\nWORKDIR /usr/src/app\n\n# Bundle app source\nCOPY . .\n\n# npm install\nRUN  npm inst"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/README.md",
    "chars": 1451,
    "preview": "# Application for e-commerce Hub\n\n\nREST API to support application features\n\n  - Express as web framework with Typescrip"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/config/email.ts",
    "chars": 821,
    "preview": "'use strict';\n\nexport default {\n\n  global: {\n    from: 'info@kpilibrary.com',\n  },\n  welcome: {\n    subject: 'Welcome to"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/config/environments/dev.ts",
    "chars": 1336,
    "preview": "/* eslint quote-props: 0 */\nexport { }\nconst configuration: any = {};\nconfiguration.mongo = {\n  url:  process.env.MONGOD"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/config/environments/qa.ts",
    "chars": 1336,
    "preview": "/* eslint quote-props: 0 */\nexport { }\nconst configuration: any = {};\nconfiguration.mongo = {\n  url:  process.env.MONGOD"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/config/environments/test.ts",
    "chars": 1336,
    "preview": "/* eslint quote-props: 0 */\nexport { }\nconst configuration: any = {};\nconfiguration.mongo = {\n  url:  process.env.MONGOD"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/controller/UserController.ts",
    "chars": 5872,
    "preview": "export { };\nconst uuidv4 = require('uuid/v4');\nimport User from '../models/user';\ndeclare function require(name: string)"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/events/notification.ts",
    "chars": 691,
    "preview": "\nimport Email from '../helper/email';\ndeclare function require(name: string);\n\nconst events = require('events');\nconst w"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/global/templates/emails/password-reset-email/html.pug",
    "chars": 3682,
    "preview": "html(lang='en')\n  head\n    meta(charset='utf-8')\n    meta(name='viewport', content='width=device-width, initial-scale=1,"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/global/templates/emails/password-reset-email/style.css",
    "chars": 7267,
    "preview": "@charset \"UTF-8\";\n/* -------------------------------------\n          GLOBAL RESETS\n      -------------------------------"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/global/templates/emails/welcome-email/html.pug",
    "chars": 3884,
    "preview": "html(lang='en')\n  head\n    meta(charset='utf-8')\n    meta(name='viewport', content='width=device-width, initial-scale=1,"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/global/templates/emails/welcome-email/style.css",
    "chars": 7267,
    "preview": "@charset \"UTF-8\";\n/* -------------------------------------\n          GLOBAL RESETS\n      -------------------------------"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/global/templates/response/index.ts",
    "chars": 2093,
    "preview": "class ResponseTemplate {\n  static general(data) {\n    return data;\n  }\n  static error(code, message, description) {\n    "
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/helper/bcrypt.ts",
    "chars": 2504,
    "preview": "\nconst bcrypt = require('bcrypt-nodejs');\nconst jwt = require('jsonwebtoken');\nconst {url} = global['configuration']\ncon"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/helper/email.ts",
    "chars": 1981,
    "preview": "const path = require('path');\ndeclare function require(name:string);\n\nconst nodemailer = require('nodemailer');\nconst ur"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/helper/errorHandler.ts",
    "chars": 902,
    "preview": "import * as winston from 'winston';\nimport  ResponseTemplate from './responseTemplate';\n/* eslint class-methods-use-this"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/helper/logger.ts",
    "chars": 789,
    "preview": "const winston = require('winston');\n\n// define the custom settings for each transport (file, console)\nconst options = {\n"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/helper/responseTemplate.ts",
    "chars": 1900,
    "preview": "/* istanbul ignore file */\nconst data: any = {\n  general(data) {\n    return data;\n  },\n  successMessage(message) {\n    r"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/helper/twillo.ts",
    "chars": 988,
    "preview": "const twilioConfig = global['configuration'].twilio;\n// import twilio from 'twilio';\n\nconst twillo = require('twilio')\nc"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/lib/logger.ts",
    "chars": 902,
    "preview": "const winston = require('winston');\nconst moment = require('moment');\n\n// define the custom settings for each transport "
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/lib/mongoose.ts",
    "chars": 1138,
    "preview": "/* eslint func-names:0 */\nconst mongoose = require('mongoose');\nmongoose.promises = require('bluebird');\nconst { url } ="
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/lib/requestValidator.ts",
    "chars": 680,
    "preview": "const Joi = require('joi');\n\nconst validation = {\n  loginUser : {\n    body : {\n    email: Joi.string().regex(/^[\\w.]+@[\\"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/middleware/authMiddleware.ts",
    "chars": 902,
    "preview": "const jwt = require(\"jsonwebtoken\");\nimport responseTemplate from '../helper/responseTemplate';\nimport User from '../mod"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/middleware/requestValidator.ts",
    "chars": 319,
    "preview": "\nmodule.exports = {\n  validatePayload(req, res, next) {\n    // validatr token here is its valid here\n    const token = r"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/models/plugin/plugin.ts",
    "chars": 487,
    "preview": "const datePlugin  = function timestamp(schema) {\n  // Add the two fields to the schema\n  schema.add({ \n    createdAt: Da"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/models/user.ts",
    "chars": 1411,
    "preview": "const mongoose = require('mongoose');\nconst bcrypt = require('bcrypt-nodejs');\nimport helper from '../helper/bcrypt';\nco"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/routes/defaultRoutes.ts",
    "chars": 834,
    "preview": "import * as express from \"express\";\nconst router = express.Router();\n\nimport { Router } from \"express\";\n\n\n\nexport class "
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/routes/provider/Facebook.ts",
    "chars": 1315,
    "preview": "\nimport * as passport from 'passport';\nconst FacebookStrategy = require('passport-facebook');\nimport userController from"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/routes/provider/Google.ts",
    "chars": 1357,
    "preview": "\nexport {}\nconst passport = require('passport');\nconst GoogleStrategy = require('passport-google-oauth20').Strategy;\nimp"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/routes/provider/Linkedin.ts",
    "chars": 1267,
    "preview": "export {}\nconst passport = require('passport');\nconst LinkedInStrategy = require('passport-linkedin');\nimport userContro"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/routes/provider/Locale.ts",
    "chars": 1187,
    "preview": "/* eslint prefer-destructuring:0 */\nconst passportModule = require('passport');\nconst LocalStrategy = require('passport-"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/routes/provider/Twitter.ts",
    "chars": 1191,
    "preview": "\nconst passport = require('passport');\nconst TwitterStrategy = require('passport-twitter').Strategy;\nimport userControll"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/routes/routes.ts",
    "chars": 5943,
    "preview": "import * as express from \"express\";\nimport UserController from \"../controller/UserController\";\nconst jwt = require(\"json"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/routes/userRoutes.ts",
    "chars": 4910,
    "preview": "import * as express from \"express\";\nconst router = express.Router();\nconst passport = require(\"passport\");\nimport UserCo"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/routes.ts",
    "chars": 614,
    "preview": "/* eslint func-names: [\"error\", \"never\"] */\n/* eslint prefer-destructuring: 0 */\nimport * as express from 'express';\ncon"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/seed/seedUsers.ts",
    "chars": 5509,
    "preview": "import User from '../models/user';\n\nconst mongoose = require('mongoose');\n\nconst dbName = 'blabla';\nmongoose.connect(`mo"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/seed/seedVehicle.ts",
    "chars": 3627,
    "preview": "import User from '../models/user';\n\nconst mongoose = require('mongoose');\n\nconst dbName = 'blabla';\nmongoose.connect(`mo"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/transformer/userTransformer.ts",
    "chars": 2456,
    "preview": "'use strict';\n\nimport _ from 'lodash';\n// import ReviewTransformer from './ReviewTransformer';\n\n\nlet UserTransformer = {"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/types/global.d.ts",
    "chars": 91,
    "preview": "declare namespace NodeJS {\n    export interface Global {\n      configuration: any\n    }\n  }"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/app/types/vendor.d.ts",
    "chars": 84,
    "preview": "\ndeclare namespace NodeJS {\n  export interface Global {\n    configuration: any\n  }\n}"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/env.sh",
    "chars": 1378,
    "preview": "# this environment vairables needs to be set in .env file in applciaiton root directory\n# copy this file as .env and add"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/express.ts",
    "chars": 3212,
    "preview": "import router from './app/routes';\nimport * as boom from 'express-boom';\nimport * as expressSession from 'express-sessio"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/package.json",
    "chars": 2546,
    "preview": "{\n  \"name\": \"e-commerce-hub\",\n  \"version\": \"0.0.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"start\": \"cd dist &&  nodemon "
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/public/javascripts/script.js",
    "chars": 125,
    "preview": "document.addEventListener('DOMContentLoaded', () => {\n\n  console.log('IronGenerator JS imported successfully!');\n\n}, fal"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/public/style.scss",
    "chars": 139,
    "preview": "body {\n  padding: 50px;\n  font: 14px \"Lucida Grande\", Helvetica, Arial, sans-serif;\n}\n\na {\n  color: #00B7FF;\n}\n\n.h1 {\n  "
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/server.ts",
    "chars": 1750,
    "preview": "import * as http from 'http';\nimport * as debug from 'debug';\n// After you declare \"app\"\nconst env = process.env.NODE_EN"
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/tsconfig.json",
    "chars": 497,
    "preview": "{\n    \"compilerOptions\": {\n        \"module\": \"commonjs\",\n        \"moduleResolution\": \"node\",\n        \"pretty\": true,\n   "
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/tslint.json",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/uploads/documents/.gitkeep",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "dockerized-containers/e-Commerce-Admin/uploads/profile/.gitkeep",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/Dockerfile",
    "chars": 210,
    "preview": "FROM node:carbon\n\n# Create app directory\nWORKDIR /usr/src/app\n\n# Bundle app source\nCOPY . .\n\n# npm install\nRUN npm insta"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/README.md",
    "chars": 1451,
    "preview": "# Application for e-commerce Hub\n\n\nREST API to support application features\n\n  - Express as web framework with Typescrip"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/config/email.ts",
    "chars": 821,
    "preview": "'use strict';\n\nexport default {\n\n  global: {\n    from: 'info@kpilibrary.com',\n  },\n  welcome: {\n    subject: 'Welcome to"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/config/environments/dev.ts",
    "chars": 1660,
    "preview": "/* eslint quote-props: 0 */\nexport { }\nconst configuration: any = {};\n\nconfiguration.db = {\n  mysql: {\n    user: process"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/config/environments/qa.ts",
    "chars": 1336,
    "preview": "/* eslint quote-props: 0 */\nexport { }\nconst configuration: any = {};\nconfiguration.mongo = {\n  url:  process.env.MONGOD"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/config/environments/test.ts",
    "chars": 1336,
    "preview": "/* eslint quote-props: 0 */\nexport { }\nconst configuration: any = {};\nconfiguration.mongo = {\n  url:  process.env.MONGOD"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/controller/UserController.ts",
    "chars": 5978,
    "preview": "const uuidv4 = require('uuid/v4');\nimport User from '../models/user';\ndeclare function require(name: string);\nimport Hel"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/events/notification.ts",
    "chars": 691,
    "preview": "\nimport Email from '../helper/email';\ndeclare function require(name: string);\n\nconst events = require('events');\nconst w"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/global/templates/emails/password-reset-email/html.pug",
    "chars": 3682,
    "preview": "html(lang='en')\n  head\n    meta(charset='utf-8')\n    meta(name='viewport', content='width=device-width, initial-scale=1,"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/global/templates/emails/password-reset-email/style.css",
    "chars": 7267,
    "preview": "@charset \"UTF-8\";\n/* -------------------------------------\n          GLOBAL RESETS\n      -------------------------------"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/global/templates/emails/welcome-email/html.pug",
    "chars": 3884,
    "preview": "html(lang='en')\n  head\n    meta(charset='utf-8')\n    meta(name='viewport', content='width=device-width, initial-scale=1,"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/global/templates/emails/welcome-email/style.css",
    "chars": 7267,
    "preview": "@charset \"UTF-8\";\n/* -------------------------------------\n          GLOBAL RESETS\n      -------------------------------"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/global/templates/response/index.ts",
    "chars": 2093,
    "preview": "class ResponseTemplate {\n  static general(data) {\n    return data;\n  }\n  static error(code, message, description) {\n    "
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/helper/bcrypt.ts",
    "chars": 2504,
    "preview": "\nconst bcrypt = require('bcrypt-nodejs');\nconst jwt = require('jsonwebtoken');\nconst {url} = global['configuration']\ncon"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/helper/email.ts",
    "chars": 1981,
    "preview": "const path = require('path');\ndeclare function require(name:string);\n\nconst nodemailer = require('nodemailer');\nconst ur"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/helper/errorHandler.ts",
    "chars": 902,
    "preview": "import * as winston from 'winston';\nimport  ResponseTemplate from './responseTemplate';\n/* eslint class-methods-use-this"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/helper/logger.ts",
    "chars": 789,
    "preview": "const winston = require('winston');\n\n// define the custom settings for each transport (file, console)\nconst options = {\n"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/helper/responseTemplate.ts",
    "chars": 1900,
    "preview": "/* istanbul ignore file */\nconst data: any = {\n  general(data) {\n    return data;\n  },\n  successMessage(message) {\n    r"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/helper/twillo.ts",
    "chars": 988,
    "preview": "const twilioConfig = global['configuration'].twilio;\n// import twilio from 'twilio';\n\nconst twillo = require('twilio')\nc"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/lib/logger.ts",
    "chars": 902,
    "preview": "const winston = require('winston');\nconst moment = require('moment');\n\n// define the custom settings for each transport "
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/lib/mongoose.ts",
    "chars": 1517,
    "preview": "/* eslint no-undef: 0 */\n/* eslint import/no-dynamic-require: 0 */\n\n// Bring Mongoose into the app\nconst env = process.e"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/lib/requestValidator.ts",
    "chars": 680,
    "preview": "const Joi = require('joi');\n\nconst validation = {\n  loginUser : {\n    body : {\n    email: Joi.string().regex(/^[\\w.]+@[\\"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/middleware/authMiddleware.ts",
    "chars": 902,
    "preview": "const jwt = require(\"jsonwebtoken\");\nimport responseTemplate from '../helper/responseTemplate';\nimport User from '../mod"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/middleware/requestValidator.ts",
    "chars": 319,
    "preview": "\nmodule.exports = {\n  validatePayload(req, res, next) {\n    // validatr token here is its valid here\n    const token = r"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/models/plugin/plugin.ts",
    "chars": 487,
    "preview": "const datePlugin  = function timestamp(schema) {\n  // Add the two fields to the schema\n  schema.add({ \n    createdAt: Da"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/models/user.ts",
    "chars": 1411,
    "preview": "const mongoose = require('mongoose');\nconst bcrypt = require('bcrypt-nodejs');\nimport helper from '../helper/bcrypt';\nco"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/routes/defaultRoutes.ts",
    "chars": 847,
    "preview": "import * as express from \"express\";\nconst router = express.Router();\n\nimport { Router } from \"express\";\n\n\n\nexport class "
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/routes/provider/Facebook.ts",
    "chars": 1315,
    "preview": "\nimport * as passport from 'passport';\nconst FacebookStrategy = require('passport-facebook');\nimport userController from"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/routes/provider/Google.ts",
    "chars": 1357,
    "preview": "\nexport {}\nconst passport = require('passport');\nconst GoogleStrategy = require('passport-google-oauth20').Strategy;\nimp"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/routes/provider/Linkedin.ts",
    "chars": 1267,
    "preview": "export {}\nconst passport = require('passport');\nconst LinkedInStrategy = require('passport-linkedin');\nimport userContro"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/routes/provider/Locale.ts",
    "chars": 1187,
    "preview": "/* eslint prefer-destructuring:0 */\nconst passportModule = require('passport');\nconst LocalStrategy = require('passport-"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/routes/provider/Twitter.ts",
    "chars": 1191,
    "preview": "\nconst passport = require('passport');\nconst TwitterStrategy = require('passport-twitter').Strategy;\nimport userControll"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/routes/routes.ts",
    "chars": 5943,
    "preview": "import * as express from \"express\";\nimport UserController from \"../controller/UserController\";\nconst jwt = require(\"json"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/routes/userRoutes.ts",
    "chars": 4910,
    "preview": "import * as express from \"express\";\nconst router = express.Router();\nconst passport = require(\"passport\");\nimport UserCo"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/routes.ts",
    "chars": 614,
    "preview": "/* eslint func-names: [\"error\", \"never\"] */\n/* eslint prefer-destructuring: 0 */\nimport * as express from 'express';\ncon"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/seed/seedUsers.ts",
    "chars": 5509,
    "preview": "import User from '../models/user';\n\nconst mongoose = require('mongoose');\n\nconst dbName = 'blabla';\nmongoose.connect(`mo"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/seed/seedVehicle.ts",
    "chars": 3627,
    "preview": "import User from '../models/user';\n\nconst mongoose = require('mongoose');\n\nconst dbName = 'blabla';\nmongoose.connect(`mo"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/transformer/userTransformer.ts",
    "chars": 2456,
    "preview": "'use strict';\n\nimport _ from 'lodash';\n// import ReviewTransformer from './ReviewTransformer';\n\n\nlet UserTransformer = {"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/types/global.d.ts",
    "chars": 91,
    "preview": "declare namespace NodeJS {\n    export interface Global {\n      configuration: any\n    }\n  }"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/app/types/vendor.d.ts",
    "chars": 84,
    "preview": "\ndeclare namespace NodeJS {\n  export interface Global {\n    configuration: any\n  }\n}"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/env.sh",
    "chars": 1481,
    "preview": "# this environment vairables needs to be set in .env file in applciaiton root directory\n# copy this file as .env and add"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/express.ts",
    "chars": 3210,
    "preview": "import router from './app/routes';\nimport * as boom from 'express-boom';\nimport * as expressSession from 'express-sessio"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/package.json",
    "chars": 2627,
    "preview": "{\n  \"name\": \"e-commerce-hub\",\n  \"version\": \"0.0.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"start\": \"cd dist &&  nodemon "
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/public/javascripts/script.js",
    "chars": 125,
    "preview": "document.addEventListener('DOMContentLoaded', () => {\n\n  console.log('IronGenerator JS imported successfully!');\n\n}, fal"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/public/style.scss",
    "chars": 139,
    "preview": "body {\n  padding: 50px;\n  font: 14px \"Lucida Grande\", Helvetica, Arial, sans-serif;\n}\n\na {\n  color: #00B7FF;\n}\n\n.h1 {\n  "
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/server.ts",
    "chars": 1755,
    "preview": "import * as http from 'http';\nimport * as debug from 'debug';\n// After you declare \"app\"\nconst env = process.env.NODE_EN"
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/tsconfig.json",
    "chars": 497,
    "preview": "{\n    \"compilerOptions\": {\n        \"module\": \"commonjs\",\n        \"moduleResolution\": \"node\",\n        \"pretty\": true,\n   "
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/tslint.json",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/uploads/documents/.gitkeep",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "dockerized-containers/e-Commerce-Auth/uploads/profile/.gitkeep",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/.sequelizerc",
    "chars": 99,
    "preview": "const path = require('path');\n\nmodule.exports = {\n  'config': path.resolve('config', 'config.js')\n}"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/Dockerfile",
    "chars": 258,
    "preview": "FROM node:carbon\n\n# Create app directory\nWORKDIR /usr/src/app\n\n# Bundle app source\nCOPY . .\n\n# npm install\nRUN  npm inst"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/README.md",
    "chars": 1451,
    "preview": "# Application for e-commerce Hub\n\n\nREST API to support application features\n\n  - Express as web framework with Typescrip"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/app/config/environments/dev.ts",
    "chars": 1541,
    "preview": "/* eslint quote-props: 0 */\nexport { }\nconst configuration: any = {};\nconfiguration.mongo = {\n  url:  process.env.MONGOD"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/app/config/environments/qa.ts",
    "chars": 1542,
    "preview": "/* eslint quote-props: 0 */\nexport { }\nconst configuration: any = {};\nconfiguration.mongo = {\n  url:  process.env.MONGOD"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/app/config/environments/test.ts",
    "chars": 1543,
    "preview": "/* eslint quote-props: 0 */\nexport { }\nconst configuration: any = {};\nconfiguration.mongo = {\n  url:  process.env.MONGOD"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/app/events/processEvent.ts",
    "chars": 113,
    "preview": "const events = require('events');\n\nconst eventEmitter = new events.EventEmitter();\n\nexport default eventEmitter;\n"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/app/helper/errorHandler.ts",
    "chars": 902,
    "preview": "import  logger from '../lib/logger';\nimport  ResponseTemplate from './responseTemplate';\n/* eslint class-methods-use-thi"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/app/helper/errors.ts",
    "chars": 310,
    "preview": "class APIError extends Error {\n  constructor(message, ErrorID, code = null) {\n    super();\n    Error.captureStackTrace(t"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/app/helper/logger.ts",
    "chars": 122,
    "preview": "const log = require('loglevel');\n\nlog.setLevel(global.configuration.logLevel);\nconst logger = log;\nexport default  logge"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/app/helper/responseTemplate.ts",
    "chars": 1900,
    "preview": "/* istanbul ignore file */\nconst data: any = {\n  general(data) {\n    return data;\n  },\n  successMessage(message) {\n    r"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/app/lib/logger.ts",
    "chars": 122,
    "preview": "const log = require('loglevel');\n\nlog.setLevel(global.configuration.logLevel);\nconst logger = log;\nexport default  logge"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/app/lib/mysql.ts",
    "chars": 1104,
    "preview": "import APIError from  '../helper/errors';\nimport logger from './logger';\n\nconst mysql = require('mysql2');\nimport eventE"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/app/lib/requestValidator.ts",
    "chars": 680,
    "preview": "const Joi = require('joi');\n\nconst validation = {\n  loginUser : {\n    body : {\n    email: Joi.string().regex(/^[\\w.]+@[\\"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/app/middleware/requestValidator.ts",
    "chars": 319,
    "preview": "\nmodule.exports = {\n  validatePayload(req, res, next) {\n    // validatr token here is its valid here\n    const token = r"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/app/models/data/cart.ts",
    "chars": 5572,
    "preview": "const Product= {\n  products: [\n    {\n      availableSizes: [\n        \"S\",\n        \"XS\"\n      ],\n      currencyFormat: \"$"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/app/routes/defaultRoutes.ts",
    "chars": 1020,
    "preview": "import * as express from \"express\";\nconst router = express.Router();\n\nimport { Router } from \"express\";\nimport product f"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/app/routes.ts",
    "chars": 280,
    "preview": "/* eslint func-names: [\"error\", \"never\"] */\n/* eslint prefer-destructuring: 0 */\nimport * as express from 'express';\ncon"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/app/types/global.d.ts",
    "chars": 91,
    "preview": "declare namespace NodeJS {\n    export interface Global {\n      configuration: any\n    }\n  }"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/app/types/vendor.d.ts",
    "chars": 84,
    "preview": "\ndeclare namespace NodeJS {\n  export interface Global {\n    configuration: any\n  }\n}"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/config/config.js",
    "chars": 1076,
    "preview": "const fs = require('fs');\nmodule.exports = {\n  local: {\n    username: process.env.USERNAME,\n    password: process.env.PA"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/env.sh",
    "chars": 310,
    "preview": "# this environment vairables needs to be set in .env file in applciaiton root directory\n# copy this file as .env and add"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/express.ts",
    "chars": 3212,
    "preview": "import router from './app/routes';\nimport * as boom from 'express-boom';\nimport * as expressSession from 'express-sessio"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/mysql/schema.sql",
    "chars": 4061,
    "preview": "CREATE DATABASE  IF NOT EXISTS `shopping_cart_db` /*!40100 DEFAULT CHARACTER SET utf8 */;\nUSE `shopping_cart_db`;\n\n\nDROP"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/package.json",
    "chars": 3073,
    "preview": "{\n  \"name\": \"e-commerce-hub\",\n  \"version\": \"0.0.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"start:local\": \" . ./env.sh &&"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/public/javascripts/script.js",
    "chars": 125,
    "preview": "document.addEventListener('DOMContentLoaded', () => {\n\n  console.log('IronGenerator JS imported successfully!');\n\n}, fal"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/public/style.scss",
    "chars": 139,
    "preview": "body {\n  padding: 50px;\n  font: 14px \"Lucida Grande\", Helvetica, Arial, sans-serif;\n}\n\na {\n  color: #00B7FF;\n}\n\n.h1 {\n  "
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/server.ts",
    "chars": 2204,
    "preview": "import * as http from 'http';\nimport * as debug from 'debug';\n// After you declare \"app\"\nconst env = process.env.NODE_EN"
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/tsconfig.json",
    "chars": 497,
    "preview": "{\n    \"compilerOptions\": {\n        \"module\": \"commonjs\",\n        \"moduleResolution\": \"node\",\n        \"pretty\": true,\n   "
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/tslint.json",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/uploads/documents/.gitkeep",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "dockerized-containers/e-Commerce-Cart/uploads/profile/.gitkeep",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "dockerized-containers/e-Commerce-Client/Dockerfile",
    "chars": 213,
    "preview": "FROM node:carbon\n\n# Create app directory\nWORKDIR /usr/src/app\n\n# Bundle app source\nCOPY . .\n\n# npm install\nRUN  npm inst"
  },
  {
    "path": "dockerized-containers/e-Commerce-Client/README.md",
    "chars": 1607,
    "preview": "##  Simple ecommerce cart application\n\n## Basic Overview -\n\nThis simple shopping cart prototype shows how React componen"
  },
  {
    "path": "dockerized-containers/e-Commerce-Client/env.sh",
    "chars": 221,
    "preview": "# this environment vairables needs to be set in .env file in applciaiton root directory\n# copy this file as .env and add"
  },
  {
    "path": "dockerized-containers/e-Commerce-Client/firebase.json",
    "chars": 133,
    "preview": "{\n  \"hosting\": {\n    \"public\": \"build\",\n    \"ignore\": [\n      \"firebase.json\",\n      \"**/.*\",\n      \"**/node_modules/**\""
  },
  {
    "path": "dockerized-containers/e-Commerce-Client/package.json",
    "chars": 1635,
    "preview": "{\n  \"name\": \"app\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"antd\": \"^3.13.2\",\n    \"axios\": \"^0."
  },
  {
    "path": "dockerized-containers/e-Commerce-Client/public/index.html",
    "chars": 2900,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <!-- Global site tag (gtag.js) - Google Analytics -->\n    <script async sr"
  },
  {
    "path": "dockerized-containers/e-Commerce-Client/public/manifest.json",
    "chars": 306,
    "preview": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n     "
  },
  {
    "path": "dockerized-containers/e-Commerce-Client/public/normalize.css",
    "chars": 7664,
    "preview": "/*! normalize.css v3.0.2 | MIT License | git.io/normalize */\n\n/**\n * 1. Set default font family to sans-serif.\n * 2. Pre"
  },
  {
    "path": "dockerized-containers/e-Commerce-Client/src/api/index.js",
    "chars": 760,
    "preview": "import config from '../config/server';\nimport axios from 'axios';\n\nexport function url(resource) {\n    if (!resource) {\n"
  },
  {
    "path": "dockerized-containers/e-Commerce-Client/src/components/App/index.js",
    "chars": 381,
    "preview": "import React, { Component } from 'react';\n\nimport Shelf from '../Shelf';\nimport Filter from '../Shelf/Filter';\nimport Fl"
  },
  {
    "path": "dockerized-containers/e-Commerce-Client/src/components/Checkbox/index.js",
    "chars": 925,
    "preview": "import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nclass Checkbox extends Component {\n  stat"
  },
  {
    "path": "dockerized-containers/e-Commerce-Client/src/components/FloatCart/CartProduct/index.js",
    "chars": 1605,
    "preview": "import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nimport Thumb from './../../Thumb';\nimport"
  },
  {
    "path": "dockerized-containers/e-Commerce-Client/src/components/FloatCart/index.js",
    "chars": 5120,
    "preview": "import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { connect } from 'react-redux';\nim"
  },
  {
    "path": "dockerized-containers/e-Commerce-Client/src/components/FloatCart/style.scss",
    "chars": 4999,
    "preview": ".float-cart {\n  position: fixed;\n  top: 0;\n  right: -450px;\n  width: 450px;\n  height: 100%;\n  background-color: #1b1a20;"
  },
  {
    "path": "dockerized-containers/e-Commerce-Client/src/components/Selectbox/index.js",
    "chars": 744,
    "preview": "import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nclass Selectbox extends Component {\n  sta"
  },
  {
    "path": "dockerized-containers/e-Commerce-Client/src/components/Shelf/Filter/index.js",
    "chars": 1337,
    "preview": "import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { connect } from 'react-redux';\nim"
  },
  {
    "path": "dockerized-containers/e-Commerce-Client/src/components/Shelf/Filter/style.scss",
    "chars": 1706,
    "preview": ".filters {\n  width: 15%;\n  margin-right: 15px;\n\n  .star-button-container {\n    text-align: center;\n    small {\n      col"
  },
  {
    "path": "dockerized-containers/e-Commerce-Client/src/components/Shelf/ProductList/Product/index.js",
    "chars": 1814,
    "preview": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\n\nimport Thumb from"
  },
  {
    "path": "dockerized-containers/e-Commerce-Client/src/components/Shelf/ProductList/index.js",
    "chars": 216,
    "preview": "import React from 'react';\n\nimport Product from './Product';\n\nconst ProductList = ({ products }) => {\n  return products."
  }
]

// ... and 344 more files (download for full content)

About this extraction

This page contains the full source code of the tkssharma/nodejs-microservices-patterns GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 544 files (623.6 KB), approximately 181.5k tokens, and a symbol index with 472 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!