Overview

The legumeCHOICE tool is made up of multiple components. The frontend is written using ReactJS. This is hosted on github pages. The server, api, data-processing scripts and database are hosted on a linux virtual machine running Ubuntu 20.04. We use an NGINX server, an Express api, a python daemon for data-processing, and a MongoDB database. The documentation has been written using sphinx, and is hosted using readthedocs.

Each of the following sections, describes these components in more detail. In particular, we focus on how these components function, how to contribute to each component, and the limitations of each of these components.

Developing App Locally

If you are developing the application locally, the only components needed are the front-end, the express-api, and the database. Ensure you have git and node installed. Clone the repositories for the API and the React App. To start the api, ensure you are in the directory legume-choice-api and run the command npm install followed by the command node server.js (by default this will run on port 5000). You can then run the front end by changing to the directory legume-choice-client. Run the command npm install followed by the commmand npm start. Note to make requests to your local MongoDB database, you must ensure that you are submitting to the correct URL. To check this, when in npm the directory legume-choice-client, check the file src/components/submit-data-component/submit-data-component.js. Navigate to the line where requests are made, and make sure the url is http://localhost:5000/api/projects/submit-data/. To explore the database, see the instructions in the database section.