Starter template for NestJS ๐Ÿ˜ป includes GraphQL with Prisma Client, Passport-JWT authentication, Swagger Api and Docker

Overview

Instructions

Starter template for ๐Ÿ˜ป NestJS and Prisma.

Checkout NestJS Prisma Schematics to automatically add Prisma support to your Nest application.

Version

Branch  Nest Prisma  Graphql
main v8 v2 Code-first
nest-7 v7 v2 Code-first
nest-6-prisma2-code-first v6 v2-preview Code-first
nest-6-code-first v6 v1 Code-first
nest-6-sdl-first v6 v1 SDL First
nest-5 v5 v1 SDL First

Features

Overview

Prisma Setup

1. Install Dependencies

Install Nestjs CLI to start and generate CRUD resources

npm i -g @nestjs/cli

Install the dependencies for the Nest application:

npm install

2. PostgreSQL with Docker

Setup a development PostgreSQL with Docker. Copy .env.example and rename to .env - cp .env.example .env - which sets the required environments for PostgreSQL such as POSTGRES_USER, POSTGRES_PASSWORD and POSTGRES_DB. Update the variables as you wish and select a strong password.

Start the PostgreSQL database

docker-compose -f docker-compose.db.yml up -d
# or
npm run docker:db

3. Prisma Migrate

Prisma Migrate is used to manage the schema and migration of the database. Prisma datasource requires an environment variable DATABASE_URL for the connection to the PostgreSQL database. Prisma reads the DATABASE_URL from the root .env file.

Use Prisma Migrate in your development environment to

  1. Creates migration.sql file
  2. Updates Database Schema
  3. Generates Prisma Client
npx prisma migrate dev
# or
npm run migrate:dev

If you like to customize your migration.sql file run the following command. After making your customizations run npx prisma migrate dev to apply it.

npx prisma migrate dev --create-only
# or
npm run migrate:dev:create

If you are happy with your database changes you want to deploy those changes to your production database. Use prisma migrate deploy to apply all pending migrations, can also be used in CI/CD pipelines as it works without prompts.

npx prisma migrate deploy
# or
npm run migrate:deploy

4. Prisma: Prisma Client JS

Prisma Client JS is a type-safe database client auto-generated based on the data model.

Generate Prisma Client JS by running

Note: Every time you update schema.prisma re-generate Prisma Client JS

npx prisma generate
# or
npm run prisma:generate

5. Seed the database data with this script

Execute the script with this command:

npm run seed

6. Start NestJS Server

Run Nest Server in Development mode:

npm run start

# watch mode
npm run start:dev

Run Nest Server in Production mode:

npm run start:prod

GraphQL Playground for the NestJS Server is available here: http://localhost:3000/graphql

โฌ† back to top

GraphQL Playground

Open up the example GraphQL queries and copy them to the GraphQL Playground. Some queries and mutations are secured by an auth guard. You have to acquire a JWT token from signup or login. Add the accessTokenas followed to HTTP HEADERS in the playground and replace YOURTOKEN here:

{
  "Authorization": "Bearer YOURTOKEN"
}

Rest Api

RESTful API documentation available with Swagger.

Docker

Nest server is a Node.js application and it is easily dockerized.

See the Dockerfile on how to build a Docker image of your Nest server.

Now to build a Docker image of your own Nest server simply run:

# give your docker image a name
docker build -t <your username>/nest-prisma-server .
# for example
docker build -t nest-prisma-server .

After Docker build your docker image you are ready to start up a docker container running the nest server:

docker run -d -t -p 3000:3000 --env-file .env nest-prisma-server

Now open up localhost:3000 to verify that your nest server is running.

When you run your NestJS application in a Docker container update your .env file

- DB_HOST=localhost
# replace with name of the database container
+ DB_HOST=postgres

# Prisma database connection
+ DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DB_HOST}:${DB_PORT}/${POSTGRES_DB}?schema=${DB_SCHEMA}&sslmode=prefer

If DATABASE_URL is missing in the root .env file, which is loaded into the Docker container, the NestJS application will exit with the following error:

