This package has been deprecated

Author message:

Not longer support

product-categorization-engine-module
TypeScript icon, indicating that this package has built-in type declarations

0.1.1-beta.2 • Public • Published

Logo

product-categorization-engine-module

Module responsable for product categorization
Explore the docs »

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. Publish module on npmjs.com

About The Project

Module for backend of categorization tools, this module has tu be installed in backend-backoffice

Built With

BD Diagram

BD

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

  • npm
    npm install npm@latest -g

Installation

  1. Clone the repo
    git clone https://github.com/tiendamiaOfficial/backend-categorization-module.git
  2. Install NPM packages
    npm install

Usage

How to use logs with winston

 logger.error(err);
 logger.info(err);

How to set connection or configurations params

all configurations should be set in .env file , example

 # Put lots of randomness in these
 SESSION_SECRET=ashdfjhasdlkjfhalksdjhflak

the project has the module dotenv-flow it allow to have a .env file for each environment overriding .env property in each child

 .env.local
 .env.test
 .env.staging
 .env.production

you can execute node comand using the enviroment and each enviroment has a .env file example "NODE_ENV=test jest --forceExit --coverage --verbose"

How to connect to database

Connection to database are handler in a single service dbConnection, that service has methods like: connect() and close().

The database connection params is configured in .env file

How to use dependency injection

For consuming service injected in dependency injection.

const VAR_NAME = container.get<NAME_OF_SERVICE>(TYPES.NAME_OF_SERVICE);

For inject service on the dependency injection system

Add on /lib/ContainerInjection.ts the next code.

container.bind<NAME_OF_SERVICE>(TYPES.DbConnection).to(NAME_OF_SERVICE);

and add on /lib/Types.ts

const TYPES = {
    NAME_OF_SERVICE: Symbol.for('NAME_OF_SERVICE'),
};

Contributing

  1. Clone the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Publish module

Publish

1 - Open the terminal and run the next command npm login and login with tiendamiadev credentials.

2 - Publish package npm publish --access restricted.

Readme

Keywords

none

Package Sidebar

Install

npm i product-categorization-engine-module

Weekly Downloads

0

Version

0.1.1-beta.2

License

ISC

Unpacked Size

316 kB

Total Files

157

Last publish

Collaborators

  • tiendamiadev