Skip to content

Commit

Permalink
feat(push): PushNotifications subscription backend API
Browse files Browse the repository at this point in the history
  • Loading branch information
xmlking committed Nov 21, 2018
1 parent 1164fc3 commit 7480338
Show file tree
Hide file tree
Showing 16 changed files with 418 additions and 218 deletions.
78 changes: 42 additions & 36 deletions PLAYBOOK-NEST.md
@@ -1,62 +1,69 @@
DIY NestJS Playbook
===================
# DIY NestJS Playbook

creating NestJS project and generate nest artifacts with-in monorepo.

> An Introduction to [NestJS](https://www.joshmorony.com/an-introduction-to-nestjs-for-ionic-developers/)
### Prerequisites
### Prerequisites

#### Install Global Packages

```bash
npm remove -g @nestjs/cli
npm install -g @nestjs/cli
```

### Scaffold Project

> adding code dependencies
```bash
nest new apps/api "my api" "0.1.0-SNAPSHOT" "Sumanth Chinthagunta <xmlking@gmail.com>" -d

npm i @nestjs/core @nestjs/common
npm i @nestjs/microservices @nestjs/websockets @nestjs/testing @nestjs/typeorm typeorm mongodb
npm i @nestjs/swagger
npm i @nestjs/passport passport passport-jwt @xmlking/jwks-rsa
npm i nest-router
npm i nodemailer pug
# fastify-* are optional. use only if you want to replace express with fastify
npm i fastify fastify-formbody fastify-swagger
# Add nestjs
npm i @nestjs/{common,core,microservices,swagger,websockets,typeorm,passport,elasticsearch}

# fastify-* are optional. use only if you want to replace express with fastify
npm i fastify fastify-formbody fastify-swagger

npm i -D @nestjs/testing
npm i -D @nestjs/schematics
npm i -D rimraf nodemon tsconfig-paths ts-loader
npm i -D jest ts-jest @types/jest supertest @types/supertest
npm i -D webpack-cli webpack-node-externals
npm i -D @types/nodemailer
npm i -D @types/socket.io
npm i -D @types/passport@0.4.2 @types/passport-jwt

```

> check versions
```bash
# check of nest installed
nest info
```

#### Dependencies

> adding 3rd party modules/libs
```bash
npm i class-validator
npm i class-transformer
npm i pg
npm i dotenv
npm i helmet
npm i web-push
npm i nest-router
npm i nodemailer pug
npm i class-validator
npm i class-transformer
npm i passport passport-jwt @xmlking/jwks-rsa

npm i -D @types/dotenv
npm i -D rimraf nodemon tsconfig-paths ts-loader
npm i -D jest ts-jest @types/jest supertest @types/supertest
npm i -D webpack-cli webpack-node-externals
npm i -D @types/nodemailer
npm i -D @types/socket.io
npm i -D @types/passport@0.4.2 @types/passport-jwt
npm i -D @types/web-push
npm i -D @types/helmet
```

#### Generate Artifacts

```bash
# scaffold core module
nest g module core --dry-run
Expand All @@ -65,7 +72,7 @@ nest g exception auth --dry-run

# scaffold shared module
nest g module shared --dry-run
nest g gateway eventbus shared --dry-run # /src/shared/eventbus/eventbus.gateway.ts to shared/eventbus.gateway.ts
nest g gateway eventbus shared --dry-run # /src/shared/eventbus/eventbus.gateway.ts to shared/eventbus.gateway.ts

# scaffold project module
nest g module project --dry-run
Expand All @@ -86,15 +93,15 @@ nest g service email email --dry-run

# scaffold auth module
nest g module auth --dry-run
nest g service auth auth --dry-run
nest g controller auth --dry-run
nest g service auth auth --dry-run
nest g controller auth --dry-run
nest g class user auth --dry-run # move ../ and rename as user.entity.ts

# scaffold chat module
nest g module chat --dry-run
nest g service chat chat --dry-run
nest g controller chat --dry-run
nest g gateway chat --dry-run
nest g service chat chat --dry-run
nest g controller chat --dry-run
nest g gateway chat --dry-run

# scaffold chat module
nest g module notifications --dry-run
Expand All @@ -109,13 +116,12 @@ nest g service push --dry-run
nest g class subscription push --no-spec --dry-run # rename as subscription.entity.ts
```


### Ref

* Awesome Nest
* https://github.com/juliandavidmr/awesome-nest
* ChatBot
* https://github.com/adrien2p/nestjs-dialogflow
* https://github.com/beeman/nest-angular-nx
* https://github.com/cgatian/customer-portal
* http://blog.exceptionfound.com/index.php/2018/06/07/nestjs-basic-auth-and-sessions/
- Awesome Nest
- https://github.com/juliandavidmr/awesome-nest
- ChatBot
- https://github.com/adrien2p/nestjs-dialogflow
- https://github.com/beeman/nest-angular-nx
- https://github.com/cgatian/customer-portal
- http://blog.exceptionfound.com/index.php/2018/06/07/nestjs-basic-auth-and-sessions/

0 comments on commit 7480338

Please sign in to comment.