All Projects → Onix-Systems → nest-js-boilerplate

Onix-Systems / nest-js-boilerplate

Licence: MIT License
Nest.js boilerplate

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
Handlebars
879 projects
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to nest-js-boilerplate

starter-reactnative-nestjs-mysql
Starter mobile ReactNative NestJS MySQL with continuous integration and AWS deployment
Stars: ✭ 16 (-79.75%)
Mutual labels:  starter, starter-kit, nestjs
Generator Jekyll Starter Kit
🚀 Jekyll Progressive Web App Generator.
Stars: ✭ 139 (+75.95%)
Mutual labels:  generator, yeoman, starter-kit
Generator Ngx Rocket
🚀 Extensible Angular 11+ enterprise-grade project generator
Stars: ✭ 1,329 (+1582.28%)
Mutual labels:  generator, yeoman, starter-kit
Core Nestjs
A simple application demonstrating the basic usage of permissions with NestJS (JWT, Passport, Facebook, Google+, User, Group, Permission)
Stars: ✭ 347 (+339.24%)
Mutual labels:  heroku, passport, nestjs
Node Typescript Mongodb
node js typescript mongodb express generator yo
Stars: ✭ 96 (+21.52%)
Mutual labels:  generator, yeoman, starter
nest-typescript-starter
Nest framework TypeScript starter (node.js)
Stars: ✭ 35 (-55.7%)
Mutual labels:  starter, starter-kit, nestjs
example-typescript-package
Example TypeScript Package ready to be published on npm & Tutorial / Instruction / Workflow for 2021
Stars: ✭ 71 (-10.13%)
Mutual labels:  starter, starter-kit
generator-vars-jekyll
Generator for raw web app with CircleCI, Jekyll, Webpack, Express + more.
Stars: ✭ 18 (-77.22%)
Mutual labels:  heroku, yeoman
typescript-npm-package-template
Boilerplate to kickstart creating an npm package using TypeScript
Stars: ✭ 122 (+54.43%)
Mutual labels:  commitizen, starter
bad-cards-game
Bad Cards Game
Stars: ✭ 23 (-70.89%)
Mutual labels:  heroku, nestjs
botfuel-sample-starter
Starter bot using Botfuel Dialog
Stars: ✭ 24 (-69.62%)
Mutual labels:  starter, starter-kit
noise-php
A starter-kit for your PHP project.
Stars: ✭ 52 (-34.18%)
Mutual labels:  starter, starter-kit
flask-app-blueprint
Flask App Blueprint / Boilerplate including user registration/login, admin only section, CRUD on database, and more. Based on Python, Flask, PostgreSQL, et al. deployed on Heroku. The #1 starter project.
Stars: ✭ 144 (+82.28%)
Mutual labels:  heroku, starter-kit
nestjs-auth-starter-kit
NestJS Auth Starter Kit (typescript / typeorm / swagger / passport / bcrypt)
Stars: ✭ 37 (-53.16%)
Mutual labels:  passport, nestjs
react-phoenix-users-boilerplate
Elixir/Phoenix + React + users template/boilerplate.
Stars: ✭ 71 (-10.13%)
Mutual labels:  heroku, starter-kit
nest-auth-example
Nest.js authentication with Passport. Realworld example
Stars: ✭ 186 (+135.44%)
Mutual labels:  passport, nestjs
ng-nest-cnode
Angular 10 Front-End and Nestjs 7 framework Back-End build Fullstack CNode
Stars: ✭ 17 (-78.48%)
Mutual labels:  passport, nestjs
nextjs-blog-starter-kit
NextJS Blog + Contentful Typescript Starter kit with Static Export 🚀
Stars: ✭ 56 (-29.11%)
Mutual labels:  starter, starter-kit
zeldaPlay
A Single Page Application to help zeldaPlay players to track their characters and progress
Stars: ✭ 95 (+20.25%)
Mutual labels:  heroku, nestjs
SampleProject
A starter project for Sample Project in Objective C. Objective C version of https://github.com/xeieshan/SwiftySampleProject
Stars: ✭ 31 (-60.76%)
Mutual labels:  starter, starter-kit

Nest.js boilerplate

onix Commitizen friendly Downloads Month Typescript for types Our rating License Issues Latest package version Dependencies Organization stars Travis build passing

Node.js Nest.js API. Supports MongoDB, Mysql, Redis

Description

This generator will help you to build your own Nest.JS Mongodb/MySQL API using TypeScript 4

Project Introduction

  • Support ES6/ES7 features
  • Using Eslint followed Airbnb JavaScript Style Guide
  • Husky
  • Commitizen
  • MIT license and Code of conduct
  • Docker
  • Prettier
  • Nest.JS 8

Features

Authentication

  • passport local strategy
  • jwt authentication
  • passport google 2.0 strategy

Session Storage

  • MongoDB
  • Redis
  • MySQL

Email Sending

  • Nodemailer

Integration testing

  • mocha
  • chai
  • supertest

Requirements

  • node >= 14
  • npm >= 7
  • mongodb >= 4.0
  • typescript >= 4.0.3

Installation

First, install Yeoman and generator-nest-js-boilerplate using npm (we assume you have pre-installed node.js).

npm install -g yo
npm install -g generator-nest-js-boilerplate

Then generate your new project:

yo nest-js-boilerplate

Example App Skeleton (for Mongo + JWT + WS)

