Skip to content

Commit

Permalink
adding vm cheatsheet
Browse files Browse the repository at this point in the history
  • Loading branch information
l-gorman committed Mar 29, 2021
1 parent 28a9ded commit 9077bdc
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,5 @@ projects as an administrator, and developing further features for the applicatio
source/api.md
source/nginx.md
source/contribute-to-the-guide.md
source/key-vm-commands.md

2 changes: 1 addition & 1 deletion source/api.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# API

Some information about the api
The API used for this project is a very simple express API. The API can be cloned [here](https://github.com/l-gorman/legume-choice-api). Clone the repository, change to the project directory using the command `cd legume-choice-api` and ensure dependencies are installed using the command `npm install`. The database models can be found in the `models` folder, and the routes in the `routes` folder. The api can be started using the command `node server.js` (it will run on port 5000 by default).
4 changes: 3 additions & 1 deletion source/data-processing.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Data Processing

Some information about the data processing
The data-processing is done using a series of python scripts. These can be accessed [here](https://github.com/l-gorman/legume-choice-data-processing). One script `daemon.py` listens for changes in the MongoDB database. When a change occurs, the script `FormatAllData.py` is run to reformat the data, and generate a series of CSVs. These CSVs are then made available for download through folders on the linux virtual machine (see [server description](nginx.md)).

To run this script locally, and produce modified outputs, ensure the requirements are installed (see `requirments.txt`), then run the command `python3 FormatAllData.py`. The python daemon is daemonized using systemd.
2 changes: 1 addition & 1 deletion source/developer-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ The legumeCHOICE tool is made up of multiple components. The frontend is written

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
## 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](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [node](https://nodejs.org/en/download/) installed. Clone the repositories for the [API](https://github.com/l-gorman/legume-choice-api) and the [React App](https://github.com/l-gorman/legume-choice-client). 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](database.md) section.
3 changes: 3 additions & 0 deletions source/key-vm-commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Key Commands for Virtual Machine

A cheatsheet for running, stopping, and restarting processes on the legumeCHOICE virtual machine.
2 changes: 1 addition & 1 deletion source/nginx.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Server

Some information about the nginx server for legume CHOICE
LegumeCHOICE uses an NGINX server.

0 comments on commit 9077bdc

Please sign in to comment.