Skip to content
Restaurants rating demo for Simplicité
JavaScript
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs/MDDocument
files
resources
scripts
.gitignore
README.md
RestaurantsDemo-openapi-3.0.2.yml
RestaurantsDemo-swagger-2.0.yml
RestaurantsDemo.xml
package.json
sonar-project.properties

README.md


RestaurantsDemo module definition

Introduction

This module is a very simple restaurant rating application demo inspired by a famous travelers' advisor service.

The frontend is a NodeRED® web application.

Import

To import this module:

  • Create a module named RestaurantsDemo
  • Set the settings as:
{
	"type": "git",
	"origin": {
		"uri": "https://github.com/simplicitesoftware/module-restaurants.git"
	}
}
  • Click on the Import module button

Configure backend

In order to have the frontend working the password for the webservices-only user rstfrontend must be simplicite.

This can be achieved by importing the following XML:

<?xml version="1.0" encoding="UTF-8"?>
<simplicite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.simplicite.fr/base" xsi:schemaLocation="http://www.simplicite.fr/base https://www.simplicite.io/resources/schemas/base.xsd">
<object>
	<name>UserPwd</name>
	<action>update</action>
	<data>
		<usr_login_read>rstfrontend</usr_login_read>
		<usr_password>simplicite</usr_password>
	</data>
</object>
</simplicite>

Load dataConfigure frontend

Install NodeRED®.

Start it with your Google API key set as a environment variable: GOOGLE_API_KEY=_myapikey_ node-red

In the NodeRED flow editor add the following nodes to the nodes palette (in the main menu choose the Manage palette option):

  • Simplicité nodes: node-red-contrib-simplicite
  • Sentiment analysis nodes: node-red-node-sentiment
  • Watson nodes: node-red-node-watson

Import the flows available in the RST_NODERED_NODES resource of the module.

Configure the config node with your instance settings.

RstComments business object definition

Customer comments on a restaurant. Includes:

  • an quantified evaluation
  • free text comments

Fields

Name Type Required Updatable Personal Description
rstCmtDateTime datetime yes* Date and time
rstCmtEmail char(100) yes yes Customer's name
rstCmtRstId link to RstRestaurant id yes* yes Restaurant
Ref. rstCmtRstId.rstRstName char(100) Name
Ref. rstCmtRstId.rstRstAddress char(255) Address
Ref. rstCmtRstId.rstRstState enum(2) using RST_STATES list State (e.g. NY)
rstCmtEval int(1) using RST_EVAL list yes yes Evaluation
rstCmtSentiment int(2) yes Sentiment score
rstCmtComments text(4000) yes Free text comments in native language
rstCmtCommentsInEnglish text(4000) Free text comments translated in english
rstCmtTones text(4000) yes Watson tones
rstCmtVisible boolean yes Visible?

Lists

  • RST_STATES
    • AL Alabama
    • AK Alaska
    • AZ Arizona
    • AR Arkansas
    • CA California
    • CO Colorado
    • CT Connecticut
    • DE Delaware
    • DC District of Columbia
    • FL Florida
    • GA Georgia
    • HI Hawaii
    • ID Idaho
    • IL Illinois
    • IN Indiana
    • IA Iowa
    • KS Kansas
    • KY Kentucky
    • LA Louisiana
    • ME Maine
    • MD Maryland
    • MA Massachusetts
    • MI Michigan
    • MN Minnesota
    • MS Mississippi
    • MO Missouri
    • MT Montana
    • NE Nebraska
    • NV Nevada
    • NH New Hampshire
    • NJ New Jersey
    • NM New Mexico
    • NY New York
    • NC North Carolina
    • ND North Dakota
    • OH Ohio
    • OK Oklahoma
    • OR Oregon
    • PA Pennsylvania
    • RI Rhode Island
    • SC South Carolina
    • SD South Dakota
    • TN Tennessee
    • TX Texas
    • UT Utah
    • VT Vermont
    • VA Virginia
    • WA Washington
    • WV West Virginia
    • WI Wisconsin
    • WY Wyoming

RstLocation business object definition

Location

Fields

