Skip to content

Commit

Permalink
Merge pull request #1 from DUDEbehindDUDE/main
Browse files Browse the repository at this point in the history
Setup Project & react app
  • Loading branch information
DUDEbehindDUDE authored Nov 19, 2024
2 parents 8492153 + 0348cad commit 5d4fa78
Show file tree
Hide file tree
Showing 24 changed files with 10,366 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/ISSUE_TEMPLATE/1-bug-report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Bug Report
description: File a bug report.
title: "[Bug] "
labels: ["bug"]
projects: ["Gold-Rush-Robotics/2"]
assignees:
- dudebehinddude # assign it to PM to get a notif to sort/categorize it
body:
- type: input
id: what
attributes:
label: WHAT IS ISSUE
description: What is wrong
placeholder: It's not working...
validations:
required: true
- type: textarea
id: how
attributes:
label: HOW DID HAPPEN
description: What happened to make the issue appear? The more detailed your breakdown is the easier it is to reproduce/debug/fix
placeholder: |
1. Turned on robot
2. Robot moved
3. Error happened
validations:
required: true
- type: dropdown
id: priority
attributes:
label: Priority
description: How important is it that this issue gets fixed? (Take your best guess)
options:
- High (blocking major development)
- Medium
- Low
validations:
required: true
- type: textarea
id: misc
attributes:
label: OTHER INFORMATION
description: Attach other useful information (i.e., a video of what happened) here. The more info we have the easier it should be to fix.
placeholder: "Here is a video of what is happening: (you can click here and drag and drop or paste to upload media)"
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/2-feature-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Feature Request
description: Request something to be added to the robot
title: "[Request] "
labels: ["enhancement"]
projects: ["Gold-Rush-Robotics/2"]
assignees:
- dudebehinddude # assign it to PM to get a notif to sort/categorize it
body:
- type: textarea
id: what
attributes:
label: WHAT IS REQUEST
description: What do you want to add/request?
placeholder: I need the robot to do this...
validations:
required: true
- type: dropdown
id: priority
attributes:
label: Priority
description: How important is it that this gets implemented? (Take your best guess)
options:
- High (blocking major development)
- Medium
- Low
validations:
required: true
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#https://nodejs.org/en/about/previous-releases
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Yarn CI

on:
push:
branches: ["*"]
pull_request:
branches: ["*"]

defaults:
run:
working-directory: react

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/previous-releases/
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
cache-dependency-path: react/yarn.lock
- run: yarn
- run: npx prettier . --check
- run: yarn build --if-present
- run: yarn test
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# HMI (Human-Machine Interface)

The **Human-Machine Interface (HMI)** is designed to facilitate interaction between human operators and the robot. This layer will provide a user-friendly interface for monitoring and controlling robot functions, enabling efficient and accurate commands to be sent to the robot.

## Goal 🏆️

The goal of this project is to create an intuitive and reliable interface that allows for straightforward control and monitoring of the robot’s functions. By standardizing communication methods and display components, the HMI aims to simplify operator interaction with the robot, ensuring flexibility for both current and future use cases.

## Overview ℹ️

This repository currently uses **React** to build a responsive and dynamic interface. React will be used to display input options and such on the touchscreen on the robot. In the future, this should also allow for being able to connect to the robot via a tablet or laptop to get more advanced information. As development progresses, additional tools such as ROS and Flask are probably going to be integrated to allow for direct communication with the robot.

## Build instructions 🛠️

> [!NOTE]
> This section will be updated as code gets added to this repository.
### Prerequisites

You will need to install:

- NodeJS
- Yarn

### Building

Running `yarn build` will generate an optimized production build of the react app. If any errors occur, try running `yarn install` first.

## Development instructions 💻️

> [!IMPORTANT]
> This project was made with yarn, please do not use npm!
- This section will be updated as code gets added to this repository.

## Structure 🗃️

- This section will be updated as code gets added to this repository.

## License ⚖️

This repository is licensed under the MIT License. See the [LICENSE](https://github.com/Gold-Rush-Robotics/hmi/blob/main/LICENSE) for more info.
23 changes: 23 additions & 0 deletions react/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
47 changes: 47 additions & 0 deletions react/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "hmi",
"version": "0.1.0",
"private": true,
"dependencies": {
"@tanstack/react-query": "^5.60.5",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^13.0.0",
"@testing-library/user-event": "^13.2.1",
"@types/jest": "^27.0.1",
"@types/node": "^16.7.13",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-scripts": "5.0.1",
"typescript": "^4.4.2",
"web-vitals": "^2.1.0"
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Binary file added react/public/favicon.ico
Binary file not shown.
43 changes: 43 additions & 0 deletions react/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
Binary file added react/public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added react/public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions react/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
3 changes: 3 additions & 0 deletions react/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
38 changes: 38 additions & 0 deletions react/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.App {
text-align: center;
}

.App-logo {
height: 40vmin;
pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}

.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.App-link {
color: #61dafb;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
9 changes: 9 additions & 0 deletions react/src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from "react";
import { render, screen } from "@testing-library/react";
import App from "./App";

test("renders learn react link", () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
26 changes: 26 additions & 0 deletions react/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from "react";
import logo from "./logo.svg";
import "./App.css";

function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.tsx</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
);
}

export default App;
13 changes: 13 additions & 0 deletions react/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}
Loading

0 comments on commit 5d4fa78

Please sign in to comment.