Skip to content

SoumyaShinde/Kotlin-Feedback_API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📬 Feedback API

A simple Spring Boot-based RESTful API for collecting, managing, and retrieving user feedback. This project provides endpoints to create, read, update, delete, and search feedback records stored in a database.


🚀 Features

  • Create new feedback entries
  • Retrieve feedback with pagination
  • Get feedback by:
    • Specific date
    • Date range
    • Name or email
    • Keyword in message
    • Unique ID
  • Update existing feedback
  • Delete feedback
  • Count total feedback entries

📦 Technologies Used

  • Kotlin
  • Spring Boot (Web, Data JPA, Validation)
  • Hibernate + JPA
  • H2/MySQL/PostgreSQL (based on your configuration)
  • Jakarta Validation

🔧 Endpoints

📌 Create Feedback

POST /feedback

Request Body:

{
  "name": "John Doe",
  "email": "john@example.com",
  "message": "Great service!"
}

📌 Get Paginated Feedback

GET /feedback?page=0&size=5

Returns feedback in paginated format.


📌 Get Feedback by ID

GET /feedback/{id}

📌 Get Feedback by Date

GET /feedbackByDate?date=2025-07-30

📌 Get Feedback by Date Range

GET /feedbackByDateRange?startDate=2025-07-01&endDate=2025-07-30

📌 Search Feedback by Keyword

GET /searchMessageByKeyword?keyword=service

📌 Filter Feedback by Name or Email

GET /filterByNameOrEmail?email=john@example.com&name=John

All query parameters are optional — you can pass either or both.


📌 Update Feedback

PUT /feedback/{id}

Request Body:

{
  "name": "Updated Name",
  "email": "updated@example.com",
  "message": "Updated message"
}

📌 Delete Feedback

DELETE /feedback/{id}

📌 Count Total Feedback Entries

GET /feedback/count

⚙️ Setup & Run

Prerequisites

  • JDK 17+
  • Maven
  • Database (optional: defaults to H2 in-memory)

🗂️ Project Structure

  • controller/ – REST controllers
  • dto/ – Data Transfer Objects for request/response
  • model/ – JPA Entities
  • repository/ – Spring Data Repositories
  • service/ – Business Logic

📮 Sample cURL Request

curl -X POST http://localhost:8080/feedback \
  -H "Content-Type: application/json" \
  -d '{"name":"Soumya", "email":"soumya@example.com", "message":"This is helpful!"}'

🧪 Testing

You can test using:

  • Postman / Insomnia
  • cURL

🤝 Contribution

Feel free to fork and submit pull requests. Feedback and improvements are always welcome!


📃 License

MIT

About

A Kotlin + Spring Boot REST API that allows users to submit, retrieve, and manage feedback. This project demonstrates basic CRUD operations, in-memory data handling along with postgres persistence data handling, and endpoint creation using Kotlin.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages