Skip to content

An eCommerce ratings & reviews microservice module.

Notifications You must be signed in to change notification settings

homeland-market/reviews

Repository files navigation

Homeland Market: Ratings & Reviews

An ecommerce ratings and reviews module that features filtering, sorting, searching, voting, and a handy customer photo carousel!

Table of Contents

  1. Overview
  2. Features
  3. Built With
  4. Getting Started
  5. Contributing
  6. Contact
  7. Acknowledgements
  8. Related Projects
  9. License

Overview

This interactive ratings and reviews module is the ideal solution for displaying customer's feedback. The application has a strong focus on user interaction, allowing reviews to be filtered, sorted, and searched in a variety of different ways (see Features for more info). The component is fully responsive right out of the box, allowing for seamless integration across all media platforms. For further information on how to get started, please see the conveniently named Getting Started section below.

Features

Preload Animation

The component features a preloading state animation that runs until all review data has been successfully fetched from the database. This feature is to reduce snapping/popping of information when there are longer than expected query times on the page's initial load.


Star Score Filtering

You can filter reviews by different star ratings - 1 star, 2 star, 3 star, 4! (and 5). When a specific star is clicked, the screen automatically scrolls to the review body section where the corresponding reviews are displayed. You can clear the filter one of four ways: clicking the 'clear' button just above the body of reviews, selecting another star to filter from the list, clicking on the original star rating to toggle off the selection, or filtering reviews by text search. Filtered reviews can also be sorted while still maintaining the filtering condition - see Review Sorting for more information.


Customer Photo Carousel

The Customer Photo Carousel syncs its images with reviews that included a photo. The carousel makes use of React.createRef() to calculate the current container size to snap images into place. If the screen size is altered mid-transition, the component will recalculate the width and snap the next image back into place: images will always display no matter the user's screen size. If there are no customer photos associated with any reviews, the carousel is automatically hidden; if there aren't enough images to require a scrolling effect, the scroll buttons are hidden.


Review Sorting

You can sort reviews by the following criteria: Most Relevant, Includes Customer Photos, Most Recent, and Most Helpful. Sort criteria remain persistent even through review filtering. For example, if you sorted all reviews by Most Helpful then filtered the reviews by a Text Filtering, the newly filtered reviews list would still be sorted by Most Helpful. By default, reviews are sorted using the Most Relevant method.


Review Upvoting

Each review has it's own Helpful Button. Users can upvote the reviews they find helpful by clicking on the corresponding button. When a Helpful Button is clicked (toggled on), a PUT request gets sent to the server, and the review data inside the database gets updated. If the button is toggled off, another PUT request is sent to update the database. At present, users can only toggle each review on or off: there is no downvoting option. If the page is refreshed, the new helpful total will display.


Text Filtering & Highlighting

By typing a word or phrase into the search bar and pressing enter - or clicking on the search button - reviews can be filtered by that word or phrase. Only the review's comment text is searched - you can not filter by reviewer name or location. Words and phrases are not case sensitive; white space is removed from search words/phrases automatically.


Buyer Verification

Each review displays a handy tooltip that verifies the review was left by an authentic buyer. Hover over the text to display the tooltip message. There is no way to add reviews via the display module: the module's designed so that reviews are left by email requests or via a separate link.


Built With

This Reviews & Ratings module is built with the following technologies:

Getting Started

Prerequisites

Node.js and npm are required in order to quickly get up and running with this project. Lukily, npm is distributed with Node.js - which means that when you download Node.js, you automatically get npm installed on your computer! You can install Node.js HERE.

MySQL is the database of choice for this project. To install and set up MySQL, please follow the instructions found HERE

Installation

  1. Rename the following files inside server/database/
RENAME-ME-TO-CONFIG.js = config.js
RENAME-ME-TO-CONNECTION.js = connection.js
  1. Inside of these files, add your MySQL username and password.
user: 'USERNAME-HERE',
password: 'PASSWORD-HERE',
  1. Run the following commands from the command line inside the root folder:
npm install
npm run bundle
npm run build

Please note: The current seeding script found inside server/database/databaseSeeder.js will create a brand new database everytime the npm run build script is run, or changes are made and saved while nodemon is running. To change this, you need to modifiy the db.connectAsync() function inside server/database/index.js.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contact

Website - mattwigg

Professional - LinkedIn

Project Link: https://github.com/homeland-market/reviews/

Acknowledgements

Related Projects

License

Distributed under the MIT License.