React frontend for HospitalRun: free software for developing world hospitals.
Version 1.0.0-beta is no longer supported. Version 2 is currently under development.
- To contribute, follow the guidelines in the readme or alternatively ask for details on Slack channel #contributors.
- To use version 1.0.0-beta (not production ready) in a hospital facility, ask for support on Slack channel #troubleshooting.
Contributions are always welcome. Before contributing please read our contributor guide.
- Fork this repository to your own GitHub account and then clone it to your local device
- Navigate to the cloned folder:
- Install the dependencies:
yarn run startto build and watch for code changes
Online one-click setup for contributing
Contribute to HospitalRun using a fully featured online development environment that will automatically: clone the repo, install the dependencies and start the webserver.
Connecting to HospitalRun Server
Note: The following instructions are for connecting to HospitalRun Server during development and are not intended to be for production use. For production deployments, see the deployment instructions.
- Configure HospitalRun Server
- Start the HospitalRun Development Server
- Copy the
- Change the
REACT_APP_HOSPITALRUN_APIvariable to point to the HospitalRun Development Server.
Potential Setup Issues
Some developers have reported the following errors and the corresponding fixes
Problem with Project Dependency Tree
There might be a problem with the project dependency tree. It is likely not a bug in Create React App, but something you need to fix locally. The react-scripts package provided by Create React App requires a dependency: "babel-loader": "8.1.0" Don't try to install it manually: your package manager does it automatically. However, a different version of babel-loader was detected higher up in the tree: /path/to/hospitalrun/node_modules/babel-loader (version: 8.0.6) Manually installing incompatible versions is known to cause hard-to-debug issues. If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project. That will permanently disable this message but you might encounter other issues. To fix the dependency tree, try following the steps below in the exact order: 1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder. 2. Delete node_modules in your project folder. 3. Remove "babel-loader" from dependencies and/or devDependencies in the package.json file in your project folder. 4. Run npm install or yarn, depending on the package manager you use.
To fix this issue, add
SKIP_PREFLIGHT_CHECK=true to the
Running Tests and Linter
yarn test:ci will run the entire test suite
yarn test will run the test suite in watch mode
yarn lint will run the linter
yarn lint:fix will run the linter and fix fixable errors
Useful Developer Tools
Working on an Issue
In order to optimize the workflow and to prevent multiple contributors working on the same issue without interactions, a contributor must ask to be assigned to an issue by one of the core team members: it's enough to ask it inside the specific issue.
How to commit
This repo uses Conventional Commits. Commitizen is mandatory for making proper commits. Once you have staged your changes, can run
npm run commit or
yarn commit from the root directory in order to commit following our standards.
Cross-browser Testing Platform and Open Source <3 Provided by Sauce Labs
Released under the MIT license.