Skip to content

JabezBrew/Customer_Feedback_Service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Customer Feedback Service πŸ›οΈπŸ’¬

A Spring Boot application for managing customer feedback for an e-commerce platform using MongoDB.

Description πŸ“

This service allows customers to submit and retrieve product feedback, helping businesses gather valuable insights about their products and services. The application provides a RESTful API for managing feedback data with features like pagination, filtering, and sorting.

Technologies Used πŸ› οΈ

  • Java 11
  • Spring Boot 3.0.2
  • MongoDB 5.0
  • Gradle 7.6
  • Docker
  • Lombok
  • Spring Data MongoDB

Prerequisites βš™οΈ

  • Java 11 or higher
  • Docker
  • MongoDB Compass (optional, for DB visualization)

Setup πŸš€

  1. Clone the repository:
git clone <repository-url>
  1. Pull MongoDB Docker image:
docker pull mongo:5
  1. Build the project:
./gradlew build
  1. Run the application:
./gradlew bootRun

API Endpoints πŸ”Œ

Create Feedback

POST /feedback

{
  "rating": <integer>,
  "feedback": <string, optional>,
  "customer": <string, optional>,
  "product": <string>,
  "vendor": <string>
}

Get Feedback by ID

GET /feedback/<id>

Get All Feedback (Paginated)

GET /feedback?page=<number>&perPage=<number>

Response Format πŸ“„

Single Feedback

{
  "id": "string",
  "rating": "integer",
  "feedback": "string | null",
  "customer": "string | null",
  "product": "string",
  "vendor": "string"
}

Paginated Response

{
  "total_documents": "long",
  "is_first_page": "boolean",
  "is_last_page": "boolean",
  "documents": [array of feedback objects]
}

Database Configuration πŸ’Ύ

The application uses MongoDB with the following default configuration:

spring.data.mongodb.host=localhost
spring.data.mongodb.port=27017
spring.data.mongodb.database=feedback_db

Testing πŸ§ͺ

Run the tests using:

./gradlew test

Project Structure πŸ“

  • src/main/java/feedbackservice/
    • Feedback.java - Entity class
    • FeedbackRepository.java - MongoDB repository
    • FeedbackController.java - REST endpoints
    • FeedbackService.java - Business logic
    • CustomPageResponse.java - Pagination response wrapper
    • FeedbackApplication.java - Main application class

Acknowledgments πŸ™

  • Built as part of the Hyperskill Java Backend Developer track
  • Uses Spring Boot framework
  • MongoDB for document storage

Contributing 🀝

Contributions are welcome! Please feel free to submit a Pull Request.

About

An API service to collect and manage feedback from customers on a platform.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages