React UI for MolMaker
-
Clone the repository
git clone https://github.com/UBCC3/react-ui.git
-
Navigate to the project directory
cd react-ui -
Install dependencies
npm ci
NOTE: Node.js and npm are pre-requistes. Install latest versions of both if not not installed already. At the time of development, I used Node.js v18.20.8 and npm v10.8.2 (latest at the time).
-
Git hooks (automatic)
npm ciruns thepreparescript, which installs the Husky pre-commit hook. Nothing further to do. Confirm it worked with:git config core.hooksPath
That should print
.husky/_. If it prints nothing, runnpm run prepare.The hook runs ESLint and Prettier on staged files only. It fixes what it can and re-stages the result, so a formatting slip will not block the commit. Anything ESLint cannot fix automatically will.
-
Environment variables
Take a look at create a
.envfile and copy over the contents of.env.example. Fill in the missing details from Auth0. -
Run the application
npm run dev
The development and production build commands automatically verify and unpack the Git-tracked JSmol runtime. No separate JSmol download or server-side
publicdirectory is required.
JSmol 16.3.33 is stored as a pinned compressed archive under vendor/.
npm run dev and npm run build extract it automatically, and production
builds fail if required viewer assets are missing or unexpectedly small.
Run the fast TypeScript regression tests with:
npm testRun the headless Molden/ESP integration check with:
npm run test:jsmolThe first integration-test run downloads and verifies the pinned Jmol runtime
and requires Java, curl, and unzip. To check actual job artifacts instead of
the committed fixtures, pass their paths after --:
npm run test:jsmol -- /path/to/orbitals.molden /path/to/ESP.cube