Giter VIP home page Giter VIP logo

unknown-auth-service's Introduction

UNKNOWN AUTH SERVICE ๐Ÿ‘ป

This microservice consists of user-related services. It is responsible for user authentication and authorization. It uses JWT for authentication and authorization. It also uses Prisma as ORM to interact with the database.

TECHNOLOGY USED: ๐Ÿ’ป

  • Express with Typescript

  • Postgres as Database

  • Prisma as ORM

STEPS TO RUN THE PROJECT: ๐Ÿƒ

  1. Copy the sample env file and modify according to your need.
  2. Run the command to install all dependencies: npm i
  3. Run the command to generate migration files: npx prisma generate
  4. Run the command to run the migrations: npx prisma migrate dev
  5. Run the command to start the server: npx run dev

API ENDPOINTS: ๐ŸŒ

  • GET: /ping

    {
      "response": {
      "message": "pong",
      }
    }
  • POST: /api/auth/signup

    {
      "body": {
        "name": "John Doe",
        "email": "[email protected]",
        "password": "password"
      }
    }

    {
      "response": {
        "message": "User created successfully",
        "payload": "jwt token"
      }
    }
  • POST: /api/auth/login

    {
      "body": {
          "email": "[email protected]",
          "password": "password",
      }
    }

    {
      "response": {
        "message": "User logged in successfully",
        "payload": "jwt token",
      }
    }
  • POST: /api/auth/validate

    {
      "body": {
          "token": "jwt token",
      }
    }

    {
      "response": {
        "message": "Token validated successfully",
        "payload": "new jwt token"
      }
    }
  • GET: /api/auth/user/:token

    {
      "message": "User data retrieved successfully",
      "payload": {
          "id": "user_id",
          "name": "John Doe",
          "email": "[email protected]"
      }
    }

LINKS: ๐Ÿ”—

  1. Postman Collection ๐Ÿš€
  2. Postman Environment Variable ๐Ÿ’พ

unknown-auth-service's People

Contributors

reekid2002 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.