The Ticket Management System is designed to streamline how teams handle support tickets and internal requests. It provides a simple yet powerful platform where users can create, view, update, and delete tickets — all while maintaining secure authentication.
The backend is built with Node.js, Express, and a connected Mongo database.
It exposes endpoints for:
- User Authentication: Register and login securely
- User Profile Management: Fetch current or specific user data
- Ticket Management: Create, view, update, and delete support tickets
The API follows RESTful principles and uses middleware for authentication, validation, and error handling.
- Runtime: Node.js (Express)
- Database: MongoDB / Mongoose
- Authentication: JWT (JSON Web Tokens)
- Security: bcrypt, helmet, cors
- Environment Management: dotenv
backend/
├── controllers/
│ ├── authController.js
│ ├── userController.js
│ └── ticketController.js
├── middleware/
│ └── authMiddleware.js
├── models/
│ ├── User.js
│ └── Ticket.js
├── routes/
│ ├── authRoutes.js
│ ├── userRoutes.js
│ └── ticketRoutes.js
├── config/
│ └── db.js
├── server.js
└── package.jsongit clone https://github.com/ObiFaith/node-ticket-app.git
cd ticket-management-backendnpm installCreate a .env file in the project root:
PORT=5000
MONGO_URI=your_database_connection_string
JWT_SECRET=your_jwt_secret_keyAdjust variable names if using SQL or another ORM like
Sequelize.
npm run devThe API will be available at:
http://localhost:5000/api
| Method | Endpoint | Description |
|---|---|---|
| POST | /login |
Log in user and return JWT |
| POST | /register |
Register a new user |
| Method | Endpoint | Description |
|---|---|---|
| GET | /me |
Get the currently authenticated user |
| GET | /:id |
Get user by ID |
| Method | Endpoint | Description Auth Required |
|---|---|---|
| GET | / |
Get all tickets |
| POST | / |
Create a new ticket |
| GET | /:id |
Get a single ticket by ID |
| PATCH | /:id |
Update an existing ticket |
| DELETE | /:id |
Delete a ticket |
- AuthenticatedUser: Protects private routes using JWT
- Error Handler: Catches and formats server errors
- Validator: Validates user and ticket input
Use Postman or cURL to test the routes.
This project is licensed under the MIT License.