This app renders search results from a Solr search index. It was developed as the front end to the search_api_federated_solr Drupal module. Read the sections below to learn how to use this app.
- Node.js
- Yarn
- An Apache Solr server
You’ll need to have Node version 6 or greater on your local development machine. You can use nvm (macOS/Linux) or nvm-windows to easily switch Node versions between different projects.
Yarn is used instead of Node Package Manager (NPM) for package management and running commands.
Yarn installation instructions
This project depends on configuring a Solr search server. The server can exist locally or hosted.
Note: If you are hosting the search server at a different domain, you may need to configure CORS support for Apache Solr. If this is not configured correctly, you may get notices in the browser console and the results will not be returned. See https://opensourceconnections.com/blog/2015/03/26/going-cross-origin-with-solr/ for some information on how that can be set up.
Run yarn install
from the repo root.
Create a src/.env.local.js
configuration file.
You can copy the src/.env.local.js.example example and edit the values provided.
Run yarn start
from the repo root to run the app in development mode.
It should automatically open http://localhost:3000 in a browser.
The page will automatically reload if you make changes to the code.
You will see the build errors and lint warnings in the console.
When you run the start script yarn start
, code quality (linting) tests are automatically run and feedback is provided in the terminal.
We recommend using linters to review your work.
ESLint is included and configured in .eslintrc
.
Note that even if you edit your .eslintrc
file further, these changes will only affect the editor integration. They won’t affect the terminal and in-browser lint output. This is because Create React App intentionally provides a minimal set of rules that find common mistakes.
Some editors, including Sublime Text, Atom, and Visual Studio Code, provide plugins for ESLint.
You should see the linter output right in your terminal as well as the browser console.
TODO
TODO
- Run
yarn build
to build the static assets and copy thepackage.json
file into thebuild/static
directory - Run
yarn deploy
to push the contents ofbuild/static
to themaster
branch of this repository - Run
yarn deploy tag
to push the contents ofbuild/static
to themaster
branch and tag it with the version listed inpackage.json
(be sure to bump as you see fit and commit that change before running this)
Deploying this package produces production-ready JS and CSS files that can be referenced in a project as external dependencies. For example:
- CSS:
https://cdn.jsdelivr.net/gh/palantirnet/federated-search-react@v1.0.10/css/main.cf6a58ce.css
- JS:
https://cdn.jsdelivr.net/gh/palantirnet/federated-search-react@v1.0.10/js/main.d41fc3fe.js
To update the package, increment the version number AND hash for each file based on the current release.
This project was created with the Create React App.
The original documentation is located at /docs/README.create-react-app.md.