/user-microservice-typescript

This is a microservice that represents the users of the application

Primary LanguageTypeScript

User MicroService

This is a microservice that represents the users of the application

Features and Technologies

This project uses Node.js v18.14.0, NestJS (with Express), Mongoose, MongoDB and GraphQL

  • Create user
  • Read/Find all users registered
  • Read/Find all user by id
  • Update user
  • Delete user
  • Use docker and docker-compose
  • Configure MongoDB
  • Use task file

Build Setup Docker

user@project:~$ task

Stop Docker

user@project:~$ task stop

enter n container server (GraphiQL is started at http://127.0.0.1:4000/graphql)

task app

run tests

user@project:~$ yarn test:e2e
user@project:~$ yarn test:cov

Query Examples

query FindAllUsers {
  allUsers {
    id
    isActive
    name
    email
    cpf
    birthDate
  }
}
query FindUserById($findUserByIdId: String!) {
  findUserById(id: $findUserByIdId) {
    user {
      id
      isActive
      name
      email
      cpf
      birthDate
    }
  }
}
mutation CreateUser($user: CreateUserInput!) {
  createUser(user: $user) {
    user {
      id
      isActive
      name
      email
      cpf
      birthDate
    }
  }
}