Note: Documentation Still In Progress...
This is an API for a ticketing system that allows users to create, view, and manage tickets.
- Node.js
- TypeScript
- Express
- MySQL
- Sequelize
- sequelize-typescript
- bcrypt
- crypto
- jsonwebtoken
- passport
- passport-jwt
To run this API on your local machine, you will need to have Node.js and MySQL installed. Once you have these installed, follow these steps:
-
Clone this repository to your local machine.
-
Open a terminal and navigate to the project directory.
-
Run
npm install
to install the required dependencies. -
Set up your environment variables. Create a
dbConfig.ts
file in the src/config directory of the project and add the following code:var dbConfig = { HOST: 'localhost', USER: 'root', PASSWORD: '[password]', DB: '[Database Name]', DIALECT: 'mysql', pool: { max: 5, min: 0, aquire: 30000, idle: 10000 } }; export default dbConfig;
-
Run
npm start
to start the server. -
The API will now be available at
http://localhost:8080
.
The following features are available:
Get a list of tickets.
status
: Filter by ticket status (optional). Possible values:open
,closed
.priority
: Filter by ticket priority (optional). Possible values:low
,medium
,high
.
Get the details of a specific ticket.
id
: The ID of the ticket.
Create a new ticket.
title
: The title of the ticket.description
: The description of the ticket.priority
: The priority of the ticket. Possible values:low
,medium
,high
.status
: The status of the ticket. Possible values:open
,closed
.
Update the status or priority of a ticket.
id
: The ID of the ticket.
priority
(optional): The new priority of the ticket. Possible values:low
,medium
,high
.status
(optional): The new status of the ticket. Possible values:open
,closed
.
Delete a ticket.
id
: The ID of the ticket.
This API uses standard HTTP status codes to indicate success or failure of requests. In case of an error, a JSON response with the following format will be returned:
{
"error": {
"code": <HTTP status code>,
"message": "<error message>"
}
}
This API uses Jest for testing. To run the tests, run npm test
in the terminal.
Contributions are welcome! If you find a bug or have a feature request, please open an issue on this repository.
This project is licensed under the MIT License - see the LICENSE file for details.