Skip to content

This project is a REST API for managing users and tickets. It is built using Node.js, Express, and MongoDB. The API allows you to create, read, update, and delete users and tickets.

Notifications You must be signed in to change notification settings

CharudattaGhute/Ticket_raiser_managment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 

Repository files navigation

User and Ticket Management APi

This project is a REST API for managing users and tickets. It is built using Node.js, Express, and MongoDB. The API allows you to create, read, update, and delete users and tickets.

Prerequisites

Installation

  1. Clone the repository:

    https://github.com/CharudattaGhute/Ticket_raiser_managment.git
    cd your-repo-name
  2. Install dependencies:

    npm install express
  3. Create a .env file in the root directory and add your MongoDB URI:

        MONGODB_URI=mongodb+srv://<username>:<password>@cluster0.prqkren.mongodb.net/appoinment
  4. Start the server:

    npm start

API Endpoints

User Endpoints

  • Add User

    • URL: POST /api/adduser
    • Request Body:
      {
        "username": "Charudatta Ghute",
        "user_email": "ghutecharudatta@gmail.com",
        "mobile": 9511225460,
        "gender": "male",
        "age": 21,
        "designation": "user",
        "type": "login credential problem",
        "password": "charu@123",
        "createdBy": "charudatta",
        "modifiedBy": "admin",
        "createdAt": "2024-12-11T18:30:00.000+00:00",
        "modifiedAt": "2024-12-11T18:30:00.000+00:00"
      }
  • Get All Users

    • URL: GET /api/getalluser
  • Delete User

    • URL: DELETE /api/deleteuser/:id
  • Update User

    • URL: PUT /api/updateuser/:id
    • Request Body:
      {
        "designation": "Admin"
      }

Ticket Endpoints

  • Add Ticket

    • URL: POST /api/addticket
    • Request Body:
      {
        "ticketType": "login credential problem",
        "status": "Pending",
        "title": "administrator error",
        "description": "technical issue",
        "dueDate": "2024-07-19T18:30:00.000+00:00",
        "allocatedId": "123abdrt5",
        "remarks": "ongoing",
        "createdBy": "Pratik Gaikwad",
        "modifiedBy": "Suraj Suruwanshi",
        "createdAt": "2024-07-19T18:30:00.000+00:00",
        "modifiedAt": "2024-07-20T18:30:00.000+00:00"
      }
  • Get All Tickets

    • URL: GET /api/getallticket
  • Delete Ticket

    • URL: DELETE /api/deleteticket/:id
  • Update Ticket

    • URL: PUT /api/updateticket/:id
    • Request Body:
      {
        "status": "Accepted"
      }

Error Handling

The API returns appropriate HTTP status codes and error messages for various error scenarios, such as validation errors, resource not found, and internal server errors.

License

This project is licensed under the MIT License.

About

This project is a REST API for managing users and tickets. It is built using Node.js, Express, and MongoDB. The API allows you to create, read, update, and delete users and tickets.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published