├── README.md
├── docker-compose.yml
├── index.js
├── nest-cli.json
├── package.json
├── src
│   ├── constants
│   │   └── common.constants.ts
│   ├── decorators
│   │   ├── auth-bearer.decorator.ts
│   │   ├── roles.decorator.ts
│   │   └── serialization.decorator.ts
│   ├── exceptions
│   │   └── validation.exceptions.ts
│   ├── filters
│   │   ├── all-exceptions.filter.ts
│   │   └── ws-exceptions.filter.ts
│   ├── guards
│   │   ├── jwt-access.guard.ts
│   │   ├── jwt-refresh.guard.ts
│   │   ├── jwt-ws-access.guard.ts
│   │   └── roles.guard.ts
│   ├── interceptors
│   │   ├── serialization.interceptor.ts
│   │   └── wrap-response.interceptor.ts
│   ├── interfaces
│   │   ├── exception-response.interface.ts
│   │   ├── jwt-decode-response.interface.ts
│   │   ├── paginatedEntity.interface.ts
│   │   └── pagination-params.interface.ts
│   ├── main.ts
│   ├── pipes
│   │   └── parse-object-id.pipe.ts
│   ├── routes
│   │   ├── app
│   │   │   ├── app.controller.ts
│   │   │   ├── app.gateway.ts
│   │   │   ├── app.module.ts
│   │   │   └── app.service.ts
│   │   └── v1
│   │       ├── auth
│   │       │   ├── auth-constants.ts
│   │       │   ├── auth.controller.spec.ts
│   │       │   ├── auth.controller.ts
│   │       │   ├── auth.module.ts
│   │       │   ├── auth.repository.ts
│   │       │   ├── auth.service.spec.ts
│   │       │   ├── auth.service.ts
│   │       │   ├── dto
│   │       │   │   ├── jwt-tokens.dto.ts
│   │       │   │   ├── refresh-token.dto.ts
│   │       │   │   ├── sign-in.dto.ts
│   │       │   │   ├── sign-up.dto.ts
│   │       │   │   └── verify-user.dto.ts
│   │       │   ├── guards
│   │       │   │   └── local-auth.guard.ts
│   │       │   ├── interfaces
│   │       │   │   ├── decoded-user.interface.ts
│   │       │   │   ├── jwt-strategy-validate.interface.ts
│   │       │   │   ├── login-payload.interface.ts
│   │       │   │   └── validate-user-output.interface.ts
│   │       │   └── strategies
│   │       │       ├── jwt-access.strategy.ts
│   │       │       ├── jwt-refresh.strategy.ts
│   │       │       ├── jwt-ws-access.strategy.ts
│   │       │       └── local.strategy.ts
│   │       ├── users
│   │       │   ├── dto
│   │       │   │   └── update-user.dto.ts
│   │       │   ├── entity
│   │       │   │   ├── user-response.entity.ts
│   │       │   │   └── user.entity.ts
│   │       │   ├── interfaces
│   │       │   │   └── user.interface.ts
│   │       │   ├── schemas
│   │       │   │   └── users.schema.ts
│   │       │   ├── users-constants.ts
│   │       │   ├── users.controller.spec.ts
│   │       │   ├── users.controller.ts
│   │       │   ├── users.module.ts
│   │       │   ├── users.repository.ts
│   │       │   ├── users.service.spec.ts
│   │       │   └── users.service.ts
│   │       └── v1.module.ts
│   └── templates
│       └── verify-password.hbs
├── tsconfig.build.json
├── tsconfig.json
└── typedoc.json

Running the API

Development

To start the application in development mode, run:

npm run start:dev

Start the application in production env:

Install ts pm2 and typescript compiler:

npm install -g pm2
pm2 install typescript

example start with scale on 2 core:

pm2 start ./dist/main.js -i 2 --no-daemon

Express server listening on http://localhost:3000/, in development mode The developer mode will watch your changes then will transpile the TypeScript code and re-run the node application automatically.

Docker

  1. Install Docker
  2. Install docker-compose

To run your app in docker containers choose "Yes" when the generator asks you about docker.

Now, lift up your app in docker

  docker-compose up

Set up environment

In root folder you can find .env. You can use this config or change it for your purposes.

Deploy

Heroku

Check all urls to dbs if they are true, they must connect to dbs which located at them own servers like mongodb on Mlab When you'll run npm run deploy:heroku you'll need to sign in on heroku. You will be redirected to login form.

npm run deploy:heroku

Jwt auth

Alt Text2

Oauth2 auth

Alt Text3

When you go by http://localhost:3000/google route, google'll ask you to authorize into your account. After successfully sign in to your account you will be redirected to http://localhost:3000/google/redirect route

Documentation

WebSocket API

TypeDoc

TypeDoc documentation will be available after entering the command:

npm run docs

This command will create a folder with documents in which you can see index.html, which needs to be opened in a browser to view the documentation.

REST API

Swagger

Swagger documentation will be available on route:

http://localhost:3000/api

Please note:
All users not verified by default. Please set "verified": true, for sign-in request.

Alt Text1

Getting To Know Yeoman

  • Yeoman has a heart of gold.
  • Yeoman is a person with feelings and opinions, but is very easy to work with.
  • Yeoman can be too opinionated at times but is easily convinced not to be.
  • Feel free to learn more about Yeoman.
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].