|
| 1 | +# Feeding Web Interface |
| 2 | + |
| 3 | +This directory contains the web app that users use to interact with the robot-assisted feeding system. This readme includes an overview and contribution guidelines, while [TechDocumentation.md](https://github.com/personalrobotics/feeding_web_interface/blob/2023PreDeployment/feedingwebapp/TechDocumentation.md) includes more specific documentation of the technical aspects of the app. |
| 4 | + |
| 5 | +## Overview |
| 6 | +The overall user flow for this robot can be seen below. |
| 7 | + |
| 8 | + |
| 9 | +(Last Updated 2023/03/07) |
| 10 | +<!--  |
| 11 | +(Last Updated 2022/09/20) --> |
| 12 | + |
| 13 | +## Dependencies |
| 14 | +- [`npm`](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) |
| 15 | +<!-- - [ROS](http://wiki.ros.org/noetic/Installation) --> |
| 16 | + |
| 17 | +## Getting Started |
| 18 | + |
| 19 | +### Installation |
| 20 | +1. Clone the repo: `git clone [email protected]:personalrobotics/feeding_web_interface.git` using SSH, or `git clone https://github.com/personalrobotics/feeding_web_interface.git` using HTTPS |
| 21 | +2. `cd {PATH TO feeding_web_interface}/feedingwebapp` |
| 22 | +3. Install all dependencies: `npm install --legacy-peer-deps` |
| 23 | + |
| 24 | +### Usage |
| 25 | +1. `cd {PATH TO feeding_web_interface}/feedingwebapp` |
| 26 | +2. Start the app: `npm start` |
| 27 | + - Note that if you're not running the robot code alongside the app, set [`debug = true` in `App.jsx`](https://github.com/personalrobotics/feeding_web_interface/blob/b8f5d970628bbaac43b8b9c7dbc4349ada2f32d7/feedingwebapp/src/App.jsx#L17) to be able to move past screens where the app is waiting on the robot. Since the robot is not yet connected, the default is `debug = true` |
| 28 | +3. Use a web browser to navigate to `localhost:3000` to see the application. |
| 29 | + |
| 30 | +## Contributing |
| 31 | + |
| 32 | +### Documenting Tasks |
| 33 | + |
| 34 | +All tasks should be tracked and documented as [Github Issues](https://github.com/personalrobotics/feeding_web_interface/issues). |
| 35 | + |
| 36 | +### Adding Dependencies |
| 37 | +Note that we use `npm`, not `yarn`, to manage dependencies for this project. |
| 38 | +- Dependencies added with `npm install ...` should automatically be added when you add `package.json` and `package-lock.json` to your branch. |
| 39 | +- Additional dependencies should be documented in this readme. |
| 40 | + |
| 41 | +### Writing Code |
| 42 | +- Generally, only work on code if there is a corresponding [Github Issue](https://github.com/personalrobotics/feeding_web_interface/issues) for it. |
| 43 | +- Every feature should be on its own branch, and generally only one person should be pushing to one branch. |
| 44 | +- Follow the below style guides: |
| 45 | + - [AirBnB React/JSX Style Guide](https://airbnb.io/javascript/react/). This was written before React hooks (e.g, `useState`); see [this for an example of how to order calls to various hooks](https://dev.to/abrahamlawson/react-style-guide-24pp#comment-1f4fd). |
| 46 | + - [AirBnB JavaScript Style Guide](https://airbnb.io/javascript/) for anything not covered in the above guide (e.g., variable naming conventions). |
| 47 | + - [React Styleguidist guide](https://react-styleguidist.js.org/docs/documenting/) for documenting code. Every function and component should be documented, and within functions there should be enough documentation that someone without knowledge of React can understand it. |
| 48 | +- Thoroughly test your feature: |
| 49 | + - Run `npm start`, ensure it has no warnings or errors. |
| 50 | + - Thoroughly test your feature, including all edge cases, to ensure it works as expected. This includes trying every combination of buttons/actions, even ones we don't expect users to use, to ensure there are no unaccounted for edge cases. |
| 51 | + - Ensure the [console](https://developer.chrome.com/docs/devtools/console/) has no errors. |
| 52 | + - Thoroughly test responsivity by changing browser/device size to ensure it renders as expected. |
| 53 | +- Before creating a Pull Request, run `npm format` and address any warnings or errors. |
| 54 | +- Create a Pull Request to merge your branch into `main`. You need at least one approving review to merge. |
| 55 | +- Squash all commits on your branch before merging into `main` to ensure a straightforward commit history. |
0 commit comments