AshishKohad27 / PayPal_BackEnd

Home Page:https://chocolate-abalone-gear.cyclic.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PayPal

Project Links
Frontend Deploy:- https://pay-pal-front-end.vercel.app/login
Frontend Git:- https://github.com/AshishKohad27/PayPal_FrontEnd
Backend :- https://chocolate-abalone-gear.cyclic.app/

Build with


Data Stored in MongoDB


Steps of starting Backend

  1. Run npm run start on terminal
  2. You will get URL like this http://localhost:7878 server running on port number 7878

Methods

1. Auth

1.1 Signup

Signup :- http://localhost:7878/auth/signup

Email and password saved in the mongodb, password stored in hashed formate.

{
  "email": "demo@gmail.com",
  "password": "demo"
}
Method:"POST"
Payload: {
  "email": "demo@gmail.com",
  "password": "demo"
}
http://localhost:7878/auth/signup

1.2 Login

Login :- http://localhost:7878/auth/login

After giving right credential system provided two different token

  1. Access Token: which has expired time round 4 days
  2. Refresh Token: which has expired time round 7 days, by this token we can refresh or create new access token for our app.
{
  "email": "demo@gmail.com",
  "password": "demo"
}
Method:"POST"
Payload: {
  "email": "demo@gmail.com",
  "password": "demo"
}
http://localhost:7878/auth/login

1.3 Verify

Login :- http://localhost:7878/auth/verify

By this url user can get details from token

//accept body as token
const { token } = req.body;

// then with the help of jwt.verify getting all details under jwt token
const verification = jwt.verify(token, "XXXXXXXX_XX");
Method:"POST"
Payload: {
    "token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NDFkYjRlNTAzNGI0ZjUwMWQ0MTJhMjIiLCJlbWFpbCI6ImFzaGlzaGtvaGFkQGdtYWlsLmNvbSIsIm5hbWUiOiJBc2hpc2ggS29oYWQiLCJpYXQiOjE2Nzk2Njg2NzAsImV4cCI6MTY4MDAxNDI3MH0.zkKdB91j-dSVlHAnUpVQhe7OqSRh95KYHTZLehecMPU"
}
http://localhost:7878/auth/verify

2. Sprints

2.1 Get Sprint

- By this url user can get all Sprint

Method:"GET"
http://localhost:7878/sprint

2.2 Create Sprint

- By this url user can Create Data

Method:"POST"
Payload: {
    "endDate": "2023-03-26",
    "name": "Sprint 1",
    "startDate": "2023-03-20"
}
http://localhost:7878/sprint

2.3 Delete Sprint

- By this url user can Delete Data

Method:"DELETE"
http://localhost:7878/sprint/:SprintId

3. Tasks

3.1 Get Tasks

- By this url user can get all Tasks

Method:"GET"
http://localhost:7878/task

3.2 Create Task

- By this url user can Create Data

Method: "POST"
Payload: {
    "assignedBy": "xxxxxx",
    "assignedTo": "xxxxxx",
    "description": "Bug Report",
    "status": "done",
    "title": "bug Reort",
    "sprintId": "641df509ccd57033083bac81"
}

http://localhost:7878/task/

3.3 Edit Task

- By this url user can Edit Data

Method: "PATCH"
Payload:{
    "assignedBy": "xxxxxx",
    "assignedTo": "xxxxxx",
    "description": "Bug Report",
    "status": "done",
    "title": "bug Reort",
    "sprintId": "641df509ccd57033083bac81"
}
http://localhost:7878/task/:taskId

3.4 Delete Task

- By this url user can Delete Data

Method:"DELETE"
http://localhost:7878/sprint/:taskId

3.5 Filter Task

- By this url user can we can get 3 diffrenet arr base on particular sprint

Method: "GET"
Parameters:"?sprintId="
http://localhost:7878/sprint/filter?sprintId=""

3.6 Individual Task

- By this url user can get individual Task

Method: "GET"
Payload:{
    "userName": "xxxx xxxx"
}
http://localhost:7878/sprint/individual