Coder Social home page Coder Social logo

furrl-backend's Introduction

Furrl-Backend

Backend Task for Creation/Updation of Software requirement ticket

Set Up .env file

PORT=3000
MONGO_URI=mongodb://localhost:27017
SECRET_KEY=car

Install

npm install

Run the app

npm start

REST API

The REST API to the example app is described below.

Sign Up User

Request

POST /users/new

{
"email": "[email protected]",
"role": "admin",
"password": "123"
}

Response

{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImFAZ21haWwuY29tIiwidWlkIjoiUEUzcHRrcUZqIiwiaWF0IjoxNjY5OTA3NDAwfQ.RCwjOBlLVLDemBiPfm_cwSVCmagejbpckzlfrs47CMk"
}

Login User using Token

Request

POST /users/login

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

Response

{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImJAZ21haWwuY29tIiwidWlkIjoiM3NmdjhBYzA2IiwiaWF0IjoxNjY5OTA3NDU4fQ.Qtp1eiB6YYoqFTZIS3G2c5RjioBlvGC3BWEPBFEdw4w"
}

Create New Ticket

Request

POST /tickets/new

{
"title": "new",
"description": "asdasdasdasdasd"
}

Response

{
"status": "ToDo",
"_id": "6388c45fc6cc0cbad084ea95",
"uid": "N_KEkiywN",
"title": "new",
"description": "asdasdasdasdasd",
"createdAt": "2022-12-01T15:12:31.446Z",
"updatedAt": "2022-12-01T15:12:31.446Z",
"__v": 0
}

Assign Ticket to user

Request

POST /tickets/assign/:id

{
"assignedTo": "[email protected]"
}

Response

{
"Message": "Ticket successfully assigned to: [email protected]"
}

Mark Ticket as Done

Request

POST /tickets/done/:id

Response

{
"Messege": "6388b14a0bbdb90498e866b5 marked as Done"
}

Get list of All Tickets

Request

GET /tickets/

Response

[
{
    "_id": "6388b14a0bbdb90498e866b5",
    "status": "Done",
    "uid": "Uo5RiWXgZ",
    "title": "new",
    "description": "asdasdasdasdasd",
    "createdAt": "2022-12-01T13:51:06.229Z",
    "updatedAt": "2022-12-01T14:04:48.440Z",
    "__v": 0
}
]

Update Ticket

Request

PATCH /tickets/:id

{ "title": "old", "description": "neggar", "status": "InProgress" }

Response

{
"Messege": "Uo5RiWXgZ updated"
}

Get changed Thing

Request

DELETE /users/delete

Response

{
"Message": "User deleted Successfully"
}

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.