falalabella-team-browse / hackathon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Falabella Hackathon - Team Browse

Demo URLS

  1. Product Page = https://hackathon.rlab.app/12/929 (/author-id/product-id)
  2. Authors Page = https://hackathon.rlab.app/22 (/author-id)
  3. Admin Page = https://hackathon.rlab.app/admin
  4. Product Analytics Page = https://hackathon.rlab.app/analytics/1072?entityType=sku (/product-d)
  5. Author Analytics Page = https://hackathon.rlab.app/analytics/22?entityType=author (/author-id)

Development Setup

Requirements

  • Node v12
  • yarn (to install run npm i -g yarn)

Install dependencies

# Install global dependencies
yarn install -W

# Install plugin dependencies
yarn workspace plugin install

# Install server dependencies
yarn workspace server install

# Install website dependencies
yarn workspace website install

Build Plugin

yarn workspace plugin build

Run application

yarn workspace website watch
yarn workspace server watch

Website is accessible at localhost:1234

Server is accessible at localhost:3000

Install packages

# Install global packages
yarn add <list-of-package> -W

# Install server packages
yarn workspace server add <list-of-package>

# Install website packages
yarn workspace website add <list-of-package>

Project Structure

Server

src/plugin/config - Config to read env variables

src/routes - Routes Declaration

src/utils - Utilities

Website

components - UI components Declaration

context - React context Declaration

http - REST API Declarations

pages - Root pages

Load Review & Ratings Plugins

  1. Insert Script in HTML
<script src="<path-to-script>/rnr-script.js"></script>
  1. Load ratings module
<script>
	const element = document.getElementById('reviews');
	RNR.setHost('api-server-host');
	RNR.load(element, {
		userId: 'user-id',
		productId: 'product-id',
	});
</script>
  1. Load user module
<script>
	const element = document.getElementById('reviews');
	RNR.setHost('api-server-host');
	RNR.loadUserPanel(element, {
		userId: 'user-id',
	});
</script>

Devops

  1. Docker
  2. Docker-compose
  3. CICD : https://drone.io/
  4. helm deployment
  5. Server : https://contabo.com/

CICD Pipelines

CICD Pipelines.

Review n Ratings APIS

Swagger Documentation.

  1. Create new review

       (post) : 'api/v1/ratingsAndReviews'
       (reqBody) : { entityId, rating , title,  description, author}
    
    
  2. Edit review

       (post) : 'api/v1/ratingsAndReviews/edit'
       (reqBody) : { id, rating , title,  description}
    
    
  3. Mark review as Helpfull

       (post) : 'api/v1/ratingsAndReviews/flag'
       (reqBody) : { id, helpful_count}
    
    
  4. Remove/Delete review

       (delete) : 'api/v1/ratingsAndReviews/{reviewId}'
    
  5. Get Review with Id

       (get) : 'api/v1/ratingsAndReviews/{reviewId}'
    
    
  6. Get averageRatings

       (get) : 'api/v1/averageRatings/{entityid}'
    
    

About

License:MIT License


Languages

Language:JavaScript 86.7%Language:Java 10.4%Language:HTML 1.1%Language:Smarty 0.9%Language:CSS 0.6%Language:SCSS 0.1%Language:Dockerfile 0.1%Language:Shell 0.0%