diff --git a/.gitignore b/.gitignore index 5c03d3c..ccbe750 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,5 @@ yarn-error.log* build/ lib/ -.nyc_output \ No newline at end of file +.nyc_output +venv/ \ No newline at end of file diff --git a/README.md b/README.md index 977ccbc..ec946a3 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,14 @@ yarn install cd backend && yarn install ``` -## Running frontend, backend and plugins +The examples provided for client optimisers make use of Python 3.8.10. To run and test with the sample data provided, install the Python dependencies from the root of the project with the following (installing Python packages to user directory, optionally create a virtual environment and remove "--user" argument): + +```bash +pip install --user -r requirements.txt + +``` + +## Running frontend, backend and plugins Once all the packages/dependencies have been installed for both the frontend and backend, the stack can be run in the following order: @@ -82,16 +89,7 @@ yarn line In order to feed in data to the database and see real-time visualisation, see the section below to run optimser clients. -## Running client scripts - -The current examples provided make use of Python 3.8.10. - -To run and test the sample data already provided, install the Python dependencies from the root of the project: - -```bash -pip install --user -r requirements.txt - -``` +## Running client scripts The optimiser client scripts are in the "/scripts" folder, you can run from them the root of the project with the following: @@ -111,15 +109,15 @@ The frontend will show all active optmiser client runs once the script has been ## Development -### Creating Plugins +### Creating and configuring plugins -To create a plugin you can copy any of the existing plugins in the `packages` folder. +To create a plugin, begin by copying an existing plugin in the `packages` folder i.e. "pareto-front" plugin folder and rename appropriately. To configure the plugin to work with the frontend, you will need to set its name and description through the files in the plugin folder: 1. `webpackConfig.output.library` in `craco.config.js` to the plugin name, -2. `settings.json/deploy-settings.json` to add the plugin details (look at examples already provided), +2. `settings.json/deploy-settings.json` to add the plugin details (look at examples already provided) (TODO: Clarify...), 3. `name` in `package.json` of the plugin project, @@ -129,10 +127,14 @@ To configure the plugin to work with the frontend, you will need to set its name 6. `pluginName` in `src/index.tsx`, -7. `plugins` command in `package.json` to add the plugin to start with the command, +7. `plugins` command in `package.json` at project root to add the plugin to start with the command, 8. web dyno start in `Procfile` for plugin project (if you are using Heroku). +### Developing and testing plugins + +TODO: Individually developing and testing plugins without having to serve it + ### Deploying backend to Heroku You will need to create a backend application on Heroku and add the GitHub repository to it. diff --git a/package.json b/package.json index a8e1389..11fbd23 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "frontend": "yarn workspace frontend start", "pareto": "yarn workspace pareto-front serve:build", "line": "yarn workspace line serve:build", + "parallel": "yarn workspace parallel serve:build", "stack": "concurrently -n backend,pareto-plugin,frontend \"yarn --cwd backend start\" \"yarn pareto\" \"yarn workspace frontend serve:build\"", "test:backend": "yarn --cwd backend test", "test:frontend": "yarn workspace frontend test", diff --git a/packages/frontend-common/src/state/reducers/common.reducer.tsx b/packages/frontend-common/src/state/reducers/common.reducer.tsx index c5ce3f1..6a67cbb 100644 --- a/packages/frontend-common/src/state/reducers/common.reducer.tsx +++ b/packages/frontend-common/src/state/reducers/common.reducer.tsx @@ -54,7 +54,7 @@ const updatePlugins = ( } log.error( - `Duplicate plugin route identified: ${payload.link}. ${payload.plugin}: '${payload.displayName} not registered` + `Duplicate plugin route identified: ${payload.link}. ${payload.plugin}: '${payload.displayName} not registered'` ); return existingPlugins; }; diff --git a/packages/frontend/public/index.html b/packages/frontend/public/index.html index fda1c2e..340a4c6 100644 --- a/packages/frontend/public/index.html +++ b/packages/frontend/public/index.html @@ -26,6 +26,8 @@
+ + + + +