(node:19) UnhandledPromiseRejectionWarning: Error: error: Environment variable not found: DATABASE_URL.
  -->  schema.prisma:3
   |
 2 |   provider = "postgresql"
 3 |   url      = env("DATABASE_URL")

Docker Compose

You can also setup a the database and Nest application with the docker-compose

# building new NestJS docker image
docker-compose build
# or
npm run docker:build

# start docker-compose
docker-compose up -d
# or
npm run docker

Schema Development

Update the Prisma schema prisma/schema.prisma and after that run the following two commands:

npx prisma generate
# or in watch mode
npx prisma generate --watch
# or
npm run prisma:generate
npm run prisma:generate:watch

โฌ† back to top

NestJS - Api Schema

The schema.graphql is generated with code first approach. The schema is generated from the models, the resolvers and the input classes.

You can use class-validator to validate your inputs and arguments.

Resolver

To implement the new query, a new resolver function needs to be added to users.resolver.ts.

@Query(returns => User)
async getUser(@Args() args): Promise<User> {
  return await this.prisma.client.user(args);
}

Restart the NestJS server and this time the Query to fetch a user should work.

โฌ† back to top

GraphQL Client

A GraphQL client is necessary to consume the GraphQL api provided by the NestJS Server.

Checkout Apollo a popular GraphQL client which offers several clients for React, Angular, Vue.js, Native iOS, Native Android and more.

Angular

Setup

To start using Apollo Angular simply run in an Angular and Ionic project:

ng add apollo-angular

HttpLink from apollo-angular requires the HttpClient. Therefore, you need to add the HttpClientModule to the AppModule:

imports: [BrowserModule,
    HttpClientModule,
    ...,
    GraphQLModule],

You can also add the GraphQLModule in the AppModule to make Apollo available in your Angular App.

You need to set the URL to the NestJS GraphQL Api. Open the file src/app/graphql.module.ts and update uri:

const uri = 'http://localhost:3000/graphql';

To use Apollo-Angular you can inject private apollo: Apollo into the constructor of a page, component or service.

โฌ† back to top

Queries

To execute a query you can use:

this.apollo.query({query: YOUR_QUERY});

# or

this.apollo.watchQuery({
  query: YOUR_QUERY
}).valueChanges;

Here is an example how to fetch your profile from the NestJS GraphQL Api:

const CurrentUserProfile = gql`
  query CurrentUserProfile {
    me {
      id
      email
      name
    }
  }
`;

@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})
export class HomePage implements OnInit {
  data: Observable<any>;

  constructor(private apollo: Apollo) {}

  ngOnInit() {
    this.data = this.apollo.watchQuery({
      query: CurrentUserProfile,
    }).valueChanges;
  }
}

Use the AsyncPipe and SelectPipe to unwrap the data Observable in the template:

<div *ngIf="data | async | select: 'me' as me">
  <p>Me id: {{me.id}}</p>
  <p>Me email: {{me.email}}</p>
  <p>Me name: {{me.name}}</p>
</div>

Or unwrap the data using RxJs.

This will end up in an GraphQL error because Me is protected by an @UseGuards(GqlAuthGuard) and requires an Bearer TOKEN. Please refer to the Authentication section.

โฌ† back to top

Mutations

To execute a mutation you can use:

this.apollo.mutate({
  mutation: YOUR_MUTATION,
});

Here is an example how to login into your profile using the login Mutation:

const Login = gql`
  mutation Login {
    login(email: "[email protected]", password: "pizzaHawaii") {
      token
      user {
        id
        email
        name
      }
    }
  }
`;

@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})
export class HomePage implements OnInit {
  data: Observable<any>;

  constructor(private apollo: Apollo) {}

  ngOnInit() {
    this.data = this.apollo.mutate({
      mutation: Login,
    });
  }
}

โฌ† back to top

Subscriptions

To execute a subscription you can use:

this.apollo.subscribe({
  query: YOUR_SUBSCRIPTION_QUERY,
});

โฌ† back to top

Authentication

