https://github.com/clowder-framework/consort-frontend
custom react frontend working with consort clowder instance
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.2%) to scientific vocabulary
Repository
custom react frontend working with consort clowder instance
Basic Info
- Host: GitHub
- Owner: clowder-framework
- Language: JavaScript
- Default Branch: main
- Size: 3.59 MB
Statistics
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 22
- Releases: 0
Metadata Files
README.md
CONSORT
custom react frontend working with consort clowder instance
Project documentation
https://uofi.app.box.com/folder/338244434169
Install Dependencies
- Install node version 22.0.0, npm version 10.5.1
- Run
npm install
Run Project
- Set the environment variables in
server/.envfile. See.template.envfile. - Set CLOWDERPREFIX, CILOGONCALLBACKURL, and CLOWDERREMOTE_HOSTNAME values different for Consort instance (https://consort.clowderframework.org) and local development
- run
npm startto build react client and start the express server.
Dev
run npm start
Build and push image to NCSA hub
- Run
docker build . -t hub.ncsa.illinois.edu/clowder/consort-frontend:<version>to build docker image - Image needs to be built in a linux machine. Use NCSA Radiant VMs if using a non-compatible work laptop (Eg: Mac with apple silicon)
If you ran into error
[Errno 28] No space left on device:, try below:- Free more spaces by running
docker system prune --all - Increase the Disk image size. You can find the configuration in Docker Desktop
- Free more spaces by running
Login first:
docker login hub.ncsa.illinois.eduRun
docker image push hub.ncsa.illinois.edu/clowder/consort-frontend:<version>
Local testing
- Change package.json start to
"start": "npm-run-all --parallel open:src". This will not build the server side. utils.common.jsinstead of axios request, return the clowder specific api key as in comments.- In
route.tsximportimport CreateAndUpload from "./components/childComponents/CreateAndUpload";and add<Route path="/create/" element={<CreateAndUpload/>}/> - Go to localhost:3000/create to test the basic functionality without login.
Test only Preview components
- Change
src/components/Preview.jsimport Pdf from "./previewers/Pdf"; <Box className="filePreview"> <Pdf /> </Box> - Change
components/previewers/Pdf.jsto import a static pdf and json file directly from local directory.import pdfFile from "../../../main.pdf"; import metadataFile from "../../../main.json"; if (metadata == undefined){ let content = metadataFile['content'][0]; setContent(content); } <Document file={pdfFile} onLoadSuccess={onDocumentLoadSuccess}> - On terminal type "npm start". Point browser to localhost:3000/preview
Code explanation
- Server side
- Code
./server - Does auth using CILogon.
RCTDB (postgresDB) schema and connection will be configured here.
Client side.
Code
./srcapp.config.jshas some default configs on the extractor names - which extractor to trigger.routes.tsxdefines the routes.When user is signed in,
/homeroute is provided. There's seperate route for Preview and FAQ page./homeroute
2.1. CreateAndUpload component
- CreateAndUpload is the main component
- The dropbox for file upload accepts pdf,doc and docx formats.
- The statment choice and report/preview choice should be done before dropping the file. Once an accepted file format is dropped, the extractors are triggered with the default choice of values(radio button values).
- The component calls a createUploadExtract thunk function in actions/client.js
- The component waits till a json file is created in the dataset in highlights_file_loop code. This highlights json file has the information needed to render the preview components. The loop checks every 5s for a json file existing in the dataset.
- The "View Results" button will either download the report or navigate to preview page to show the highglited preview.
2.2 actions/client.js
- Creates an empty dataset with the same name as the uploaded filename
- Uploads the file
- Calls wordPipieline pdfPipeline whether the filetype is pdf/word.
2.3 wordPipeline utils.word_pipeline.js
- Submits file for extraction to sOffice extractor.
- Checks if a pdf file is generated.
- Once pdf file is generated, triggers the pdfPipeline
2.4 pdfPipeline utils.pdfPipeline
- submits file for extraction to pdf2text extractor
- Checks if a csv file is generated.
- Once csv is generated, triggers the csvPipeline
2.5 csvPipeline utils.csv_pipeline
- Submits file for rct-extractor
- Checks if a dataset metada is created with the extractor name of rct-extractor for completing the process.
- Previews
- FilePreview component is shown in
/previewroute. - Get file previews using method
getPreviewResources If the preview type is "thumbnail" or "pdf" the original pdf file with highlights and a PreviewDrawerLeft component is shown.
Pdf Preview
The pdf file rendering with canvas highlights is done in this component. In
components/previewers/Pdf.jsThe content from the highlights json file is used to render this.
The highlights/content is rendered page py page using method
getPageHighlightsThe colors used for highlights for different statement (spirit/consort) is in
components/styledComponents/HighlightColors.jsThe labels for the sentences are placed on the sides/margin of the page next to the sentence. Theres a collision avoidance mechanism given that there can be multiple labels per sentence. From the testings, 3 labels per sentence can be shown without major rendering issues.
PreviewDrawerLeft component
This component drives the left side drawer. In file
childComponents/PreviewDrawerLeftUses the data in highlights json file to render this
Owner
- Name: Clowder
- Login: clowder-framework
- Kind: organization
- Email: clowder@lists.illinois.edu
- Website: https://clowderframework.org/
- Repositories: 30
- Profile: https://github.com/clowder-framework
Research data management for long tail data.
GitHub Events
Total
- Issues event: 25
- Watch event: 1
- Delete event: 17
- Issue comment event: 41
- Push event: 66
- Pull request review event: 1
- Pull request event: 27
- Create event: 13
Last Year
- Issues event: 25
- Watch event: 1
- Delete event: 17
- Issue comment event: 41
- Push event: 66
- Pull request review event: 1
- Pull request event: 27
- Create event: 13
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 14
- Total pull requests: 10
- Average time to close issues: 9 months
- Average time to close pull requests: 28 days
- Total issue authors: 1
- Total pull request authors: 2
- Average comments per issue: 0.29
- Average comments per pull request: 1.2
- Merged pull requests: 6
- Bot issues: 0
- Bot pull requests: 1
Past Year
- Issues: 11
- Pull requests: 10
- Average time to close issues: 15 days
- Average time to close pull requests: 28 days
- Issue authors: 1
- Pull request authors: 2
- Average comments per issue: 0.0
- Average comments per pull request: 1.2
- Merged pull requests: 6
- Bot issues: 0
- Bot pull requests: 1
Top Authors
Issue Authors
- minump (30)
Pull Request Authors
- minump (22)
- lmarini (1)
- dependabot[bot] (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- 1412 dependencies
- @babel/cli ^7.0.0 development
- @babel/core ^7.0.0 development
- @babel/eslint-parser ^7.19.1 development
- @babel/node ^7.0.0 development
- @babel/plugin-proposal-class-properties ^7.0.0 development
- @babel/plugin-proposal-decorators ^7.0.0 development
- @babel/plugin-proposal-do-expressions ^7.0.0 development
- @babel/plugin-proposal-export-default-from ^7.0.0 development
- @babel/plugin-proposal-export-namespace-from ^7.0.0 development
- @babel/plugin-proposal-function-bind ^7.0.0 development
- @babel/plugin-proposal-function-sent ^7.0.0 development
- @babel/plugin-proposal-json-strings ^7.0.0 development
- @babel/plugin-proposal-logical-assignment-operators ^7.0.0 development
- @babel/plugin-proposal-nullish-coalescing-operator ^7.0.0 development
- @babel/plugin-proposal-numeric-separator ^7.0.0 development
- @babel/plugin-proposal-optional-chaining ^7.0.0 development
- @babel/plugin-proposal-pipeline-operator ^7.0.0 development
- @babel/plugin-proposal-throw-expressions ^7.0.0 development
- @babel/plugin-syntax-dynamic-import ^7.0.0 development
- @babel/plugin-syntax-import-meta ^7.0.0 development
- @babel/plugin-transform-flow-strip-types ^7.0.0 development
- @babel/plugin-transform-react-constant-elements ^7.0.0 development
- @babel/polyfill ^7.0.0 development
- @babel/preset-env ^7.0.0 development
- @babel/preset-flow ^7.0.0 development
- @babel/preset-react ^7.0.0 development
- @babel/preset-typescript ^7.13.0 development
- @babel/register ^7.0.0 development
- @testing-library/react ^11.2.6 development
- @types/react ^17.0.38 development
- @types/react-dom ^17.0.11 development
- @types/react-loading-overlay ^1.0.1 development
- @types/react-redux ^7.1.22 development
- @types/react-router-dom ^5.3.3 development
- @types/redux-immutable-state-invariant ^2.1.2 development
- @typescript-eslint/eslint-plugin ^5.41.0 development
- @typescript-eslint/parser ^5.41.0 development
- autoprefixer 6.5.4 development
- babel-eslint ^10.1.0 development
- babel-loader ^8.0.0 development
- babel-plugin-root-import ^6.4.1 development
- babel-plugin-transform-react-remove-prop-types 0.3.1 development
- better-docs ^2.7.2 development
- browser-sync ^2.26.12 development
- chalk 1.1.3 development
- clean-webpack-plugin ^3.0.0 development
- connect-history-api-fallback 1.3.0 development
- css-loader ^6.7.1 development
- cssnano ^5.0.9 development
- eslint ^8.26.0 development
- eslint-config-airbnb ^19.0.4 development
- eslint-config-prettier ^8.5.0 development
- eslint-config-react-app ^7.0.1 development
- eslint-plugin-import ^2.26.0 development
- eslint-plugin-jsx-a11y ^6.6.1 development
- eslint-plugin-prettier ^4.2.1 development
- eslint-plugin-react ^7.31.10 development
- eslint-plugin-react-hooks ^4.6.0 development
- eslint-watch ^8.0.0 development
- eslint-webpack-plugin ^3.2.0 development
- file-loader 6.1.1 development
- html-loader 1.3.2 development
- html-webpack-plugin ^5.5.0 development
- husky ^6.0.0 development
- isparta ^4.1.1 development
- jsdoc ^3.6.7 development
- json-loader ^0.5.7 development
- lint-staged ^11.0.0 development
- mini-css-extract-plugin ^2.6.1 development
- node-sass ^6.0 development
- npm-run-all 4.0.1 development
- openapi-typescript-codegen ^0.12.3 development
- postcss ^8.3.11 development
- postcss-loader ^3.0.0 development
- prettier ^2.3.0 development
- redux-immutable-state-invariant 1.2.4 development
- rimraf ^2.5.4 development
- sass-loader ^10.0.3 development
- style-loader ^2.0.0 development
- svg-inline-loader ^0.8.2 development
- terser-webpack-plugin ^5.3.6 development
- typedoc ^0.20.36 development
- typescript ^4.2.4 development
- url-loader ^3.0.0 development
- wallaby-webpack ^3.9.15 development
- webpack ^5.74.0 development
- webpack-bundle-analyzer ^3.6.1 development
- webpack-cli ^4.10.0 development
- webpack-dev-middleware ^5.3.3 development
- webpack-dev-server ^4.11.1 development
- webpack-hot-middleware ^2.25.2 development
- webpack-merge ^5.7.3 development
- @emotion/react ^11.7.1
- @emotion/styled ^11.6.0
- @material-ui/core ^4.12.3
- @material-ui/icons ^4.11.2
- @mui/icons-material ^5.10.9
- @mui/lab ^5.0.0-alpha.73
- @mui/material ^5.2.8
- @mui/styles ^5.3.0
- @rjsf/core ^3.2.1
- @rjsf/material-ui ^3.2.1
- babel-polyfill ^6.26.0
- classnames ^2.2.6
- date-fns ^2.28.0
- jquery ^3.6.0
- prop-types ^15.7.2
- react ^17.0.2
- react-dom ^17.0.2
- react-loading-overlay-ts ^2.0.0
- react-redux ^7.2.6
- react-router-dom ^6.2.1
- redux ^4.1.2
- redux-thunk ^2.4.1
- universal-cookie ~4.0.4
- whatwg-fetch 2.0.2
- 183 dependencies
- connect-ensure-login ^0.1.1
- connect-sqlite3 ^0.9.13
- cookie-parser ~1.4.4
- csurf ^1.11.0
- debug ~2.6.9
- dotenv ^8.6.0
- ejs ~2.6.1
- express ~4.16.1
- express-session ^1.17.2
- http-errors ~1.6.3
- mkdirp ^1.0.4
- morgan ~1.9.1
- node-fetch ^2.6.12
- passport ^0.6.0
- passport-google-oidc ^0.1.0
- passport-oauth2 ^1.7.0
- pluralize ^8.0.0
- sqlite3 ^5.0.2
- node 14.21.2 build