{"id":23155128,"url":"https://github.com/leoek/material-safety-search","last_synced_at":"2025-08-17T22:32:03.579Z","repository":{"id":39778904,"uuid":"135171216","full_name":"leoek/material-safety-search","owner":"leoek","description":" Search engine for Material Safety Datasheets based on Solr","archived":false,"fork":false,"pushed_at":"2023-07-11T13:14:22.000Z","size":5540,"stargazers_count":4,"open_issues_count":17,"forks_count":0,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2024-05-01T18:57:46.198Z","etag":null,"topics":["ansible","datasheets","docker","material","openapi","react","redux","safety","search","solr","spring"],"latest_commit_sha":null,"homepage":"https://mss.leoek.tech","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leoek.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-28T14:22:50.000Z","updated_at":"2023-12-27T17:28:57.000Z","dependencies_parsed_at":"2022-09-21T05:44:21.276Z","dependency_job_id":null,"html_url":"https://github.com/leoek/material-safety-search","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leoek%2Fmaterial-safety-search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leoek%2Fmaterial-safety-search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leoek%2Fmaterial-safety-search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leoek%2Fmaterial-safety-search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leoek","download_url":"https://codeload.github.com/leoek/material-safety-search/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230174890,"owners_count":18184926,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","datasheets","docker","material","openapi","react","redux","safety","search","solr","spring"],"created_at":"2024-12-17T20:15:24.716Z","updated_at":"2024-12-17T20:15:25.373Z","avatar_url":"https://github.com/leoek.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MSDS Search\nSearch engine for Material Safety Datasheets based on Solr\n\n## [Live Demo](https://mss.leoek.tech)\n\n## Status\n\n| Backend | Frontend | Deployment |\n|---|---|---|\n|   |   |   |\n| [![Build Status](https://ci.net1.leoek.eu/buildStatus/icon?job=material-safety-search/material-safety-search_server-build)](https://ci.net1.leoek.eu/job/material-safety-search/job/material-safety-search_server-build/) | [![Build Status](https://ci.net1.leoek.eu/buildStatus/icon?job=material-safety-search/material-safety-search-frontend-build)](https://ci.net1.leoek.eu/job/material-safety-search/job/material-safety-search-frontend-build/) | [![Build Status](https://ci.net1.leoek.eu/buildStatus/icon?job=material-safety-search/material-safety-search-staging-deploy)](https://ci.net1.leoek.eu/job/material-safety-search/job/material-safety-search-staging-deploy/) |\n\n## Report und Zwischenpräsentationen\n\nDer Report und die Zwischenpräsentationen sind in [docs/](docs/) zu finden.\n___\n\n## How to Run\n**NOTE**: Read the following section carefully! \n\n* You will need the dataset which is NOT in this repository because of liscensing issues. \n\n* The dataset is linked as git submodule and can be installed by running: \n`git submodule update --init --recursive`\n\n* All of the following setups will expect the dataset to be in `\u003crepo-root\u003e/hazard-ds/hazard-dataset`. If your dataset is in a different location please override the path in the docker-compose files (the dataset is just mounted into the container) or override the application.property `dataSetPath`.\n\n* If you are **not** running the backend in a docker container, there are 2 additional files needed.\nTheir default paths are `\u003crepo-root\u003e/hazard-ds/fscMap.txt` and `\u003crepo-root\u003e/hazard-ds/fsgMap.txt`. These paths can be adjusted through the environment variables `fscMapPath` and `fsgMapPath`.\n\n**NOTE** Installtion Instructions for required Software to **run** MSDS Search:\n* [docker](https://docs.docker.com/install/linux/docker-ce/ubuntu/)\n* [docker-compose](https://docs.docker.com/compose/install/#install-compose)\n\n**NOTE** Installtion Instructions for required Software to **develop** for MSDS Search:\n* docker and docker-compose (see above)\n* [Java Jdk 10](https://docs.oracle.com/javase/10/install/installation-jdk-and-jre-linux-platforms.htm#JSJIG-GUID-737A84E4-2EFF-4D38-8E60-3E29D1B884B8) manual\n* [Java Jdk 10](https://stackoverflow.com/questions/49507160/how-to-install-jdk-10-under-ubuntu) via PPA\n* [yarn](https://yarnpkg.com/lang/en/docs/install/#debian-stable)\n\n**NOTE**: If you have questions about the following docker commands, you can find their documentation [here](https://docs.docker.com/compose/reference/overview/). These are the basic commands which you will probably need:\n\n1. `docker-compose up -d` Start/create containers, volumes and networks. Setup and detach your console.\n2. `docker-compose logs -f` View the logs and attach your console to them.\n3. `docker-compose down` Stop and delete all containers.\n4. `docker-compose down -v` Stop, delete all containers and remove all data volumes.\n5. The `-f` flag is used to specify a certain compose file. There are different compose files with different purposes in this repository.\n\n### Quick Start\n1. clone the repository: `git clone https://github.com/leoek/material-safety-search.git`\n2. `cd material-safety-search`\n3. download submodules: `git submodule update --init --recursive`\n4. With access to https://hub.docker.com/r/materialsafetysearch/private/\n    1. login to dockerhub: `docker login`\n    2. Use our prebuilt docker images: `sudo docker-compose -f docker-compose.staging.yml up -d`\n    3. [Optional] View logs: `sudo docker-compose -f docker-compose.staging.yml logs -f mss-server`\n4. Without access to the prebuilt docker images\n    1. Build and run the images on your local machine (which might take a while): `sudo docker-compose -f docker-compose.local.yml up -d`\n    2. [Optional] View logs: `sudo docker-compose -f docker-compose.local.yml logs -f mss-server`\n5. Wait for the dataset to be indexed, the search engine is already usable if only a part is indexed. (You can check the progress in the logs)\n\n### There are two options available to run this search engine:\n\n1. Use our prebuilt docker images: `sudo docker-compose -f docker-compose.staging.yml up -d`\n2. Build and run the images on your local machine (which might take a while): `sudo docker-compose -f docker-compose.local.yml up -d`\n\n**ATTENTION**: Please note that the solr container does not require any login information. Therefore it should not be exposed to the public. Our docker-compose.local.yml configuration **will expose all ports** for debugging purposes. You should never use that configuration in any production environment.\n\n### Production Setup / Deployment\n\n* We recommend to run all containers behind some kind of reverse proxy. You can get an example on how to do that in our docker-compose.staging.yml configuration.\n* Our backend and frontend containers do not have any SSL support. We recommend to setup SSL within the reverse proxy.\n* You can find an example Ansible setup inside `/ansible` which is used by Jenkins to deploy the search engine to the demo server. The Ansible setup will work with most debian based systems.\n    * `ansible-role-common`: Basic server setup, you probably want to replace / adjust this.\n    * `ansible-role-docker`: Install / update docker and docker-compose. Set it up to work with the Ansible `docker_service` module (which has some flaws).\n    * `ansible-role-docker-nginx-proxy`: Setup jwilder as a reverse proxy, with letsencrypt-companion for SSL certificates\n    * `docker-mss-deployment-local`: This is the role which will deploy the search engine.\n    * `docker-mss-deployment-local-reset-volumes`: This role can be used to clear the docker volumes. Use this if you want to re-index the dataset and clear all logs.\n\n\n---\n## OpenApi Specification\n\nThe Api is defined by an [penapi specification]api.yml).\n\n----\n## Development / Building from Source\n\nCheck for these files to be present:\n1. The dataset\n2. fscMap.txt\n3. fsgMap.txt\n\n### Development Workflow\n\n* We are using git flow.\n    * The `master` branch only contains released versions.\n    * Every release has its own tag, we are using semantic versioning.\n    * The `develop` branch contains the current state of development. The code within `develop` should always be in such a shape, that we could make a release without any patches needed.\n    * Actual development happens in `feature` branches. `feature` branches should be commited to the remote repository and deleted once they are merged into `develop`.\n    * Try to avoid merge commits with the usage of `git pull --rebase`.\n\n* Every commit to develop will be built and published to [docker hub](https://hub.docker.com/r/materialsafetysearch/private/) by [Jenkins](ci.leoek.eu). Builds from develop are tagged with `next`, builds from master with `stable` and their `\u003cfull version\u003e-\u003cbuildnumber\u003e`. Until the first release, builds from develop will be pushed with their version to develop as well.\n\n* Every build from develop is deployed to [mss.leoek.tech](mss.leoek.tech) and [api.mss.leoek.tech](api.mss.leoek.tech). The frontend can develop against that staging api.\n\n\n#### Building inside a Docker Container:\n\nRequirements:\n1. Docker-ce 15+\n2. docker-compose 1.16+\n\nProcedure:\n1. `sudo docker-compose -f docker-compose.local.yml up -d`\n2. Solr will be available at [http://localhost:8983](http://localhost:8983)\n3. The Backend will be available at [http://localhost:8080](http://localhost:8080)\n4. The Frontend will be available at [http://localhost:80](http://localhost:80)\n\n#### Backend\n\nRequirements:\n1. Java JDK 10\n2. Docker-ce\n3. docker-compose 1.16+\n\nProcedure:\n1. You will need a Solr instance for development. The easiest way to get one up and running which is configured for local development is by running `docker-compose up -d`.\n2. Our Backend is a Spring Boot application, which uses Gradle for package management. You can build and run it with: `./gradlew bootRun` (theoretically it should work with the .bat file on windows, however until now nobody had the nerves to mess with windows).\n3. Solr will be available at [http://localhost:8983](http://localhost:8983)\n4. The Backend will be available at [http://localhost:8080](http://localhost:8080)\n\n#### Frontend\n\nThe frontend can be found within the [frontend/](frontend/) folder. Check out the [rontend Readme](ontend/README.md)\n\nRequirements:\n1. Yarn 1.8+\n2. Node 8+\n\nProcedure:\n1. Run `yarn` to obtain the dependencies.\n2. Run `yarn start` to start the development server.\n3. The Frontend will be available at [http://localhost:3000](http://localhost:3000)\n\n\n**NOTES**:\n\n1. The Backend will check whether documents are already imported to Solr. If the solr core is not empty it will skip the import of the documents.\n2. Solr data is in a named docker volume, which will prevent losing the Solr core with the indexed documents in between container restarts.\n3. The Solr data volume can be deleted with the `-v` flag: `docker-compose down -v`\n\n#### Postman\n\nPostman can be used to talk to the backend directly. [Import](https://medium.com/@codebyjeff/using-postman-environment-variables-auth-tokens-ea9c4fe9d3d7) the supplied collection and environments and you should be good to go.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleoek%2Fmaterial-safety-search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleoek%2Fmaterial-safety-search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleoek%2Fmaterial-safety-search/lists"}