Name Type Required Updatable Personal Description
rstLocName char(100) yes* yes Location name
rstLocState enum(2) using RST_STATES list yes* yes Location state
rstLocDescription html(4000) yes Location description
rstLocCoordinates geocoords yes yes Location coordinates
rstLocExtent int(10) yes yes Location extent (miles)

Lists

  • RST_STATES
    • AL Alabama
    • AK Alaska
    • AZ Arizona
    • AR Arkansas
    • CA California
    • CO Colorado
    • CT Connecticut
    • DE Delaware
    • DC District of Columbia
    • FL Florida
    • GA Georgia
    • HI Hawaii
    • ID Idaho
    • IL Illinois
    • IN Indiana
    • IA Iowa
    • KS Kansas
    • KY Kentucky
    • LA Louisiana
    • ME Maine
    • MD Maryland
    • MA Massachusetts
    • MI Michigan
    • MN Minnesota
    • MS Mississippi
    • MO Missouri
    • MT Montana
    • NE Nebraska
    • NV Nevada
    • NH New Hampshire
    • NJ New Jersey
    • NM New Mexico
    • NY New York
    • NC North Carolina
    • ND North Dakota
    • OH Ohio
    • OK Oklahoma
    • OR Oregon
    • PA Pennsylvania
    • RI Rhode Island
    • SC South Carolina
    • SD South Dakota
    • TN Tennessee
    • TX Texas
    • UT Utah
    • VT Vermont
    • VA Virginia
    • WA Washington
    • WV West Virginia
    • WI Wisconsin
    • WY Wyoming

Custom actions

  • RstLoadRestaurants: Refresh all restaurants' data

RstRestaurant business object definition

Restaurant (as referenced as POI in OpenStreetMap) + extra data The restaurants without a name or a state are ignored

Fields

Name Type Required Updatable Personal Description
rstRstName char(100) yes* Name
rstRstState enum(2) using RST_STATES list State (e.g. NY)
rstRstCuisine char(50) Cuisine type
rstRstWebSite url(100) Web site
rstRstAddress char(255) Address
rstRstCoordinates geocoords Geographical coordinates
rstRstTimestamp datetime Data timestamp
rstRstStatus enum(10) using RST_STATUS list yes Status
rstRstNbComments int(10) Number of comments
rstRstRating float(11, 0) Rating
rstRstDescription html(4000) yes Description
rstRstPicture image yes Picture
rstRstLocId link to RstLocation id yes yes -
Ref. rstRstLocId.rstLocName char(100) Location name
Ref. rstRstLocId.rstLocState enum(2) using RST_STATES list Location state
Ref. rstRstLocId.rstLocCoordinates geocoords Location coordinates
Ref. rstRstLocId.rstLocExtent int(10) Location extent (miles)

Lists

  • RST_STATES
    • AL Alabama
    • AK Alaska
    • AZ Arizona
    • AR Arkansas
    • CA California
    • CO Colorado
    • CT Connecticut
    • DE Delaware
    • DC District of Columbia
    • FL Florida
    • GA Georgia
    • HI Hawaii
    • ID Idaho
    • IL Illinois
    • IN Indiana
    • IA Iowa
    • KS Kansas
    • KY Kentucky
    • LA Louisiana
    • ME Maine
    • MD Maryland
    • MA Massachusetts
    • MI Michigan
    • MN Minnesota
    • MS Mississippi
    • MO Missouri
    • MT Montana
    • NE Nebraska
    • NV Nevada
    • NH New Hampshire
    • NJ New Jersey
    • NM New Mexico
    • NY New York
    • NC North Carolina
    • ND North Dakota
    • OH Ohio
    • OK Oklahoma
    • OR Oregon
    • PA Pennsylvania
    • RI Rhode Island
    • SC South Carolina
    • SD South Dakota
    • TN Tennessee
    • TX Texas
    • UT Utah
    • VT Vermont
    • VA Virginia
    • WA Washington
    • WV West Virginia
    • WI Wisconsin
    • WY Wyoming
  • RST_STATUS
    • CLOSED Code CLOSED
    • OPEN Code OPEN
You can’t perform that action at this time.