# @squaretech.art/squarebox

> squaretech module framework

Latest version **1.0.5** (published 2021-07-27) · ISC license · 0 weekly downloads

## Install

```sh
npm install @squaretech.art/squarebox
pnpm add @squaretech.art/squarebox
yarn add @squaretech.art/squarebox
bun add @squaretech.art/squarebox
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2021-07-27 |
| First published | 2021-01-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 12 |
| Unpacked size | 27.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | squaretech.art |
| Maintainers | squaretech.art |
| Keywords | squarebox |

## Links

- npm: https://www.npmjs.com/package/@squaretech.art/squarebox
- npm.io page: https://npm.io/package/@squaretech.art/squarebox

## Dependencies (12)

- [pg](https://npm.io/package/pg.md) ^8.5.1
- [redis](https://npm.io/package/redis.md) ^3.0.2
- [bunyan](https://npm.io/package/bunyan.md) ^1.8.15
- [amqplib](https://npm.io/package/amqplib.md) ^0.6.0
- [express](https://npm.io/package/express.md) ^4.17.1
- [moleculer](https://npm.io/package/moleculer.md) ^0.14.12
- [sequelize](https://npm.io/package/sequelize.md) ^6.3.5
- [socket.io](https://npm.io/package/socket.io.md) ^2.1.0
- [express-busboy](https://npm.io/package/express-busboy.md) ^8.0.0
- [moleculer-repl](https://npm.io/package/moleculer-repl.md) ^0.6.4
- [node-redis-scan](https://npm.io/package/node-redis-scan.md) ^1.2.1
- [express-useragent](https://npm.io/package/express-useragent.md) ^1.0.15

## Recent versions

- 1.0.5 (latest) — 2021-07-27
- 1.0.4 — 2021-01-18
- 1.0.3 — 2021-01-18
- 1.0.2 — 2021-01-18
- 1.0.1 — 2021-01-15
- 1.0.0 — 2021-01-15

## README

# SQUAREBOX

squarebox is a module for quaretech.art framework  based on moleculerJS.

# Features

  - Routing
  - MVC Concept
  - Multiple Transporter
  - Logging
  - Road Balancing
  - Metrcics
  - Tracing
  - Fault Tolerance
  - Fastest Validator
  - Multi Database Connection
  - Redis Engine

### Installation

Squarebox requires [Node.js](https://nodejs.org/) v12+ to run.

```sh
$ cd root_folder
$ npm i @squaretech.art/squarebox
```

### Plugins

Squarebox is currently extended with the following delault plugins. 

-   amqplib
-   bunyan
-   expressjs
-   moleculer
-   pg
-   redis
-   sequelize

### config

- env.js
```
module.exports = {
    node: {
        env: 'development',
        debug: true,
        mode : 'repl'     // normal || repl
    },
    app: {
        id: "869259ced4e8ae68eabca702e23e56c9",
        type: "server",
        name: "master",
        host: "0.0.0.0",
        port: 9912
    },
    logger: {
		type: "Console",
        options: {
            formatter: "simple"
        }
    },
    transporter: {
        type: "AMQP",
        options: {
            url: "amqp://localhost"
        }
    },
    metrics: {
		enabled: true,
		reporter: {
			type: "Prometheus",
			options: {
				port: 9913,
				path: "/metrics",
				defaultLabels: registry => ({
					namespace: 'master',
					nodeID: '869259ced4e8ae68eabca702e23e56c9'
				})
			}
		}
    },
    tracing: {
        enabled: true,
        exporter: {
            type: "Console",
            options: {
                logger: null,
                colors: true,
                width: 100,
                gaugeWidth: 40
            }
        }
    },
    circuitbreaker: {
        enabled: true,
        threshold: 0.5,
        minRequestCount: 20,
        windowTime: 60, 
        halfOpenTime: 5 * 1000, 
        check: err => err && err.code >= 500
    },
    db: {
        host: "",
        name: "",
        user: "",
        pass: "",
        engine: "postgres",
        schema: "public",
        debug: false
    },
    cache: {
        host: "",
        port: ,
        db: 0
    }
}
```

- services.js
```
module.exports = {
    service : 'service'
}
```

---
_Source: https://npm.io/package/@squaretech.art/squarebox · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
