A standalone React application for atomistic structural design. Deployed within the Mat3ra.com platform as documented here and can be used as a library in any web/Node.js application.
Try Materials Designer in action here
Materials Designer can be installed from the source as follows:
git clone git@github.com:Exabyte-io/materials-designer.git
Or use https, if no SSH authentication is set up with GitHub:
git clone https://github.com/Exabyte-io/materials-designer.git
then start the application using Node v14.19:
cd materials-designer
npm install
npm start
Some files might not be downloaded by
git clone
orgit pull
commands if your system doesn't havegit-lfs
installed. To fix this run (on OSX):brew install git-lfs git lfs pull
Open http://localhost:3001 to view the application in the browser.
See the Docker Files section below.
As below and further documented here:
Desirable features/fixes for implementation.
General Improvements:
useState()
hookSpecific features:
Developer Experience:
updateIndex
action when the index is the sameExecute the following commands when running the application in development mode. Use Node v14.19
npm install
npm start
Tests are implemented using Cypress. To launch it use Node v20 and run:
cd tests
npm install
npm test
To run a specific test feature, pass its relative path as an option:
sh run-tests.sh -f=menu/advanced/create-supercell.feature
This package depends on Made, Wave, and Cove.js among other packages. For the full list, see package.json.
Two docker files were used for testing in CI. In principle, we could use
more targeted base images for the use case (e.g. node
or selenium
images),
but we want to verify the correct behavior
on a specific CentOS version. The first dockerfiles/centos/Dockerfile
builds and
runs the application. The second dockerfiles/test/Dockerfile
provisions and runs
the tests. The test
image uses the centos
image as a base and is related by the
entrypoint.sh
script. It is targeted for CI so if you are editing
the entrypoint.sh
you may need to re-build both containers for your changes to
work. It can also be useful to comment out the ENTRYPOINT
in the centos
dockerfile
as well as the CMD
in the test
dockerfile in order to easily run and debug both
containers. There is also a docker-compose.yml
file, which can be used for local
building and testing. Provided docker-compose
is installed, it can be used like so:
docker-compose build materials-designer
docker-compose build materials-designer-test
docker-compose up -d materials-designer
sleep 30 # let the app actually start
docker-compose run materials-designer-test
To run tests in the container use default profile by not specifying it:
docker-compose up -d --build
For debugging purposes, Materials Designer and test container can be run interactively with access via VNC:
docker-compose --profile use-vnc up -d --build
Then connect to vnc://localhost:5920
with a VNC client. The password is 123
. (Port set in .env
file.)
Make sure to have VNC client installed on the system, when address is typed in the Chrome browser, the VNC prompt will appear.
If need to link Cove.js into the app for local development, you need
"@exabyte-io/cove.js": "file:../../cove.js"
npm start
If you need to re-link it again, remove node_modules in cove.js and the app, run npm install, then run npm start again.