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.
-
Clone the repository:
https://github.com/CharudattaGhute/Ticket_raiser_managment.git cd your-repo-name
-
Install dependencies:
npm install express
-
Create a
.env
file in the root directory and add your MongoDB URI:MONGODB_URI=mongodb+srv://<username>:<password>@cluster0.prqkren.mongodb.net/appoinment
-
Start the server:
npm start
-
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" }
- URL:
-
Get All Users
- URL:
GET /api/getalluser
- URL:
-
Delete User
- URL:
DELETE /api/deleteuser/:id
- URL:
-
Update User
- URL:
PUT /api/updateuser/:id
- Request Body:
{ "designation": "Admin" }
- URL:
-
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" }
- URL:
-
Get All Tickets
- URL:
GET /api/getallticket
- URL:
-
Delete Ticket
- URL:
DELETE /api/deleteticket/:id
- URL:
-
Update Ticket
- URL:
PUT /api/updateticket/:id
- Request Body:
{ "status": "Accepted" }
- URL:
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.
This project is licensed under the MIT License.