A full-stack help desk ticketing system built with the MERN stack (MongoDB, Express.js, React, Node.js).
- User Authentication (Admin, Agent, Customer)
- Ticket Management
- Real-time Status Updates
- Role-based Access Control
- Dashboard Statistics
- Note System for Tickets
- Node.js (v14 or higher)
- MongoDB
- Git
- Clone the repository
git clone <repository-url>
cd helpdesk-app
- Install Backend Dependencies
cd backend
npm install
- Install Frontend Dependencies
cd frontend
npm install
Create a .env
file in the backend
directory:
PORT=5000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_super_secret_jwt_key_2024
ADMIN_CODE=ADMIN123
AGENT_CODE=AGENT123
Create a .env
file in the frontend
directory:
VITE_API_URL=http://localhost:5000/api
VITE_ADMIN_CODE=ADMIN123
VITE_AGENT_CODE=AGENT123
- Start the Backend Server
cd backend
npm run dev
The backend will run on http://localhost:5000
- Start the Frontend Development Server
cd frontend
npm run dev
The frontend will run on http://localhost:5173
- View all tickets
- Manage ticket status (Active, Pending, Closed)
- View dashboard statistics
- Add notes to tickets
- View non-closed tickets
- Update ticket status (Active, Pending, Review)
- Add notes to tickets
- Create tickets
- View own tickets
- Add notes to own tickets
- View ticket status
helpdesk-app/
├── backend/
│ ├── config/
│ ├── controllers/
│ ├── middleware/
│ ├── models/
│ ├── routes/
│ └── server.js
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ ├── context/
│ │ ├── pages/
│ │ └── App.jsx
│ └── index.html
└── README.md
- POST
/api/auth/register
- Register new user - POST
/api/auth/login
- User login
- GET
/api/tickets/all
- Get all tickets (Admin/Agent) - GET
/api/tickets/my
- Get user's tickets - POST
/api/tickets
- Create new ticket - PATCH
/api/tickets/:ticketId/status
- Update ticket status - POST
/api/tickets/:ticketId/notes
- Add note to ticket
- Frontend: React, Vite, TailwindCSS
- Backend: Node.js, Express.js
- Database: MongoDB
- Authentication: JWT
- State Management: React Context
-
The backend uses MongoDB for data persistence. Make sure MongoDB is running locally or update the MONGODB_URI in .env to point to your MongoDB instance.
-
JWT is used for authentication. The JWT_SECRET in the backend .env file should be kept secure.
-
CORS is configured to allow requests from the frontend development server (http://localhost:5173).
-
The frontend uses Vite for development and building. The development server includes hot module replacement.
-
MongoDB Connection Error
- Verify MongoDB is running
- Check MONGODB_URI in backend .env
-
CORS Error
- Ensure frontend URL matches CORS configuration in backend
- Check if backend server is running
-
Authentication Issues
- Verify JWT_SECRET is properly set
- Check if token is being sent in requests
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
This project is licensed under the MIT License.