bit-shashank / ShareShop

An online network based shop

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ShareShop

An online network based shop api

Note

This project is under development

Key Features

  • Otp Verification using Twilio
  • MongoDB Atlas integration
  • JSON web tokens(JWT) for security

Basic Workflow for user registration

  • Step 1: User will register by providing there details

Endpoint :- /users/signup

Request :- POST

Example:-

{
    "name":"Shashank Sahu",
    "email":"shashankcs083@gmail.com",
    "username":"NoobCoder",
    "password":"admin1234",
    "mobileNo":"+916307717161"
}

Response:- On successful account creation user data will be saved and a json response will be sended.

  • Step 2: Request to send otp to the user

Endpoint:- /otp/sendOTP/:mobileNo

Request:- GET

Example:- /otp/sendOTP/+916307717161

  • Step 3: Verify the otp Endpoint:- /otp/verifyOTP Request:- POST Example:-
{
    "mobileNo":"+916307717161",
	"otp":"123456"
}

Response:- Appropriate JSON respond will be sended

  • Step 4:- User Login

Endpoint :- /users/login

Request:- POST

Example:-

{
    "username":"NoobCoder",
    "password":"admin1234"
}

Response:- A JSON WEB TOKEN(JWT) will be genrated and returned

Utility Endpoints for Developers

  • /otp/clear :- To delete all otp in database
  • /users/clear :- To delete all users
  • /users/:userId :- Returns the details of the user with this ID
  • /users:- Returns the list of all registered users
  • /otp :- returns the list of all otp in database

About

An online network based shop


Languages

Language:JavaScript 99.1%Language:Shell 0.9%