# at-nestjs-core

> Core module to help you build great microservices.

Latest version **1.0.24** (published 2020-01-21) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install at-nestjs-core
pnpm add at-nestjs-core
yarn add at-nestjs-core
bun add at-nestjs-core
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.24 |
| Published | 2020-01-21 |
| First published | 2017-12-27 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 26 |
| Unpacked size | 260 KB |
| Known vulnerabilities | 0 (+41 in 8 direct dependencies) |
| Install scripts | no |
| Author | Altran |
| Maintainers | npmaltran |
| Keywords | typescript, microservices |

## Links

- npm: https://www.npmjs.com/package/at-nestjs-core
- npm.io page: https://npm.io/package/at-nestjs-core

## Dependencies (26)

- [md5](https://npm.io/package/md5.md) ^2.2.1
- [rxjs](https://npm.io/package/rxjs.md) ^5.4.3
- [axios](https://npm.io/package/axios.md) ^0.17.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [moment](https://npm.io/package/moment.md) ^2.18.1
- [zipkin](https://npm.io/package/zipkin.md) ^0.19.1
- [express](https://npm.io/package/express.md) ^4.15.3
- [ts-node](https://npm.io/package/ts-node.md) ^2.1.0
- [winston](https://npm.io/package/winston.md) ^3.0.0
- [mongoose](https://npm.io/package/mongoose.md) ^4.11.6
- [kafka-node](https://npm.io/package/kafka-node.md) ^2.4.0
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.0
- [@nestjs/core](https://npm.io/package/@nestjs/core.md) 4.6.6
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^8.1.0
- [@nestjs/common](https://npm.io/package/@nestjs/common.md) 4.6.6
- [@nestjs/testing](https://npm.io/package/@nestjs/testing.md) 4.6.6
- [class-validator](https://npm.io/package/class-validator.md) ^0.8.1
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.10
- [class-transformer](https://npm.io/package/class-transformer.md) ^0.1.9
- [@nestjs/websockets](https://npm.io/package/@nestjs/websockets.md) 4.6.6
- [autobind-decorator](https://npm.io/package/autobind-decorator.md) ^2.1.0
- [zipkin-context-cls](https://npm.io/package/zipkin-context-cls.md) ^0.19.0
- [@nestjs/microservices](https://npm.io/package/@nestjs/microservices.md) 4.6.6
- [zipkin-transport-http](https://npm.io/package/zipkin-transport-http.md) ^0.19.1
- [zipkin-instrumentation-axiosjs](https://npm.io/package/zipkin-instrumentation-axiosjs.md) ^0.19.1
- [zipkin-instrumentation-express](https://npm.io/package/zipkin-instrumentation-express.md) ^0.19.1

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.24 (latest) — 2020-01-21
- 1.0.23 — 2020-01-21
- 1.0.22 — 2019-07-01
- 1.0.21 — 2019-05-13
- 1.0.20 — 2019-03-26
- 1.0.19 — 2019-03-15
- 1.0.18 — 2019-02-18
- 1.0.17 — 2018-12-19
- 1.0.16 — 2018-04-11
- 1.0.15 — 2018-04-10
- 1.0.14 — 2018-04-06
- 1.0.13 — 2018-04-03
- 1.0.12 — 2018-03-20
- 1.0.11 — 2018-03-19
- 1.0.10 — 2018-03-15
- … 9 more at https://npm.io/package/at-nestjs-core/versions

## README

# Feina Activa
### at-nestjs-core

## Description

Core module to help you build great microservices.

### Built With

- NestJs (4.6) [ common, core, microservices, testing and websockets ]
- @types [ mongoose ]
- Autobind decorator
- json-webtoken
- kafka-node
- lodash
- md5
- moment
- mongoose
- reflect-metadata
- Rxjs
- Winston

---

- @types [ node ]
- rimraf
- TypeScript (2.6.2)
- Karma [ chrome-launcher, cli, coverage-istanbul-reporter, jasmine and jasmine-html-reporter ]
- TsLint (5.4.3) [ tslint-eslint-rules and no-unused-expression-chai]
- Nodemon (automatic reloading)

#### General info about the stack used within this microservice:

1. [NestJs](https://nestjs.com/) framework.
2. [TypeScript](https://www.typescriptlang.org/) language.
3. [TSLint](https://palantir.github.io/tslint/rules/) core rules
4. [Nodemon](https://nodemon.io/) is a utility that will monitor for any changes un your source and automatically restart your server.

* Check annex section for in depth details about our Stack.



## Configuration


These instructions will get you a built version of at-nestj-core library, providing a set of classes and tools to ease your microservice development.

### Prerequisites

Make sure you have

1. [npm](https://docs.npmjs.com/)
2. [node](https://nodejs.org/en/download/) version >= 8.9.x,
3. [mongo](https://www.mongodb.com/download-center#community) version >= 3.4.x,installed on your system.

    - [Linux installation](https://docs.mongodb.com/v3.4/administration/install-on-linux/) here.
    - [Mac installation](https://docs.mongodb.com/v3.4/tutorial/install-mongodb-on-os-x/) here.
    - [Windows installation](https://docs.mongodb.com/v3.4/tutorial/install-mongodb-on-windows/) here.


## Environments

#### Environment variables

There are several configurable variables in .env:

    APP_NAME='My Microservice'

    JWT_SECRET_KEY='supersecretkey'

    COOKIE_NAME='cookie_field'

    MONGO_DB_URI=<string, mongodb uri>

    PORT='9000'

    TRANSLATE_HOST='http://localhost:9001'
          
    DEFAULT_LANG='ca'

### Npm Tasks

Following, we have some package scripts to perform this actions:

- Start project for development purposes.
- Run TSLint.
- Compile TypeScript.
- Build project in dist folder.
- Create a server to work with.
- Watch for file changes and reloads the server.
- Prepare code during publish process.

#### Commands:

`npm start`

`npm run lint`

`npm run build`

`npm run prepare`

`npm run clean`


## Development

### Installing and Running

For installing on a project, you just need to install the dependency and start the project.

1. `npm install at-nestjs-core`

2. `npm start`


### Contributing

For development purposes,

3. Is not recommended to use npm link to test development versions on your projects. We suggest you to generate a built version with:

```
tsc
```

and copy these generated files into your microservice dependencies folder npm_modules/at-nestjs-core, replacing published files.
After this, you only need to restart your microservice.

You can also use
```
npm start
```
script to generate built files on every code update.

## Running the tests

To run the tests, you need to type
```
npm tests
```
This will execute all the unit tests and create a coverage report of the code.

## Publishing new version

To create a new version of this library, you need to upgrade the version field on package.json (check package-lock too), login on your cli as npm owner and type:
```
npm publish

```


## ANNEX


####  Folder structure

 Creates a ready-to-run microservice with the following directories structure:

 ```
.
├── src          # Contains files and directories. Core classes to build a microservice.
├.editorconfig
├.gitignore
├.npmignore
├README.md
└──
```

### Built with

### 1. NestJS
##### What is it?

>[NestJS](https://nestjs.com/) aims to provide an application architecture out of the box which allows for effortless creation of highly testable, scalable, loosely coupled and easily maintainable applications.

 * Nestjs is a progressive Node.js framework.
 * Is built with TypeScript (preserves compatibility with pure Javascript).
 * Combines elements of OOP ( Object Oriented Programming ), FP ( Functional Programming ) and FRP ( Functional Reactive Programming ).
 * Makes use of Expres.js.

### 2. TypeScript
##### What is it?

>[TypeScript](https://www.typescriptlang.org/) is a typed superset of JavaScript that compiles to plain JavaScript.

 * In this project, Typescript tools are available via npm (Node.js package manager).
 * Use .ts extension in order to indicate that a file will contain code written in TypeScript.

### 3. Nodemon
>[Nodemon](https://nodemon.io/) is a utility that will monitor for any changes on your source code and automatically restart your server.

##### What it does?

 * Automatic restarting of application.
 * Detects default extension to monitor.
 * Ignores specific files or directories.
 * Watches specific directories.


***
### Altran - 2017

---
_Source: https://npm.io/package/at-nestjs-core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
