A React app for authoring JSON documents that conform to the Chronobiology Data Standards. We're using the React JSON Schema Forms library to dynamically generate forms based on the schema files. The app was bootstrapped with Create React App.
The app is deployed here.
We're using asdf to manage project dependencies.
-
Install asdf
-
Install the asdf-nodejs plugin.
-
Install node with
asdf install
. -
Install dependencies with
npm install
. -
Start the server with
npm start
.
Run the tests with npm test
.
The schema files live in the CDSIG-Schema repo. Use the following workflow to test changes to those schema files in this web authoring tool:
-
Install
@apidevtools/json-schema-ref-parser
usingnpm install @apidevtools/json-schema-ref-parser
. -
Create a branch in the CDSIG-Schema repository, make your changes and push them to GitHub. Note that you might need to update any external
$ref
URLs so that they point to the schema files in your new branch. -
Create a branch in this repository.
-
Run the
./scripts/update-schema
script and pass your CDSIG-Schema branch name as an argument (e.g../scripts/update-schema my-schema-branch-name
). -
Check the schema changes work as expected in the development server at http://localhost:3000.
-
Once you're happy that everything is working as expected you can merge the changes in both repositories into main.
- .github/ - Configuration for running tests on GitHub and deploying to Netlify.
- public/ - Static files made available to the web application.
- scripts/ - Shell scripts for working with schema files. See comments in each file for their purpose.
- src/schema/original/ - Copies of schema files from CDSIG-Schema repo. These should only be changed by running the
update-schema
script. - src/schema/ - The schema files we use in our React app. They are dereferenced and prettified versions of the schema files in src/schema/original. These should only be changed by running the
update-schema
script. - src/ - Source of the React web app.
We're using GitHub Actions to run the tests and deploy to Netlify if they all pass. This is configured in .github/workflows/main.yml
.