To authenticate your requests you have to add your TOKEN you receive on signup and login mutation to each request which is protected by the @UseGuards(GqlAuthGuard).

Because the apollo client is using HttpClient under the hood you are able to simply use an Interceptor to add your token to the requests.

Create the following class:

import { Injectable } from '@angular/core';
import {
  HttpEvent,
  HttpInterceptor,
  HttpHandler,
  HttpRequest,
} from '@angular/common/http';
import { Observable } from 'rxjs';

@Injectable()
export class TokenInterceptor implements HttpInterceptor {
  constructor() {}

  intercept(
    req: HttpRequest<any>,
    next: HttpHandler
  ): Observable<HttpEvent<any>> {
    const token = 'YOUR_TOKEN'; // get from local storage
    if (token !== undefined) {
      req = req.clone({
        setHeaders: {
          Authorization: `Bearer ${token}`,
        },
      });
    }

    return next.handle(req);
  }
}

Add the Interceptor to the AppModule providers like this:

providers: [
    ...
    { provide: HTTP_INTERCEPTORS, useClass: TokenInterceptor, multi: true },
    ...
  ]

After you configured the Interceptor and retrieved the TOKEN from storage your request will succeed on resolvers with @UseGuards(GqlAuthGuard).

โฌ† back to top

Comments

Renovate configuration

:date: Schedule: At any time (no schedule defined).

:vertical_traffic_light: Automerge: Disabled due to failing status checks.

:recycle: Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

:no_bell: Ignore: Close this PR and you won't be reminded about this update again.


  • [ ] If you want to rebase/retry this PR, check this box

This PR has been generated by WhiteSource Renovate. View repository job log here.

