Skip to content

SupportDesk is a final year college project—a MERN stack ticketing system with role-based authentication, allowing users to create tickets and admins to manage, update, or delete them efficiently.

Notifications You must be signed in to change notification settings

jaluiovilash/supportdesk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

SupportDesk - A Ticketing System

Project Overview

SupportDesk is a full-stack ticketing system built using the MERN stack (MongoDB, Express.js, React.js, and Node.js). It allows users to create, track, and manage support tickets, while providing admin controls to resolve, update, and delete tickets.

The application follows role-based authentication, where users can register and create tickets, while administrators have the ability to manage tickets, change their status, and remove them if necessary.


Tech Stack

Frontend:

  • Remix (React framework for optimized server-side rendering and performance)
  • TailwindCSS (for styling and responsive UI)

Backend:

  • Node.js (runtime environment)
  • Express.js (framework for building API routes)
  • MongoDB & Mongoose (for database storage and schema management)
  • JWT Authentication (for secure user authentication)
  • Bcrypt.js (for password hashing)

Testing & Development Tools:

  • Postman (for API testing)
  • Nodemon (for live backend development)
  • Dotenv (for managing environment variables)

User Roles & Permissions

The system has two types of users:

1. Regular Users (Customers)

  • Sign up and log in to their account.
  • Create new support tickets describing their issues.
  • View the list of their submitted tickets with current statuses.
  • Update their own tickets with new information.
  • Close a ticket once their issue is resolved.

2. Admin Users (Support Staff)

  • Log in as an admin with special privileges.
  • View all tickets submitted by users in the system.
  • Update the status of any ticket (Open, In Progress, Resolved, Closed).
  • Delete tickets if necessary.
  • Manage user accounts (view details of registered users).

Project Setup & Installation

1. Clone the Repository

git clone https://github.com/jaluiovilash/supportdesk.git
cd supportdesk

2. Install Backend Dependencies

cd server
npm install

3. Install Frontend Dependencies

cd ../client
npm install

4. Set Up Environment Variables

Create a .env file inside the server directory and configure the following values:

PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret

5. Start the Backend Server

cd server
npm run dev

6. Start the Frontend Client

cd ../client
npm run dev

Your project should now be running at http://localhost:8080 (Frontend) and http://localhost:5000 (Backend API).


API Endpoints & Postman Test Cases

User Authentication

1. User Signup

  • Endpoint: POST /api/users/signup
  • Request Body (JSON):
{
  "name": "John Doe",
  "email": "[email protected]",
  "password": "password123"
}
  • Expected Response:
{
  "id": "user_id_here",
  "name": "John Doe",
  "email": "[email protected]",
  "token": "jwt_token_here"
}

2. User Login

  • Endpoint: POST /api/users/login
  • Request Body (JSON):
{
  "email": "[email protected]",
  "password": "password123"
}

Ticket Management

3. Create a Ticket

  • Endpoint: POST /api/tickets/create
  • Headers:
    • Authorization: Bearer <user_token>
  • Request Body (JSON):
{
  "title": "Login issue",
  "description": "Unable to log in with correct credentials"
}

4. View User’s Tickets

  • Endpoint: GET /api/tickets/user
  • Headers:
    • Authorization: Bearer <user_token>

5. View All Tickets (Admin Only)

  • Endpoint: GET /api/tickets/all
  • Headers:
    • Authorization: Bearer <admin_token>

6. Update Ticket Status (Admin Only)

  • Endpoint: PUT /api/tickets/update/:ticketId
  • Headers:
    • Authorization: Bearer <admin_token>
  • Request Body (JSON):
{
  "status": "resolved"
}

7. Delete a Ticket (Admin Only)

  • Endpoint: DELETE /api/tickets/delete/:ticketId
  • Headers:
    • Authorization: Bearer <admin_token>

How to Test the API using Postman

Testing as a Regular User

  1. Sign up using POST /api/users/signup.
  2. Log in using POST /api/users/login and copy the token.
  3. Create a ticket using POST /api/tickets/create (with token).
  4. Fetch your tickets using GET /api/tickets/user.

Testing as an Admin

  1. Log in with an admin account using POST /api/users/login.
  2. Fetch all tickets using GET /api/tickets/all (should list all user tickets).
  3. Update a ticket’s status using PUT /api/tickets/update/:ticketId.
  4. Delete a ticket using DELETE /api/tickets/delete/:ticketId.

Conclusion

SupportDesk provides an efficient ticket management system with clear role-based access control. Users can report issues, and administrators can efficiently manage and resolve tickets.

For further improvements, features like real-time notifications, chat support, and file attachments could be added in future updates.

About

SupportDesk is a final year college project—a MERN stack ticketing system with role-based authentication, allowing users to create tickets and admins to manage, update, or delete them efficiently.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published