Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
*Thumbs.db
/data/www
/lib/framework/WWWData.h
/interface/build
/interface/dist
/interface/node_modules
/interface/.eslintcache
/interface/*.tsbuildinfo
.vscode
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ platformio run -t uploadfs

### Developing the interface locally

UI development is an iterative process so it's best to run a development server locally during interface development (using `npm start`). This can be accomplished by deploying the backend to a device and configuring the interface to point to it:
UI development is an iterative process so it's best to run a development server locally during interface development (using `npm run dev`). This can be accomplished by deploying the backend to a device and configuring the interface to point to it:

![Development Server](/media/devserver.png?raw=true "Development Server")

Expand All @@ -125,7 +125,7 @@ The following steps can get you up and running for local interface development:

#### Configuring the dev proxy

The interface has a development environment which is enabled when running the development server using `npm start`. The [package.json](interface/package.json) file defines the location of the services which the development server will proxy. This is defined by the "proxy" propery, which will need to be change to the the IP address or hostname of the device running the firmware.
The interface has a development environment which is enabled when running the development server using `npm run dev`. The [package.json](interface/package.json) file defines the location of the services which the development server will proxy. This is defined by the "proxy" propery, which will need to be change to the the IP address or hostname of the device running the firmware.

```json
"proxy": "http://192.168.0.77"
Expand All @@ -145,7 +145,7 @@ Install the npm dependencies, if required and start the development server:

```bash
npm install
npm start
npm run dev
```
> **Tip**: You can (optionally) speed up the build by commenting out the call to build_interface.py under "extra scripts" during local development. This will prevent the npm process from building the production release every time the firmware is compiled significantly decreasing the build time.

Expand Down Expand Up @@ -255,7 +255,7 @@ platform = espressif32
board = node32s
```

If you want to build for a different device, all you need to do is re-configure ['platformio.ini'](platformio.ini) and select an alternative environment by modifying the default_envs variable. Building for the common esp32 "node32s" board for example:
If you want to build for a different device, all you need to do is re-configure ['platformio.ini'](platformio.ini) and select an alternative environment by modifying the default_envs variable or choosing the desired device in the IDE. Building for the common esp32 "node32s" board for example:

```ini
[platformio]
Expand Down Expand Up @@ -661,8 +661,11 @@ esp8266React.getWiFiSettingsService()->addUpdateHandler(
## Libraries Used

* [React](https://reactjs.org/)
* [Vite](https://vite.dev/)
* [Material-UI](https://mui.com/)
* [notistack](https://github.com/iamhosseindhv/notistack)
* [ArduinoJson](https://github.com/bblanchon/ArduinoJson)
* [ESPAsyncWebServer](https://github.com/me-no-dev/ESPAsyncWebServer)
* [AsyncMqttClient](https://github.com/marvinroger/async-mqtt-client)
* [ESPAsyncTCP (ESP8266)](https://github.com/ESP32Async/ESPAsyncTCP)
* [AsyncTCP (ESP32)](https://github.com/ESP32Async/AsyncTCP)
* [ESPAsyncWebServer](https://github.com/ESP32Async/ESPAsyncWebServer)
* [espMqttClient](https://github.com/bertmelis/espMqttClient)
7 changes: 2 additions & 5 deletions interface/.env
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# This enables lint extensions
EXTEND_ESLINT=true

# This is the name of your project. It appears on the sign-in page and in the menu bar.
REACT_APP_PROJECT_NAME=ESP8266 React
VITE_PROJECT_NAME=ESP8266 React

# This is the url path your project will be exposed under.
REACT_APP_PROJECT_PATH=project
VITE_PROJECT_PATH=project
2 changes: 0 additions & 2 deletions interface/.env.production

This file was deleted.

28 changes: 0 additions & 28 deletions interface/config-overrides.js

This file was deleted.

77 changes: 77 additions & 0 deletions interface/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@

import { defineConfig } from 'eslint/config';

import js from '@eslint/js'
import tseslint from 'typescript-eslint';
import globals from 'globals'

import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import stylistic from '@stylistic/eslint-plugin'

export default defineConfig([
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
'@stylistic': stylistic
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'eol-last': 1,
'@stylistic/member-delimiter-style': 1,
'@stylistic/jsx-closing-bracket-location': 1,
'@stylistic/jsx-closing-tag-location': 1,
'@stylistic/jsx-wrap-multilines': 1,
'@stylistic/jsx-curly-newline': 1,
'@stylistic/jsx-max-props-per-line': [1, { when: 'multiline' }],
'@stylistic/jsx-first-prop-new-line': [1, 'multiline'],
"@stylistic/no-mixed-operators": [
"warn",
{
"groups": [
["&&", "||"]
],
"allowSamePrecedence": true
}
],

'no-multiple-empty-lines': [1, { max: 1 }],
'no-trailing-spaces': 1,
'semi': 1,
'no-extra-semi': 1,
'no-shadow': 1,
'max-len': [1, { code: 140 }],
'arrow-parens': 1,
'curly': [1, 'all'],

// disable rules which have been enabled by typescript-eslint's recommended config
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-empty-object-type": 0,
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_",
"ignoreRestSiblings": true
}
],
// FIXME: Re-enable and address react-hooks/set-state-in-effect linting rule
// turning this off for now, we need to find better patterns in a few places
// so this can be re-enabled
"react-hooks/set-state-in-effect": "off"
},
},
]);
5 changes: 3 additions & 2 deletions interface/public/index.html → interface/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0, maximum-scale=1, minimum-scale=1">
<link rel="stylesheet" href="%PUBLIC_URL%/css/roboto.css">
<link rel="manifest" href="%PUBLIC_URL%/app/manifest.json">
<link rel="stylesheet" href="/css/roboto.css">
<link rel="manifest" href="/app/manifest.json">
<title>ESP8266 React</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
Loading