ReCiter Publication Manager
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
- If you haven't done so already, install Node and Docker.
- Install Docker
- Go to the Docker website
- If you don't already have an account, you will need to create one.
- Use the Docker image to download and install Docker
- To verify Docker is installed, execute
docker ps
at the command line - Install Node
- Enter
brew install node
- For more, see here.
- Clone the repository to a local folder using
git clone https://github.com/wcmc-its/ReCiter-Publication-Manager.git
- In Terminal, navigate to local directory where the repository is installed
- Enter
docker build -t reciter/pub-manager .
- Update local.js
- Navigate to
directory/config/local.js
. - 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.)
- 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 - If you are using Windows machine use your machine IP for hostname or
host.docker.internal
for hostname - If you are using Mac use
docker.for.mac.host.internal
for hostname - Add your adminApiKey.
- Save the file.
- Navigate to
- Enter
docker run -d -p 8081:8081 --name <container-name> reciter/pub-manager
- Let's see what is happening in the logs as we make changes to our application.
- You can check the container details using -
- Enter
docker ps
- 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
- Enter
docker logs -f -t reciter_pub_manager
wherereciter_pub_manager
is the name of your container.
- Go to your browser and enter
https://localhost:8081/login
- 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
- Go to Terminal and enter
docker stop reciter_pub_manager
wherereciter_pub_manager
is the name of your instance. - 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.
- Let's install the application dependencies including nodeJS.
- In Terminal, navigate to the local directory where the repository is installed.
- Enter
npm i
.
- Next, let's install the client dependencies including the React Redux dependencies.
- Enter
cd client
- Enter
npm i
.
- Enter
- We now want to run Publication Manager and trigger the application to automatically restart any time code changes are detected.
- Go to the
Publication-Manager
directory. Enter..
- Enter
npm i -g node-dev
.
- Go to the
- Enter
npm run dev
This will run the nodejs express server in development mode and also the react server concurrently. - If you get an error because a port is already in use, you need to do the following.
- Interrupt the existing process by entering control-C.
- Identify the existing PID. Enter
lsof -f :5000
- Enter
kill -9 41046
where 41046 is the PID of the existing process.
- This should open a new tab in your default browser.
- Add
/login
to URL as inhttps://localhost:3000/login
- Try logging in.
Making changes in the development box
- Open your repository in Visual Studio Code or your tool of choice.
- Navigate to
/client/src/css
- Open Header.css and change background-color to #ff6600, and save the file.
- The changes should instantly appear in Chrome.