Git Product home page Git Product logo

__take_home_backend's Introduction

Description

Take Home API - backend starter package

Used Tech's

  • Nest JS
  • Mongo
  • Bcrypt
  • JWT
  • GraphQL
  • Class Validator

Installation

$ yarn install

Running the app

# development watch mode
$ yarn start:dev

# production mode
$ yarn start:prod

Resolvers

SIGNIN - Resolver (GraphQl Query)

# For 1 day login access
query {
  signin(
    signin: {
      email: valid email address thats been registered
      password: correct password
      isRemembered: 1
    }
  ) {
    accessToken
    timeout
  }
}

# For 1 hour login access
query {
  signin(
    signin: {
      email: valid email address thats been registered
      password: correct password
      isRemembered: 0
    }
  ) {
    accessToken
    timeout
  }
}

# signin ok response
{
  "data": {
    "signin": {
      "accessToken": one unique generated token containing user email address as payload,
      "timeout": access timeout in utc
    }
  }
}

# signup error response
{
  "errors": [
    {
      "message": any string,
      "locations": array of {line: number, column: number},
      "path": array of string
      "extensions": any error as object
  ],
  "data": any
}

SIGNUP - Resolver (GraphQl Mutation)

# signup request
mutation {
  signup(
    signup: {
      email: valid email address thats never been registered before
      password: any password
    }
  ) {
    id
    email
  }
}

# signup ok response
{
  "data": {
    "signup": {
      "id": "61167993150a3881ad5e8e51",
      "email": "[email protected]"
    }
  }
}

# signup error response
{
  "errors": [
    {
      "message": any string,
      "locations": array of {line: number, column: number},
      "path": array of string
      "extensions": any error as object
  ],
  "data": any
}

Screenshots

  • Sign In Success sigin-success

  • Sign In (User not found) sigin-user-not-found

  • Sign In (Wrong Password) sigin-wrong-password

  • Sign Up Success sigup-success

  • Sign Up (Wrong Email) signup-wrong-email

  • Sign Up (Email Available) signup-email-available

  • Database Demo database-demo

License

Nest is MIT licensed.

__take_home_backend's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.