Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dzhw/metadatamanagement
Metadatamanagement (MDM) - Data Search for Higher Education Research and Science Studies
https://github.com/dzhw/metadatamanagement
angular-material angularjs aws-fargate-application docker-compose elasticsearch github-actions grunt jasmine junit karma maven mongodb readthedocs robotframework saucelabs snyk-io spring-boot spring-data-mongodb spring-security terraform
Last synced: 3 months ago
JSON representation
Metadatamanagement (MDM) - Data Search for Higher Education Research and Science Studies
- Host: GitHub
- URL: https://github.com/dzhw/metadatamanagement
- Owner: dzhw
- License: agpl-3.0
- Created: 2015-07-21T07:35:40.000Z (over 9 years ago)
- Default Branch: dev-2024-2-2
- Last Pushed: 2024-08-12T06:21:35.000Z (5 months ago)
- Last Synced: 2024-08-14T15:00:04.879Z (5 months ago)
- Topics: angular-material, angularjs, aws-fargate-application, docker-compose, elasticsearch, github-actions, grunt, jasmine, junit, karma, maven, mongodb, readthedocs, robotframework, saucelabs, snyk-io, spring-boot, spring-data-mongodb, spring-security, terraform
- Language: Java
- Homepage: https://metadata.fdz.dzhw.eu
- Size: 281 MB
- Stars: 25
- Watchers: 14
- Forks: 9
- Open Issues: 292
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://github.com/dzhw/metadatamanagement/workflows/Build%20and%20Deploy/badge.svg)](https://github.com/dzhw/metadatamanagement/actions) [![Documentation Status](https://readthedocs.org/projects/metadatamanagement/badge/?version=latest)](https://metadatamanagement.readthedocs.io/de/latest/)
[![Known Backend Vulnerabilities](https://snyk.io/test/github/dzhw/metadatamanagement/badge.svg?targetFile=pom.xml)](https://snyk.io/test/github/dzhw/metadatamanagement?targetFile=pom.xml
)[![Known Frontend Vulnerabilities](https://snyk.io/test/github/dzhw/metadatamanagement/badge.svg?targetFile=package.json)](https://snyk.io/test/github/dzhw/metadatamanagement?targetFile=package.json
)[![codecov](https://codecov.io/gh/dzhw/metadatamanagement/branch/development/graph/badge.svg)](https://codecov.io/gh/dzhw/metadatamanagement)[![Mergify Status](https://gh.mergify.io/badges/dzhw/metadatamanagement.png?style=cut)](https://mergify.io)
[![DOI](https://zenodo.org/badge/39431147.svg)](https://zenodo.org/badge/latestdoi/39431147)[![Sauce Test Status](https://app.saucelabs.com/browser-matrix/andydaniel.svg?cachebuster=1234)](https://app.saucelabs.com/u/andydaniel)
# Metadatamanagement (MDM)The MDM holds the metadata of the data packages which are available in our Research Data Center [FDZ](https://fdz.dzhw.eu). It enables researchers to browse our data packages before signing a contract for using the data.
# Developing the MDM system
Please checkout the development branch before starting to code and create a new branch starting with your username followed by the backlog items issue number you will be working on:
git checkout development
git checkout -b rreitmann/issue1234Before you can build this project, you must install and configure the following dependencies on your machine:
1. Java: You need to install java 15 sdk on your system. On Ubuntu you should use [SDKMAN!][] (`sdk install java 15.0.2.hs-adpt`)
2. Maven: You need to install maven 3.6.1 or above on your system. On Ubuntu you should use [SDKMAN!][] (`sdk install maven`)
3. [Node.js][]: Node.js 16 and npm (coming with node.js) are required as well. On Ubuntu you should install node using [NVM][] (`nvm install v16`)On Windows, `patch.exe` has to exist in the PATH. It is distributed as part of git bash, or can be downloaded manually from [GnuWin32][].
## Running on your local machine
Make sure that you have read-write-access on the **data** directory (in your project directory) for Elasticsearch and MongoDB. Specifically **Mac** users need to run the following command to create all data directories before bringing up the containers for the first time:
```bash
mkdir -p data/elasticsearch/data data/mongodb/db data/mongodb/logs
```
Otherwise your Docker Host will attempt to change permissions on the directories and fail.Use `docker-compose up` to create all containers initially. MongoDB and Elasticsearch will be listening on their default ports. MailDev will show all locally sent email on 8081 and the identity-provider can be setup on port 8082. Any time after that use either `docker-compose up` or `docker-compose start`.
In case elasticsearch does not start successfully, you might need to increase its memory limit
`mem_limit: 512m`, e.g. to `1024` (this change required removing and re-building the container).You can get a MongoDB dump and restore it locally:
```
$ wget https://metadatamanagement-public.s3.eu-central-1.amazonaws.com/20220926_metadatamanagement_e2e.zip
$ unzip 20220926_metadatamanagement_e2e.zip
$ mv dump/metadatamanagement data/mongodb/db/
$ docker exec -it mongodb bash
mongo$ cd /data/mongodb/db
mongo$ mongorestore ./metadatamanagement --db=metadatamanagement
mongo$ exit
rm -r dump
```You will need to setup your `~/.m2/settings.xml` so that maven can download a dependency from Github:
```xml
github
${GITHUB_USERNAME}
${GITHUB_TOKEN}
```Run `mvn` **first** to start the Spring backend and to **make sure** the frontend Angular constants module has been generated by the Maven Plugin. Run `npm --prefix mdm-frontend start` to start the Angular Frontend.
```shell
mvn clean install -f maven-plugin/pom.xml
mvn spring-boot:run
```In order for all external services to work on your local machine, you need to set the following variables in `application-local.yml`:
```
dara:
endpoint: "https://labs.da-ra.de/dara/"
username: {see s3://metadatamanagement-private/sensitive_variables.tf}
password: {see s3://metadatamanagement-private/sensitive_variables.tf}
```If you run the backend on your machine for the first time, or you have restored a
mongodb dump, then you need to setup/reindex the elasticsearch indices. Therefore, login as admin to the application,
go to `Administration` on the left, navigate to `External Services` and then
click the red button `Reindex` for the Elasticsearch service. Reindexing can take up to 1 hour.If you want to build a docker image for the metadatamanagement server app you can run
mvn deploy
This image can be run with all its dependent containers by
docker-compose -f docker-compose.yml -f docker-compose-app.yml up -d --build
## Building for the dev environment
Our CI pipleline will do some automatic checks and tests and it will optimize the metadatamanagement client for the dev environment. So before pushing to Github in order to be sure you won't fail the build you should run:
mvn -Pdev clean verify
This will concatenate and minify CSS and JavaScript files using grunt. It will also modify the `index.html` so it references
these new files.We test our project continuously with the Robot Framework. Test Developers can get further info [here](https://github.com/dzhw/metadatamanagement/wiki/Robot-Framework).
## Tweet
#### Authentication
When an analysis package or data package is released with version >=1.0.0, the user can optionally post a message about
the release on X (formerly Twitter).To set this up, you need to have an X Developer Account (Free Access Level) and your projects' api
credentials `consumer key` and `consumer secret`. Be aware that the current [Free Access Level](https://developer.twitter.com/en/docs/twitter-api)
is limited to 50 tweets/24h; 1,500 tweets/month; 1 environment; 1 project.Make your credentials `consumer key` and `consumer secret` accessible by the `application.yml` of the current stage through
`sensitive_variables.tf` just like other highly sensitive data.```shell
[application.yml]
...
tweet:
consumerkey: ${vcap.services.tweet.credentials.consumerkey}
consumersecret: ${vcap.services.tweet.credentials.consumersecret}
oauthtoken: ${vcap.services.tweet.credentials.oauthtoken}
oauthtokensecret: ${vcap.services.tweet.credentials.oauthtokensecret}
...
```Create your `oauthtoken` and `oauthtokensecret` by following the three steps of the Postman
Twitter examples: [Twitter OAuth 1.0a flow test](https://www.postman.com/twitter/workspace/twitter-s-public-workspace/request/9956214-5bd6ebb1-9d79-4456-a9a6-22ead4a41625).
1. step `oauth/request_token`:Execute the request with your consumer key and consumer secret from your Developer Account.
An `OAUTH_TOKEN_FROM_STEP1` and `OAUTH_TOKEN_SECRET_FROM_STEP1` will be returned.2. step `oauth/authorize`:
Visit `https://api.twitter.com/oauth/authorize?oauth_token={OAUTH_TOKEN_FROM_STEP1}&oauth_token_secret={OAUTH_TOKEN_SECRET_FROM_STEP1}&oauth_callback_confirmed=true` with `OAUTH_TOKEN_FROM_STEP1` and `OAUTH_TOKEN_SECRET_FROM_STEP1` from the first step,
and authenticate your app.After being redirected to X, open the network, and copy the values for `oauth_token` as `OAUTH_TOKEN_FROM_STEP2`
and `oauth_token` as `OAUTH_VERIFIER_FROM_STEP2` from this GET request
```shell
GET 'http://twitter.com/?oauth_token={OAUTH_TOKEN_FROM_STEP2}&oauth_verifier={OAUTH_VERIFIER_FROM_STEP2}`'
```3. step `oauth/access_token`:
Insert the `OAUTH_TOKEN_FROM_STEP2` and `OAUTH_VERIFIER_FROM_STEP2` from step 2 into the third
request (If you are using Postman like
the linked Twitter example, select `No Auth` instead of `OAuth 1.0`).
```shell
POST 'https://api.twitter.com/?oauth_token={OAUTH_TOKEN_FROM_STEP2}&oauth_verifier={OAUTH_VERIFIER_FROM_STEP2}'
```Add the returned values for `oauth_token` and `oauth_token_secret` from step 3 to the `sensitive_variables.tf`.
For further details also see [Authentication OAuth FAQ](https://developer.twitter.com/en/docs/authentication/faq).
# Big Thanks
Cross-browser Testing Platform and Open Source :heart: Provided by [Sauce Labs][saucelabs]
Continuous Integration Platform provided by [Github Actions][GithubActions]
[saucelabs]: https://saucelabs.com
[Node.js]: https://nodejs.org/
[Grunt]: http://gruntjs.com/
[NVM]: https://github.com/creationix/nvm
[SDKMAN!]: http://sdkman.io/install.html
[GithubActions]: https://github.com/dzhw/metadatamanagement/actions
[GnuWin32]: http://gnuwin32.sourceforge.net/packages/patch.htm[![forthebadge](http://forthebadge.com/images/badges/built-by-developers.svg)](http://forthebadge.com) [![forthebadge](https://forthebadge.com/images/badges/built-with-science.svg)](https://forthebadge.com)
[![forthebadge](https://forthebadge.com/images/badges/60-percent-of-the-time-works-every-time.svg)](https://forthebadge.com) [![forthebadge](http://forthebadge.com/images/badges/uses-badges.svg)](http://forthebadge.com) [![forthebadge](https://forthebadge.com/images/badges/makes-people-smile.svg)](https://forthebadge.com)