Skip to content

mustafaStakater/stakater-nordmart-review

 
 

Repository files navigation

stakater-nordmart-review

Spring Boot microservice for product review

Introduction

This project implements review functionality for the products; it provides CRUDS API for reviews.

User scenarios

Review Operations

  • Add: add a product review
  • Delete: delete a product review
  • Get: get all reviews for a given product

Dependencies

It requires following things to be installed:

  • Java: ^8.0.
  • Maven
  • Mongodb

Dummy Data

Some dummy data is loaded into the system which can be found here

Deployment strategy

Local machine

To run the application locally use the command given below:

mvn clean spring-boot:run

Kubernetes/OpenShift

Here is the step by step for local development with Tilt

APIs

  • /api/review/{productId}
    • Get a review for the given product id
  • /api/review/{productId}/{customerName}/{rating}/{text}
    • Add a review for the given product id
  • /api/review/{reviewId}
    • Delete a review for the given product id

Configuration

TODO

Test API

Get Review

curl localhost:8080/api/review/329199

Add a Review with Username: bumblebee, ProductId: 329199, Review Rating: 5 and Comment: great

curl -X POST 'localhost:8080/api/review/329199/bumblebee/5/great'

Delete a Review with reviewId: 6277b5c05c21830faf89a3bf

curl -X DELETE localhost:8080/api/review/6277b5c05c21830faf89a3bf

Alerts & Monitoring

A grafana dashboard is setup to display the number of reviews overtime. The trend can be viewed by adding more reviews using the add API Grafana Dashbaord

An Alertmanager rule is setup to send alerts if the total rating <= 2 goes beyond 5

DevSecOps scans

tooling:

  • trivy
  • rhacs
  • stackrox
  • checkov
  • sonar

About

Review API for products

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 83.0%
  • Starlark 9.9%
  • Dockerfile 3.6%
  • Python 3.4%
  • Shell 0.1%