This repository contains the code for the web application that is used to leave reviews on restaurants and get back a sentiment analysis on the given reviews.
There are multiple ways in which you can run the application:
- Using the docker image published under ghcr.io
- Building the docker image locally and running it (see Docker Steps)
- Running the applicaion locally (see Running the application(locally))
- Using the docker-compose file within the operation repository (NOTE: This will also start the
model-service
container)
In order to run the application locally, you need to have the following:
- Have node.js installed
- Have NPM installed
- Create a personal access token for github (see Creating a personal access token) with at least the following permissions:
read:packages
repo
- Export the recently created PAT within your current process by running the following command:
export NPM_TOKEN=<ghb-token>
- Install the dependencies by running the following command:
npm install
- Start the application by running the following command:
npm run start
- The application should now be running on port
8083
on your local machine, more specifically onhttp://localhost:8083
# You need to pass the NPM token as a secret to be available
# when building the docker image (it's actually the GITHUB token)
echo "<ghb-token>" > NPM_TOKEN.txt
# You then need to build the docker image by passing the NPM_TOKEN
docker build --secret id=NPM_TOKEN,src=./NPM_TOKEN.txt --tag <tag> .
NOTE: The
NPM_TOKEN
is used to install the private packages from the github registry and should not be passed to the image via build args, as it will be available in the image Be careful not to push the file containing the token to the repository if you created the file within the local repository
docker run --rm -p 8083:8083 <tag>
If all of the steps were followed correctly, the application should now be running on port 8083
on your local machine, more specifically on http://localhost:8083
. Should the port be already in use, you can change the port mapping to something else, e.g. -p 8084:8083
Note that the port on the left side of the colon is the port on your local machine, while the port on the right side of the colon is the port on the container - the latter should not be changed
npm install
npm run build
npm run start
npm run format
Versioning of this repository is done automatically using GitHub Actions. The versioning is done using the standard Semantic Versioning (SemVer) format. Version bumps are done automatically when a PR is merged to the main
branch. To achieve this, we are using the GitVersion tool. For more information on how to use GitVersion, see this link.
Below are some images of how the webpage for the application looks: