This project uses NestJS, GraphQL, and MongoDB. This project implements user authentication. It will be easy to add other GraphQL schemas following the same structure. User auth is implemented in this project because it is one of the hardest and most common things to create for an API. The intent of this project is to provide an example of how to integrate all of these technologies together that are in the NestJS documentation (NestJS, GraphQL, MongoDB, Mongoose, Passport, JWT, DotEnv, Joi, Jest) into a working backend. If you recognize an anti-pattern or a better way to do something, please post an issue. It is challenging not to repeat the structure of the models in the GraphQL schema, Mongo schema, and Typescript interfaces. The goal is to have one truth point for the models and extend that data when more data is needed. With NestJS 6.0.0 a code first approach was introduced. This project uses the schema first approach to be language agnostic.

Features

  • Create a development.env file
  • The database stores a unique lowercase value for both username and email
  • username is the primary field to identify a user in a request
  • Add a user via the graphql playground or a frontend
  • The UsersService update method will update any fields which are valid and not duplicates
  • Both unique properties username and email can be changed

Project Samples

Project Activity

See All Activity >

Categories

User Management

License

MIT License

Follow nest-user-auth

nest-user-auth Web Site

You Might Also Like
Our Free Plans just got better! | Auth0 by Okta Icon
Our Free Plans just got better! | Auth0 by Okta

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your secuirty. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of nest-user-auth!

Additional Project Details

Programming Language

TypeScript

Related Categories

TypeScript User Management System

Registered

2023-03-30