
= Search page for the rule repository

This is a single-page React application that indexes the rule repository and
allows you to run flexible search through all of the rules and rule drafts,
and render the rule specifications in HTML.
The render is not guaranteed to match the rule rendering in the products,
but it is a good proxy.

== Local deployment

Make sure you have NodeJs and `npm` available. Tested with NPM v10.2.3 and NodeJS v18.19.0.

Install dependencies

[source,shell]
----
npm install
----

If you have some non-js dependencies missing, this might fail.
Possibly missing non-js dependencies include OpenSSL, libuv, libssh2, KRB5.

Once you succeed in installing the dependencies you are ready to predeploy.

[source,shell]
----
npm run predeploy
----

This command builds the database of the rule specifications.

NOTE: If the script fails to clone or fetch due to an SSL certificate failure
      and your network uses a custom CA certificate you might need to make sure it is installed
      in the accessible place.
      As a workaround you can https://github.com/nodegit/nodegit/issues/1742[disable the certificate check].

NOTE: In the predeploy step (specifically the `prepare-rules` part of it) the script fetches all the open PRs locally.
      You might want to set `GITHUB_TOKEN` to your personal GitHub token
      to avoid GitHub throttling your requests during the predeploy stage.


Now you can run it locally:

[source,shell]
----
npm start
----

This should open https://localhost:3000/rspec in your default browser with the rule search page.
