Skip to content

NeelakandanV/Url_Shortener-BE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Url-Shortener

This documentaion provides details about the Url Shortening and redirection, implemented using Node.js and Express. This API allows you to manage user SignUp , Login , Forgot Password , Reset Password and Delete calls.And also Create mini Urls of longer one,Updating originalUrl.The shortened Url will redirect you to the longer Url,the one you shortened.

Features :-

bcryptjs - For Password hashing,your data is safe and secure.

JWT - For Authorization in our website.

Note: Since I'm deployed the apis in render's free tier, The initial request is taking time, Please wait little longer for initial request

API Endpoints:-

For Users -

Login

Description : This method check whether the user with given EmailId and Password exists.If exists means it will allow the users to Login,else not.

Signup

Description : This method will allow new users to register if Email Id not registered already.

Verify User Link -Two step Authentication

Description : This method will send User verification link to the User Email after which the user can use url shortening service. This method generates a random string and stores in database for later verification,if the user exists
It allows sends email with reset link(Using Nodemailer) for the verified user

User Verification

Description : This method will verify the user credentials,only after the user can use the url shortening service. ( id - user Id , pin - randomly generated , token - JWT)

Delete User

Description : This method enables users to delete their account (give Email as id)

Forgot Password

Description : This method generates a random string and stores in database for later verification,if the user exists
It allows sends email with reset link(Using Nodemailer) for the verified user

Reset Password link

Description : This method verifies the random string in database and the link are same.Also verifies the JsonWebToken for the link validity. This link is valid for 5mins which will allow users to reset password only in that stipulated time.
( id - user Id , pin - randomly generated , token - JWT)

Reset Password

Description : After the verification is done in GET method.It will allow users to reset their Pasword and the same will be uploaded in database after deleting the randomly generated string which is used for verification purpose. ( id - user Id , pin - randomly generated , token - JWT)

API Endpoints:-

For Url shortening -

Create a Short Url

Description : This method allows users to get the short Url by providing the Original Url in req.body

Getting Url created by the Logged in User

Description - This will fetch all urls shortened by the Logged in user. ( id - user Id)

Updating Original Url

Description: This allow users to update the Original Url for the same mini url that already exists. ( id - Url Id)

Searching for Original Url Globally

Description: This will allow users to get the long urls already shortened by other users or service provider by providing the Original Url in req.body.

Mini Url Redirection to Original Url

Description-The short Url direct you to the destination Url. ( id - Url Id)

Delete a Url

Description: This method will allow users to delete the shortened Url. ( id - Url Id)