This project is a customer support API built with Spring Boot. The API allows the creation, reading, updating, and deletion of customer support tickets.
- Java 17 or higher
- Maven 3.8.1 or higher
- PostgreSQL 13 or higher
-
Clone the repository:
git clone https://github.com/your-username/customer-support-api.git cd customer-support-api
-
Set up the PostgreSQL database:
CREATE DATABASE customer_support; CREATE USER user WITH ENCRYPTED PASSWORD 'password'; GRANT ALL PRIVILEGES ON DATABASE customer_support TO user;
-
Configure the
application.properties
file:spring.datasource.url=jdbc:postgresql://localhost:5432/customer_support spring.datasource.username=user spring.datasource.password=password spring.jpa.hibernate.ddl-auto=update
-
Build and run the project:
mvn clean install mvn spring-boot:run
- POST /auth/login
- Description: Authenticates a user and returns a JWT token.
- Request Body:
{ "username": "string", "password": "string" }
- Response Body:
{ "token": "string" }
-
GET /tickets
- Description: Returns a list of all tickets.
- Response Body:
[ { "id": "integer", "title": "string", "description": "string", "status": "string", "createdAt": "datetime", "updatedAt": "datetime" } ]
-
GET /tickets/{id}
- Description: Returns a specific ticket by ID.
- Response Body:
{ "id": "integer", "title": "string", "description": "string", "status": "string", "createdAt": "datetime", "updatedAt": "datetime" }
-
POST /tickets
- Description: Creates a new ticket.
- Request Body:
{ "title": "string", "description": "string" }
- Response Body:
{ "id": "integer", "title": "string", "description": "string", "status": "string", "createdAt": "datetime", "updatedAt": "datetime" }
-
PUT /tickets/{id}
- Description: Updates an existing ticket.
- Request Body:
{ "title": "string", "description": "string", "status": "string" }
- Response Body:
{ "id": "integer", "title": "string", "description": "string", "status": "string", "createdAt": "datetime", "updatedAt": "datetime" }
-
DELETE /tickets/{id}
- Description: Deletes a ticket by ID.
- Response Body:
{ "message": "Ticket deleted successfully" }
- Fork the project.
- Create a new branch:
git checkout -b feature/new-feature
- Make your changes and commit:
git commit -m 'Add new feature'
- Push to the remote repository:
git push origin feature/new-feature
- Open a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for more details.