All Projects → GeorgianStan → nestjs-microservice-boilerplate

GeorgianStan / nestjs-microservice-boilerplate

Licence: other
Boilerplate for a TCP Microservice in NestJS with TypeORM and tests

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to nestjs-microservice-boilerplate

MyAPI
A template to create awesome APIs easily ⚡️
Stars: ✭ 117 (+160%)
Mutual labels:  nestjs, nestjs-typeorm
Nestjs-Typeorm-Auth
NestJS + Typeorm codebase containing a full authentification system with roles, sessions and email verification.
Stars: ✭ 37 (-17.78%)
Mutual labels:  nestjs, nestjs-typeorm
hev-socks5-tproxy
A simple, lightweight socks5 transparent proxy for Linux. (IPv4/IPv6/TCP/UDP over TCP)
Stars: ✭ 209 (+364.44%)
Mutual labels:  tcp
BUA-FE
本科毕设,搭建一套小而全面的校园外卖系统。主要使用wei-xin-mini + TypeScript + nest.js + typeORM + rabbitmq技术栈。
Stars: ✭ 20 (-55.56%)
Mutual labels:  nestjs
chat-server-release
[飞享]-服务端发布版本,支持TCP,Websocket链接,只需修改少量的配置即可快速部署,请严格按照项目部署目录配置环境,这样能保证你快速部署成功.详情请进入官网https://www.fsharechat.cn 查看具体的部署说明,技术支持商业合作请找官方技术支持
Stars: ✭ 28 (-37.78%)
Mutual labels:  tcp
nest-serve
使用 Nestjs 8.x 以微服务方式开发的基础管理后台服务,并搭配 React 开发的管理后台前端(可自行根据 swagger 的接口开发对应的管理后台前端)
Stars: ✭ 97 (+115.56%)
Mutual labels:  nestjs
reverse-tunnel
Reverse tunnel TCP and UDP
Stars: ✭ 100 (+122.22%)
Mutual labels:  tcp
azure-serverless-deprecated
[Deprecated] Azure Serverless module for Nest framework (node.js) 🌩
Stars: ✭ 44 (-2.22%)
Mutual labels:  nestjs
net-protocol
golang模拟内核协议栈 实现链路层、网络层、传输层、应用层 用户态协议栈 ,基于虚拟网卡TUN/TAP
Stars: ✭ 129 (+186.67%)
Mutual labels:  tcp
Socket
The Hoa\Socket library.
Stars: ✭ 61 (+35.56%)
Mutual labels:  tcp
CosmosFramework
CosmosFramework is a lightweight plug-in Unity development framework . Has a rich Unity method extensions and toolchain. async/await syntax support, multi-network channel support.Long term support for this project
Stars: ✭ 176 (+291.11%)
Mutual labels:  tcp
unnue-nuxt
开媛笔记,基于nuxt ssr首屏服务器端渲染 ⚡。用于分享、记录、交流和学习,希望可以帮助到小伙伴们。同时网站在永久更新,备好鸡血,一起来战 Ooh aah!
Stars: ✭ 98 (+117.78%)
Mutual labels:  nestjs
nuxtjs-nestjs-starter
Starter project for nuxtjs and nestjs all in one integrated.
Stars: ✭ 56 (+24.44%)
Mutual labels:  nestjs
graphql-utils
Utilities and helpers to make working with GraphQL.js based APIs simpler.
Stars: ✭ 42 (-6.67%)
Mutual labels:  nestjs
sonix
An Elixir client for Sonic Search
Stars: ✭ 56 (+24.44%)
Mutual labels:  tcp
quic vs tcp
A Survey and Benchmark of QUIC
Stars: ✭ 41 (-8.89%)
Mutual labels:  tcp
mpcast-minapp-uni
播(客)课小程序
Stars: ✭ 14 (-68.89%)
Mutual labels:  nestjs
Backdoor
A backdoor that runs on Linux and Windows
Stars: ✭ 36 (-20%)
Mutual labels:  tcp
nestjs-extensions
[WIP] A bunch of useful and opinionated filters, modules, pipes... to use with Nest framework. 😻
Stars: ✭ 43 (-4.44%)
Mutual labels:  nestjs
network
exomia/network is a wrapper library around System.Socket for easy and fast TCP/UDP client & server communication.
Stars: ✭ 18 (-60%)
Mutual labels:  tcp

Changelog

v2.1.0

  • sample .env file to indicate required environment variables
  • switch to truly private variables, instead of TypeScript modifiers
  • CustomResponse interface includes the namespace now

v2.0.0

Core

  • upgrade to latest NestJS version(v7)
  • folder structure update
  • use cross-env to set the NODE_ENV for cross OS support

Modules

  • refactor utils to simply custom-response
  • CustomResponse interface is a generic now
  • new custom-response status WARNING = 'warning'
  • config.service will use now process.cwd() istead of a relative path
  • config.service will return the values from .env files or from process.env
  • database.module will receive each entity inside the entities instead of 'dist/**/*.entity{.ts,.js}'

Explanation

For a better understanding, check out this article.

Preparation

Write your .env variables

Now is time to write your configuration for this project. Create two files: .env.development and .env.test.

! Both will be ignored with .gitignore

! In production instead of these two, create a new file on your server named .env.production

This is an example for .env.development ! Replace with your config

DB_SERVER_PORT=3306
DB_SERVER_HOST=localhost
DB_SERVER_USERNAME=root
DB_SERVER_PASSWORD=root
DATABASE=users

ERROR_CODE_NAMESPACE=users-microservice

Microservice Port

:8875

Response Format

{
  "status":ResponseStatus
  "data":any -> '' when no data is found
  "error":CustomError
}

ResponseStatus - "success" or "fail"

CustomError - consist of 3 parts: an error code, a message and a namespace. Codes are universal, but messages can vary. Here is the error JSON payload:

{
  "code":number,
  "msg":string || string[]
  "namespace":string
}

Error codes

10xx - General Server or Network issues

1000 UNKNOWN

  • An unknown error occured while processing the request.

1001 DATABASE_ERROR

  • An unknown error occured on database.

11xx - Request issues

1100 BAD_PARAMETERS

  • Bad parameters send to endpoint
  • The validation pipe will return the error as message
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].