sarbajitdutta / ReCiter-Publication-Manager

ReCiter Publication Manager - a user interface for providing feedback on articles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ReCiter Publication Manager

Build Status version License PRs Welcome Pending Pull-Requests Closed Pull-Requests GitHub issues open GitHub issues closed star this repo fork this repo Tags Github All Releases Open Source Love

ReCiter Publication Manager is a front end user interface for providing feedback to ReCiter. Users are displayed a set of suggested, accepted, and rejected publications. User feedback in Publication Manager will update the evidence scores of suggested publications in DynamoDB. Feedback will also appear in the various APIs ReCiter uses to share publication data.

Installation

  1. If you haven't done so already, install Node and Docker.
    1. Install Docker
    2. Go to the Docker website
    3. If you don't already have an account, you will need to create one.
    4. Use the Docker image to download and install Docker
    5. To verify Docker is installed, execute docker ps at the command line
    6. Install Node
    7. Enter brew install node
    8. For more, see here.
  2. Clone the repository to a local folder using git clone https://github.com/wcmc-its/ReCiter-Publication-Manager.git
  3. In Terminal, navigate to local directory where the repository is installed
  4. Enter docker build -t reciter/pub-manager .
  5. Update local.js
    1. Navigate to directory/config/local.js.
    2. Update the endpoint with appropriate endpoint for ReCiter and Reciter-Pubmed. (For local development mode, follow instructions in the "Installation as a development box" section.)
    3. If you are using Docker to run the project then you must not specify localhost for hostname. Since the container does not understand the DNS entry. See Connect to services running on host from within Docker container
    4. If you are using Windows machine use your machine IP for hostname or host.docker.internal for hostname
    5. If you are using Mac use docker.for.mac.host.internal for hostname
    6. Add your adminApiKey.
    7. Save the file.
  6. Enter docker run -d -p 8081:8081 --name <container-name> reciter/pub-manager
  7. Let's see what is happening in the logs as we make changes to our application.
    1. You can check the container details using -
    2. Enter docker ps
    3. The console will return return a range of attributes for the instance. Look for the "NAMES" column in these attributes. It should be the container name you provided: reciter_pub_manager
    4. Enter docker logs -f -t reciter_pub_manager where reciter_pub_manager is the name of your container.
  8. Go to your browser and enter https://localhost:8081/login
  9. To login, enter your username and password. You can setup username and password using the reciter api http://<reciter-endpoint>:<port-number>/swagger-ui.html#/re-citer-pub-manager-controller/createUserUsingPOST

Stopping and removing an instance

  1. Go to Terminal and enter docker stop reciter_pub_manager where reciter_pub_manager is the name of your instance.
  2. Enter docker rm reciter_pub_manager.

Installation as a development box

These steps allow us to make and test out changess locally. We're going to run our front end application on port 3000 (using React Redux) and have it talk to a back end app (using NodeJS), which runs on port 5000.

  1. Let's install the application dependencies including nodeJS.
    1. In Terminal, navigate to the local directory where the repository is installed.
    2. Enter npm i.
  2. Next, let's install the client dependencies including the React Redux dependencies.
    1. Enter cd client
    2. Enter npm i.
  3. We now want to run Publication Manager and trigger the application to automatically restart any time code changes are detected.
    1. Go to the Publication-Manager directory. Enter ..
    2. Enter npm i -g node-dev.
  4. Enter npm run dev This will run the nodejs express server in development mode and also the react server concurrently.
  5. If you get an error because a port is already in use, you need to do the following.
    1. Interrupt the existing process by entering control-C.
    2. Identify the existing PID. Enter lsof -f :5000
    3. Enter kill -9 41046 where 41046 is the PID of the existing process.
  6. This should open a new tab in your default browser.
  7. Add /login to URL as in https://localhost:3000/login
  8. Try logging in.

Making changes in the development box

  1. Open your repository in Visual Studio Code or your tool of choice.
  2. Navigate to /client/src/css
  3. Open Header.css and change background-color to #ff6600, and save the file.
  4. The changes should instantly appear in Chrome.

About

ReCiter Publication Manager - a user interface for providing feedback on articles

License:Apache License 2.0


Languages

Language:JavaScript 92.2%Language:CSS 6.2%Language:HTML 1.3%Language:Dockerfile 0.2%Language:Pug 0.1%