opened by renovate[bot] 6
  • Maintain frontend in same repo without sharing dependencies

    Maintain frontend in same repo without sharing dependencies

    Hi,

    thanks a lot for this starter, really appreciate it!

    I'm trying to put this starter together with same frontend project in the same repo using yarn workspaces.

    My approach so far:

    • Move everything to apps/api/
    • Create package.json like this:
    {
       "private": true,
       "name": "example-monorepo",
       "workspaces": ["apps/api"],
       "scripts": {}
    }
    
    • Run yarn install
    • Run yarn workspace nestjs-prisma-client-starter start:dev

    That works for the starter. However, for my existing project with frontend included already I'm experiencing several issues (e.g. nest-cli-plugins not working, VSCode configuration getting tricky, ...). I haven't really found out why (maybe the hoisting is problem...) and it is difficult to debug (for me).

    I would assume having a frontend as well is kind of usual and I'm not the only one facing this problem ;-)

    What is the standard way to approach this challenge?

    I know, that Nestjs has some its own support for monorepos (https://docs.nestjs.com/cli/monorepo). However, this approach does not allow to have a different dependencies (package.json) etc. per app (which I would like to have to avoid dependency problems...).

    Is there some middle ground between keeping everything in separate repos and completely sharing all dependencies, that is proven and well established in the community?

    opened by some-user123 5
  • e2e tests: Undefined type error. Provide explicit type for the

    e2e tests: Undefined type error. Provide explicit type for the "user" of the "AuthResolver" class.

    Bug

    Steps to reproduce

    • fresh install the repository and follow the guide on readme (https://github.com/fivethree-team/nestjs-prisma-starter#prisma-setup)
    • run e2e tests

    Expected behaviour

    e2e tests passed

    Actual behaviour

    $ jest --config ./test/jest-e2e.json
     FAIL  test/app.resolver.e2e-spec.ts
      โ— AppResolver (e2e) โ€บ helloWorld (Query)
    
        Undefined type error. Make sure you are providing an explicit type for the "user" of the "AuthResolver" class.
    
          at TypeMetadataStorageHost.compileExternalFieldResolverMetadata (../node_modules/@nestjs/graphql/dist/schema-builder/storages/type-metadata.storage.js:256:23)
          at ../node_modules/@nestjs/graphql/dist/schema-builder/storages/type-metadata.storage.js:240:22
              at Array.forEach (<anonymous>)
          at TypeMetadataStorageHost.compileFieldResolverMetadata (../node_modules/@nestjs/graphql/dist/schema-builder/storages/type-metadata.storage.js:229:18)
          at TypeMetadataStorageHost.compile (../node_modules/@nestjs/graphql/dist/schema-builder/storages/type-metadata.storage.js:144:14)
          at GraphQLSchemaFactory.<anonymous> (../node_modules/@nestjs/graphql/dist/schema-builder/graphql-schema.factory.js:38:57)
          at ../node_modules/@nestjs/graphql/node_modules/tslib/tslib.js:114:75
          at Object.__awaiter (../node_modules/@nestjs/graphql/node_modules/tslib/tslib.js:110:16)
    
      โ— AppController (e2e) โ€บ /hello/:name (GET)
    
        Undefined type error. Make sure you are providing an explicit type for the "user" of the "AuthResolver" class.
    
    [...]
    

    How can I fix this? Thank you!

    opened by lparolari 5
  • Feature Request: Exception Handling

    Feature Request: Exception Handling

    This code involves 3 things: a. GraphQL support b. Nest JS c. Prisma All of them have their own built-in support for exceptions and errors.

    Can we write the Exception handling together? I'd write the basic code and expect that someone among you help take the code to a 'production-ready" state?

    opened by cloudcompute 4
  • MaxListenersExceededWarning

    MaxListenersExceededWarning

    If you create more than 10 modules in the providers of which "PrismaService" is located, the error "Possible EventEmitter memory leak detected." The more modules are added, the more error instances are displayed. Is there a way to fix this?

    ะกะฝะธะผะพะบ ัะบั€ะฐะฝะฐ 2021-04-10 ะฒ 07 33 29 ะกะฝะธะผะพะบ ัะบั€ะฐะฝะฐ 2021-04-10 ะฒ 07 32 27

    Error (node:15126) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 beforeExit listeners added to [process]. Use emitter.setMaxListeners() to increase limit (Usenode --trace-warnings ...to show where the warning was created) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 beforeExit listeners added to [process]. Use emitter.setMaxListeners() to increase limit at _addListener (events.js:390:17) at process.addListener (events.js:406:10) at process.once (events.js:437:8) at hookProcess (/Users/Rikka/iMac/Projects/apps/nestGQLError2/node_modules/@prisma/client/runtime/index.js:27586:13) at initHooks (/Users/Rikka/iMac/Projects/apps/nestGQLError2/node_modules/@prisma/client/runtime/index.js:27609:9) at new NodeEngine (/Users/Rikka/iMac/Projects/apps/nestGQLError2/node_modules/@prisma/client/runtime/index.js:26911:7) at PrismaService.getEngine (/Users/Rikka/iMac/Projects/apps/nestGQLError2/node_modules/@prisma/client/runtime/index.js:34057:16) at new NewPrismaClient (/Users/Rikka/iMac/Projects/apps/nestGQLError2/node_modules/@prisma/client/runtime/index.js:34030:29) at new PrismaService (/Users/Rikka/iMac/Projects/apps/nestGQLError2/dist/services/prisma.service.js:17:9) at Injector.instantiateClass (/Users/Rikka/iMac/Projects/apps/nestGQLError2/node_modules/@nestjs/core/injector/injector.js:286:19)

    opened by DennieMello 4
  • This line opens a new connection for every service that includes prisma.

    This line opens a new connection for every service that includes prisma.

    https://github.com/fivethree-team/nestjs-prisma-starter/blob/c029a2a52ef3c9f21572629ac9b298a0d8c25594/src/services/prisma.service.ts#L12

    I noticed at the start of the web server that it would take 5+ seconds and was taking longer and longer with every module I added to my project. It seems it tried to connect oninit for each service that uses this service. When I removed this line the project started under 1 second and Prisma has lazy loading connection that auto connects if no connection is established.

    I see this in other docs and am wondering why its setup this way if it tries to front-load so many connections?

    opened by raminnoodle 4
  • Add nest7 new decorator syntax

    Add nest7 new decorator syntax

    With old syntax nest throw error.

    I tried to write as written in the documentation of Custom route decorators like this:

    const request = ctx.switchToHttp().getRequest();
    return request.user;
    

    but i got request.user is undefined.

    So I find the user through the getNext().req

    opened by edbond88 4
  • what the purpose of schema.prisma file and the model file.?

    what the purpose of schema.prisma file and the model file.?

    i some confuse, could please explain

    1. in schema.prisma file what is the purpose of this file
    2. why we have the model file while we have defined table in schema.prisma already.

    thanks

    opened by skanel 3
  • Docker compose up error

    Docker compose up error "Could not find package.json"

    Hey there!

    I've been trying to run the project with docker by running: npm run docker or docker-compose -f docker-compose.yml up --build

    And it gives me an error which I can't find a solution to. The error is:

    > [email protected] start:prod
    nest-api    | > node dist/main
    nest-api    | 
    nest-api    | /node_modules/flaschenpost/dist/readPackageJson.js:16
    nest-api    |     throw new Error('Could not find package.json.');
    nest-api    |     ^
    nest-api    | 
    nest-api    | Error: Could not find package.json.
    nest-api    |     at readPackageJson (/node_modules/flaschenpost/dist/readPackageJson.js:16:11)
    nest-api    |     at Object.flaschenpost.initialize (/node_modules/flaschenpost/dist/flaschenpost.js:23:36)
    nest-api    |     at Object.<anonymous> (/node_modules/flaschenpost/dist/flaschenpost.js:111:14)
    nest-api    |     at Module._compile (node:internal/modules/cjs/loader:1126:14)
    nest-api    |     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
    nest-api    |     at Module.load (node:internal/modules/cjs/loader:1004:32)
    nest-api    |     at Function.Module._load (node:internal/modules/cjs/loader:839:12)
    nest-api    |     at Module.require (node:internal/modules/cjs/loader:1028:19)
    nest-api    |     at require (node:internal/modules/cjs/helpers:102:18)
    nest-api    |     at Object.<anonymous> (/node_modules/node-poeditor/lib/workers/request/httprequest.js:4:16)
    nest-api exited with code 1
    

    Any idea what I could do to fix this? It seems that the package.json is in copied in the Dockerfile, but when running npm run start:prod it does not find it.

    opened by nombrekeff 2
  • refactor: surround ports with single quotes

    refactor: surround ports with single quotes

    Description

    Surround ports with single quotes in docker-compose.yml because it is recommended that values containing colons be treated as strings in yaml.

    Additional Information

    https://docs.docker.com/compose/compose-file/#ports

    HOST:CONTAINER SHOULD always be specified as a (quoted) string, to avoid conflicts with yaml base-60 float.

    opened by sitogi 0
  • Add role guard and decorator to support RBAC

    Add role guard and decorator to support RBAC

    Add RolesGuard guard and and Roles decorator to support Role-Based Access Control.

    This is an example for users with role USER or ADMIN can call updateUser().

    
    @Resolver(() => User)
    @UseGuards(GqlAuthGuard)
    export class UsersResolver {
    
      // ...
    
    
      @Roles(Role.USER, Role.ADMIN)
      @UseGuards(GqlAuthGuard, RolesGuard)
      @Mutation(() => User)
      async updateUser(
        @UserEntity() user: User,
        @Args('data') newUserData: UpdateUserInput
      ) {
        return this.usersService.updateUser(user.id, newUserData);
      }
    
      // ...
    }
    
    
    opened by zlwu 0
  • Question: When to invoke refreshToken() endpoint from the client?

    Question: When to invoke refreshToken() endpoint from the client?

    I have a question relating to JWT, could you pl. answer?

    There is a mutation named, refreshToken() which is exposed as an endpoint. In the documentation, there is no mention about when to make a call to this endpoint? Over there, it is just stated that send the token in the Authorization header.

    Kindly make things clear by writing the generic code flow at client side. Is there any need to use a library like jwt-decode there?

    opened by cloudcompute 2
  • Feat/add bulljs

    Feat/add bulljs

    Change

    • Add Bull and Demo
    • Add Nestjs Logger 2 Prisma Middleware

    Why add

    I think it's essential to use message queues in a production environment, so I've added a usage of Bull and I'm using it myself in a production environment, if you feel the need to add it to the main branch then I'll refine the documentation section and the testing section.

    How to use

    yarn start:consumer:dev
    

    image

    opened by fuergaosi233 4
  • Unit tests coverage

    Unit tests coverage

    Sorry for bothering again.

    I was wondering if there is a way to make code coverage 100% with unit tests for this project. I don't know if this is possible but, it would be nice to have a good set of unit tests.

    Do you think that this is a good idea? I cannot image how to test something like the classes in pagination.ts as they are only graphql type definitions.

    But maybe, this is not a problem at all. I wish to discuss this with you.

    Now, code coverage is getting very low score:

    $ yarn test:cov
    yarn run v1.22.5
    $ jest --coverage
     PASS  src/controllers/app.controller.spec.ts
     PASS  src/common/scalars/date.scalar.spec.ts
     PASS  src/resolvers/app.resolver.spec.ts
     PASS  src/configs/config.spec.ts
    ---------------------------|---------|----------|---------|---------|-------------------
    File                       | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
    ---------------------------|---------|----------|---------|---------|-------------------
    All files                  |    8.94 |     2.44 |   14.63 |    8.12 |                   
     src                       |       0 |        0 |       0 |       0 |                   
      app.module.ts            |       0 |        0 |       0 |       0 | 1-41              
      main.ts                  |       0 |        0 |       0 |       0 | 1-38              
     src/common/order          |       0 |        0 |       0 |       0 |                   
      order-direction.ts       |       0 |        0 |       0 |       0 | 1-10              
      order.ts                 |       0 |      100 |       0 |       0 | 1-7               
     src/common/pagination     |       0 |      100 |       0 |       0 |                   
      page-info.model.ts       |       0 |      100 |     100 |       0 | 1-4               
      pagination.args.ts       |       0 |      100 |     100 |       0 | 1-4               
      pagination.ts            |       0 |      100 |       0 |       0 | 1-30              
     src/common/scalars        |   83.33 |       50 |      80 |      80 |                   
      date.scalar.ts           |   83.33 |       50 |      80 |      80 | 4,20              
     src/configs               |     100 |      100 |     100 |     100 |                   
      config.ts                |     100 |      100 |     100 |     100 |                   
     src/controllers           |     100 |      100 |     100 |     100 |                   
      app.controller.ts        |     100 |      100 |     100 |     100 |                   
     src/decorators            |       0 |      100 |       0 |       0 |                   
      user.decorator.ts        |       0 |      100 |       0 |       0 | 1-6               
     src/guards                |       0 |      100 |       0 |       0 |                   
      gql-auth.guard.ts        |       0 |      100 |       0 |       0 | 1-9               
     src/models                |       0 |        0 |       0 |       0 |                   
      auth.model.ts            |       0 |      100 |     100 |       0 | 1-6               
      model.model.ts           |       0 |      100 |       0 |       0 | 1-6               
      post.model.ts            |       0 |      100 |     100 |       0 | 1-6               
      token.model.ts           |       0 |      100 |     100 |       0 | 1-9               
      user.model.ts            |       0 |        0 |       0 |       0 | 1-28              
     src/models/args           |       0 |      100 |     100 |       0 |                   
      post-id.args.ts          |       0 |      100 |     100 |       0 | 1-7               
      user-id.args.ts          |       0 |      100 |     100 |       0 | 1-7               
     src/models/inputs         |       0 |        0 |       0 |       0 |                   
      post-order.input.ts      |       0 |        0 |       0 |       0 | 1-20              
     src/models/pagination     |       0 |      100 |     100 |       0 |                   
      post-connection.model.ts |       0 |      100 |     100 |       0 | 1-6               
     src/resolvers             |      80 |      100 |      50 |      75 |                   
      app.resolver.ts          |      80 |      100 |      50 |      75 | 5,9               
     src/resolvers/auth        |       0 |        0 |       0 |       0 |                   
      auth.module.ts           |       0 |      100 |       0 |       0 | 1-39              
      auth.resolver.ts         |       0 |      100 |       0 |       0 | 1-48              
      jwt.strategy.ts          |       0 |        0 |       0 |       0 | 2-26              
     src/resolvers/auth/dto    |       0 |      100 |     100 |       0 |                   
      login.input.ts           |       0 |      100 |     100 |       0 | 1-13              
      signup.input.ts          |       0 |      100 |     100 |       0 | 1-19              
     src/resolvers/post        |       0 |        0 |       0 |       0 |                   
      post.module.ts           |       0 |      100 |     100 |       0 | 1-8               
      post.resolver.ts         |       0 |        0 |       0 |       0 | 1-72              
     src/resolvers/user        |       0 |      100 |       0 |       0 |                   
      user.module.ts           |       0 |      100 |     100 |       0 | 1-10              
      user.resolver.ts         |       0 |      100 |       0 |       0 | 1-55              
     src/resolvers/user/dto    |       0 |      100 |     100 |       0 |                   
      change-password.input.ts |       0 |      100 |     100 |       0 | 1-14              
      update-user.input.ts     |       0 |      100 |     100 |       0 | 1-8               
     src/services              |       8 |        0 |   10.53 |    6.15 |                   
      app.service.ts           |     100 |      100 |     100 |     100 |                   
      auth.service.ts          |       0 |        0 |       0 |       0 | 1-100             
      password.service.ts      |       0 |        0 |       0 |       0 | 1-24              
      prisma.service.ts        |       0 |      100 |       0 |       0 | 1-15              
      user.service.ts          |       0 |        0 |       0 |       0 | 1-41              
    ---------------------------|---------|----------|---------|---------|-------------------
    
    Test Suites: 4 passed, 4 total
    Tests:       8 passed, 8 total
    Snapshots:   0 total
    Time:        4.629 s
    Ran all test suites.
    Done in 5.09s.
    
    opened by lparolari 0
  • Owner
    notiz.dev
    We love to share our experiences and findings working with Angular, NestJS, Web Components and more. ๐Ÿ‘€
    notiz.dev
    A starter template for Nest.js with MongoDB, GraphQL, JWT Auth, and more!

    A progressive Node.js framework for building efficient and scalable server-side applications. Description Nest framework TypeScript starter repository

    Michael Guay 19 Dec 25, 2022
    Simple CRUD application with Nestjs, Prisma and Docker with Postgres

    A progressive Node.js framework for building efficient and scalable server-side applications. Description Nest framework TypeScript starter repository

    Torr7s 5 Nov 6, 2022
    around nestjs, with prisma and some graphql lib,write less code,create power api

    ไป‹็ป ่ฟ™ๆ˜ฏไธ€ไธช prisma + nestjs + graphql ็š„้›†ๆˆ็คบไพ‹ ๅฏนไบŽๅผ€ๅ‘่€…ๆฅ่ฏด๏ผŒ็‰นๅˆซๆ˜ฏไฝฟ็”จ graphql ็š„ๆ—ถๅ€™๏ผŒๅช้œ€่ฆๅ†™้žๅธธๅฐ‘้‡็š„ไปฃ็ ๅณๅฏๅฎŒๆˆๆ•ฐๆฎ็š„ๅ„็งๆ“ไฝœ๏ผŒๅŒๆ—ถไนŸๆ”ฏๆŒๆŽฅๅฃ้€ไผ ใ€‚ ๅผ€ๅ‘&้ƒจ็ฝฒ ๆœฌๅœฐๅผ€ๅ‘ npm run start:dev swagger ๅœฐๅ€๏ผšhttp://loc

    ่Š‹ๅคด 26 Nov 24, 2022
    just a graphql example created by typescript + fastify + mikro-orm(postgresql) + mercurius(graphql adaptor) + type-graphql

    fastify-mikro-orm-mercurius-graphql-example A MikroORM boilerplate for GraphQL made with Fastify, Mercurius, Typescript using TypeGraphQL ?? Packages

    Vigen 10 Aug 28, 2022
    curl for GraphQL with autocomplete, subscriptions and GraphiQL. Also a dead-simple universal javascript GraphQL client.

    graphqurl graphqurl is a curl like CLI for GraphQL. It's features include: CLI for making GraphQL queries. It also provisions queries with autocomplet

    Hasura 3.2k Jan 3, 2023
    Nestjs + Typescript + GraphQL

    Nestjs Boilerplate: Nestjs + Typescript + GraphQL How to run Install dependencies yarn install Start server for development yarn start:dev Start ser

    doankhoi 3 Jun 27, 2022
    GraphQL Fastify Server is an implementation of GraphQL.

    GraphQL Fastify Server Installation Usage Using cache Middlewares Liveness & Readiness Contributing License Installation npm install --save graphql-fa

    Rui Silva 33 Dec 19, 2022
    API developed using NestJS, TypeORM, PgMem and concepts of Clean Architecture

    The Powerful NestJS A progressive Node.js framework for building efficient and scalable server-side applications. Clean Architecture The project has b

    Matheus Alexandre 20 Jan 2, 2023
    This is a repository that contains an simple NestJS API about Movies developed at Blue EdTech.

    NestJS Movies Technologies and requirements NestJS JavaScript TypeScript Prisma MySQL Project This is a repository that contains an simple NestJS API

    Isabella Nunes 2 Sep 28, 2021
    API Back-End de NodeJS com NestJS

    A progressive Node.js framework for building efficient and scalable server-side applications. Description Nest framework TypeScript starter repository

    Glaucio Daniel 5 May 29, 2022
    ๐Ÿฆ REST API for the NestJS + Next.js Todo application

    Create new NestJS project $ npm i -g @nestjs/cli $ npm i -g yarn $ nest new api-lesson # set strict true in tsconfig.json Install packages # install

    Udemy course repositories by Kazu T+ 21 Jan 4, 2023
    A template for WebSockets powered Cloudflare Worker project using graphql-ws

    ?? graphql-ws on Cloudflare Workers A template for WebSockets powered Cloudflare Worker project using graphql-ws. The worker serves the following rout

    Denis Badurina 26 Dec 18, 2022
    An in-depth implementation of Clean Architecture using NestJS and type-script

    Clean Architecture With NestJS Description It's been a while since my last article on how to implement clean architecture on Node.js applications, git

    null 297 Dec 28, 2022
    Nestjs boilerplate for beginners.

    Description Nest framework boilerplate. Installation $ npm install Running the docker for postgres or simply update env with running postgres values $

    Harris Gurung 18 Nov 30, 2022
    The nestjs cache module based on cache-manager & decorators ๐Ÿƒ

    A progressive Node.js framework for building efficient and scalable server-side applications. zirus-cache zirus-cache for Nest.JS - simple and modern

    Yakov Bobroff 4 May 9, 2022
    First NestJS project powered by TypeScript (Simple CRUD)

    First Nest TS (TypeScript) First NestJS project powered by TypeScript (Simple CRUD) Routes Get All GET http://localhost:3000/products/ Get one GET htt

    Max Base 3 Feb 22, 2022
    NestJS + MikroORM example repository for testing within transactional contexts. Achieve a much faster test suite.

    Description Nest NestJS + MikroORM example repository for testing within transactional contexts. Running tests in transactions will speedup your test

    Tolga Paksoy 5 Dec 20, 2022
    ObjectionJS on steroids for your nestjs application!

    Introduction Almost every application nowadays, requires a database to persist data. We have integrated ObjectionJS as our supported ORM. ObjectionJS

    Squareboat 7 Dec 15, 2022
    external eventbus module for @nestjs/cqrs

    A Cqrs External EventBus module for Nest framework (node.js) Now available: Redis-EventBus Installation with npm npm install --save nest-external-even

    H.John Choi 9 Dec 23, 2022