Skip to content

Commit d8a948c

Browse files
authored
Merge pull request #7 from PepperDash/feature/add-svgs
Feature/add svgs
2 parents c531be0 + e393f72 commit d8a948c

178 files changed

Lines changed: 12910 additions & 30562 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yaml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Build React Application
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
newVersion:
7+
description: 'new version?'
8+
required: true
9+
type: string
10+
version:
11+
description: 'The version of the file to build and push'
12+
required: true
13+
type: string
14+
tag:
15+
description: 'The tag of the image to build and push'
16+
required: true
17+
type: string
18+
channel:
19+
description: 'The channel of the image to build and push'
20+
required: true
21+
type: string
22+
jobs:
23+
Build:
24+
runs-on: ubuntu-latest
25+
permissions:
26+
id-token: write
27+
contents: write
28+
steps:
29+
- name: Checkout Repo
30+
uses: actions/checkout@v4
31+
- name: Use Node 22
32+
uses: actions/setup-node@v4
33+
with:
34+
cache: npm
35+
node-version: '22'
36+
registry-url: 'https://npm.pkg.github.com'
37+
- name: Set package.json version
38+
run: |
39+
if [ '${{ inputs.newVersion }}' = 'true' ]; then
40+
echo "Setting package.json version to ${{ inputs.version }}"
41+
npm version ${{ inputs.version }} --no-git-tag-version
42+
else
43+
echo "Not setting package.json version"
44+
fi
45+
- name: Install Packages
46+
run: |
47+
npm ci
48+
- name: Build App
49+
id: build
50+
run: |
51+
# Enable pipefail to ensure the step fails if npm build fails
52+
set -o pipefail
53+
54+
echo "## Build Output" >> $GITHUB_STEP_SUMMARY
55+
echo "" >> $GITHUB_STEP_SUMMARY
56+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
57+
58+
# Run build and capture output, but handle failure gracefully for summary
59+
if npm run build 2>&1 | tee build_output.log; then
60+
echo "Build completed successfully"
61+
else
62+
echo "Build failed - capturing output for summary"
63+
fi
64+
65+
# Always add the build output to summary (success or failure)
66+
sed 's/\x1b\[[0-9;]*m//g' build_output.log >> $GITHUB_STEP_SUMMARY
67+
echo "" >> $GITHUB_STEP_SUMMARY
68+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
69+
70+
# Check if build actually failed and exit with error code
71+
if [ ! -d "dist" ]; then
72+
echo "Build failed - dist directory not created"
73+
exit 1
74+
fi
75+
- name: Clean up after failed build
76+
if: failure() && steps.build.conclusion == 'failure'
77+
run: |
78+
git push origin --delete ${{ inputs.tag }}
79+
80+
echo "" >> $GITHUB_STEP_SUMMARY
81+
echo "---" >> $GITHUB_STEP_SUMMARY
82+
echo "## Build Result" >> $GITHUB_STEP_SUMMARY
83+
echo "" >> $GITHUB_STEP_SUMMARY
84+
echo "❌ **BUILD FAILED**" >> $GITHUB_STEP_SUMMARY
85+
echo "" >> $GITHUB_STEP_SUMMARY
86+
echo "The build output above shows the specific errors that caused the build to fail." >> $GITHUB_STEP_SUMMARY
87+
- name: Archive Output
88+
if: success()
89+
id: package
90+
run: |
91+
cd dist
92+
branch=${GITHUB_REF#refs/heads/}
93+
repo_name=${GITHUB_REPOSITORY#*/}
94+
95+
if [ '${{ inputs.newVersion }}' = 'true' ]; then
96+
filename=${repo_name}-${{ inputs.tag }}.zip
97+
else
98+
filename=${repo_name}-${branch//\//-}.zip
99+
fi
100+
101+
zip -r ../$filename .
102+
echo "filename=${filename}" >> $GITHUB_OUTPUT
103+
- name: Get release notes
104+
if: success() && inputs.newVersion == 'true'
105+
uses: actions/download-artifact@v4
106+
with:
107+
name: change-log
108+
- name: Create Release
109+
id: create_release
110+
if: success() && inputs.newVersion == 'true'
111+
uses: ncipollo/release-action@v1
112+
with:
113+
artifacts: './${{ steps.package.outputs.filename }}'
114+
bodyFile: ./CHANGELOG.md
115+
prerelease: ${{ inputs.channel != '' }}
116+
tag: ${{ inputs.tag }}
117+
commit: ${{ github.sha }}
118+
allowUpdates: true

.github/workflows/ci.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Build Application
2+
on:
3+
push:
4+
branches:
5+
- '**'
6+
jobs:
7+
getVersion:
8+
uses: PepperDash/workflow-templates/.github/workflows/essentialsplugins-getversion.yml@main
9+
secrets: inherit
10+
build:
11+
uses: PepperDash/workflow-templates/.github/workflows/react-app-build.yml@main
12+
secrets: inherit
13+
needs: getVersion
14+
with:
15+
newVersion: ${{ needs.getVersion.outputs.newVersion }}
16+
version: ${{ needs.getVersion.outputs.version }}
17+
tag: ${{ needs.getVersion.outputs.tag }}
18+
channel: ${{ needs.getVersion.outputs.channel }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
# production
1212
/build
13+
/dist
1314

1415
# misc
1516
.DS_Store
@@ -21,3 +22,5 @@
2122
npm-debug.log*
2223
yarn-debug.log*
2324
yarn-error.log*
25+
dist/assets/index-C_SGWbYA.js
26+
tsconfig.tsbuildinfo

.releaserc.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"plugins": [
3+
[
4+
"@semantic-release/commit-analyzer",
5+
{
6+
"releaseRules": [
7+
{ "scope": "force-patch", "release": "patch" },
8+
{ "scope": "no-release", "release": false }
9+
]
10+
}
11+
],
12+
"@semantic-release/release-notes-generator",
13+
["@semantic-release/changelog",
14+
{
15+
"changelogFile": "CHANGELOG.md"
16+
}
17+
],
18+
[
19+
"@semantic-release/exec",
20+
{
21+
"verifyReleaseCmd": "echo \"newVersion=true\" >> $GITHUB_OUTPUT",
22+
"publishCmd": "echo \"version=${nextRelease.version}\" >> $GITHUB_OUTPUT && echo \"tag=${nextRelease.gitTag}\" >> $GITHUB_OUTPUT && echo \"type=${nextRelease.type}\" >> $GITHUB_OUTPUT && echo \"channel=${nextRelease.channel}\" >> $GITHUB_OUTPUT"
23+
}
24+
]
25+
],
26+
"branches": [
27+
"main",
28+
{"name": "development", "prerelease": "beta", "channel": "beta"},
29+
{"name": "release", "prerelease": "rc", "channel": "rc"},
30+
{
31+
"name": "replace-me-feature-branch",
32+
"prerelease": "replace-me-prerelease",
33+
"channel": "replace-me-prerelease"
34+
}
35+
]
36+
}

README.md

Lines changed: 160 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,180 @@
1-
# Getting Started with Create React App
1+
# PepperDash Essentials Web Config App
22

3-
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
3+
A powerful web-based configuration and debugging tool for PepperDash Essentials systems. This React application provides real-time system monitoring, configuration management, and troubleshooting capabilities through an intuitive web interface.
44

5-
## Available Scripts
5+
## 🚀 Quick Start
66

7-
In the project directory, you can run:
7+
### For Users
8+
**New to the application?** Start with the [Getting Started Tutorial](./docs/tutorials/getting-started.md) for a guided introduction.
89

9-
### `npm start`
10+
**Need to solve a specific problem?** Check the [How-to Guides](./docs/how-to/) for step-by-step solutions.
1011

11-
Runs the app in the development mode.\
12-
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
12+
### For Developers
13+
**Setting up the development environment:**
1314

14-
The page will reload if you make edits.\
15-
You will also see any lint errors in the console.
15+
```bash
16+
# Install dependencies
17+
npm install
1618

17-
### `npm test`
19+
# Create a .env.local file in the project root with your target processor:
20+
# PROGRAM_HOST=https://your-processor-ip
21+
# VITE_PROGRAM_ID=app01
1822

19-
Launches the test runner in the interactive watch mode.\
20-
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
23+
# Start development server
24+
npm run start
25+
```
2126

22-
### `npm run build`
27+
The app will be available at `http://localhost:5173/cws/debug/`.
2328

24-
Builds the app for production to the `build` folder.\
25-
It correctly bundles React in production mode and optimizes the build for the best performance.
29+
## 📚 Documentation
2630

27-
The build is minified and the filenames include the hashes.\
28-
Your app is ready to be deployed!
31+
This project uses the [Diataxis framework](https://diataxis.fr/) to provide you with the right information at the right time:
2932

30-
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
33+
### 🎯 [Tutorials](./docs/tutorials/) - Learning-oriented
34+
**"Take me by the hand and teach me"**
35+
- [Getting Started Tutorial](./docs/tutorials/getting-started.md) - Your first steps with the web config app
36+
- [Debug Console Tutorial](./docs/tutorials/debug-console-basics.md) - Master the debug console
37+
- [Device Management Tutorial](./docs/tutorials/device-management-basics.md) - Device inspection and management
3138

32-
### `npm run eject`
39+
### 🔧 [How-to Guides](./docs/how-to/) - Problem-oriented
40+
**"Show me how to solve this specific problem"**
41+
- [Troubleshooting Connection Issues](./docs/how-to/troubleshoot-connection.md)
42+
- [Filter and Search Debug Messages](./docs/how-to/filter-debug-messages.md)
43+
- [Export and Analyze Configuration](./docs/how-to/export-configuration.md)
44+
- [Monitor System Performance](./docs/how-to/monitor-performance.md)
45+
- [Restart and Reload Configuration](./docs/how-to/restart-reload-config.md)
3346

34-
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
47+
### 📚 [Reference](./docs/reference/) - Information-oriented
48+
**"Tell me the facts"**
49+
- [UI Components Reference](./docs/reference/ui-components.md) - Complete component documentation
50+
- [API Endpoints Reference](./docs/reference/api-endpoints.md) - All available REST endpoints
51+
- [Configuration Schema Reference](./docs/reference/configuration-schema.md) - Configuration file structure
52+
- [Device Types Reference](./docs/reference/device-types.md) - Supported device types and properties
53+
- [Log Levels and Filters Reference](./docs/reference/log-levels.md) - Complete logging reference
3554

36-
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
55+
### 💡 [Explanation](./docs/explanation/) - Understanding-oriented
56+
**"Help me understand why and how this works"**
57+
- [System Architecture](./docs/explanation/architecture.md) - How the web app integrates with Essentials
58+
- [Debug Console Design](./docs/explanation/debug-console-design.md) - How real-time debugging works
59+
- [Configuration Management](./docs/explanation/configuration-management.md) - How configuration is handled
60+
- [Security Considerations](./docs/explanation/security.md) - Security model and best practices
3761

38-
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
62+
## ✨ Key Features
3963

40-
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
64+
- **🔍 Real-Time Debug Console**: Monitor system behavior with live message streaming
65+
- **⚙️ Device Management**: Inspect and understand configured devices
66+
- **📄 Configuration Viewer**: View and analyze complete system configuration
67+
- **📦 Version Information**: Check loaded assemblies and software versions
68+
- **🏷️ Type Registry**: Browse supported device types and capabilities
69+
- **🔄 System Control**: Restart system and reload configuration safely
4170

42-
## Learn More
71+
## 🛠️ Development
4372

44-
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
73+
### Available Scripts
4574

46-
To learn React, check out the [React documentation](https://reactjs.org/).
75+
#### `npm start`
76+
Runs the app in development mode via Vite. The page will reload when you make edits. Available at `http://localhost:5173/cws/debug/`.
77+
78+
#### `npm test`
79+
Launches the Vitest test runner in interactive watch mode.
80+
81+
#### `npm run build`
82+
Compiles TypeScript and builds the app for production to the `dist/` folder with optimized bundles.
83+
84+
#### `npm run preview`
85+
Serves the production build locally for inspection before deployment.
86+
87+
### Environment Setup
88+
89+
Create a `.env.local` file in the project root (never commit this file):
90+
91+
```dotenv
92+
PROGRAM_HOST=https://your-processor-ip # Required: Target processor IP
93+
VITE_PROGRAM_ID=app01 # Optional: Default application slot
94+
```
95+
96+
**Development Prerequisites:**
97+
- Node.js 18+
98+
- npm
99+
- Network access to target PepperDash Essentials processor
100+
- Modern web browser
101+
102+
### Architecture Overview
103+
104+
**Frontend Stack:**
105+
- React 19 with TypeScript
106+
- Redux Toolkit for state management (including WebSocket middleware)
107+
- React Router v7 for navigation
108+
- Bootstrap 5 for UI components
109+
- WebSocket for real-time communication
110+
111+
**Integration:**
112+
- Connects to PepperDash Essentials processors via HTTPS API at `/cws/<appId>/api/`
113+
- Uses WebSocket for real-time debug message streaming
114+
- In development, Vite proxies all `/cws/` API requests to `PROGRAM_HOST`
115+
- In production, served as static files from the processor's built-in web server at `/cws/debug/`
116+
117+
## 🔐 Security Considerations
118+
119+
- **HTTPS Required**: All communication encrypted
120+
- **Self-Signed Certificates**: Common for internal network devices; must be accepted in the browser before use
121+
- **Processor Authentication**: Leverages processor's built-in security
122+
- **Network-Level Security**: Relies on internal network protection
123+
124+
## 🌐 Browser Compatibility
125+
126+
**Supported Browsers:**
127+
- Chrome 70+
128+
- Firefox 65+
129+
- Safari 12+
130+
- Edge 79+
131+
132+
**Required Features:**
133+
- WebSocket support for real-time debugging
134+
- Modern JavaScript (ES6+) support
135+
- CSS Grid and Flexbox for responsive layouts
136+
137+
## 📖 Learning Resources
138+
139+
**New Users:**
140+
1. Start with [Getting Started Tutorial](./docs/tutorials/getting-started.md)
141+
2. Learn [Debug Console Basics](./docs/tutorials/debug-console-basics.md)
142+
3. Explore [Device Management](./docs/tutorials/device-management-basics.md)
143+
144+
**Troubleshooting:**
145+
- Check [How-to Guides](./docs/how-to/) for specific solutions
146+
- Review [Connection Troubleshooting](./docs/how-to/troubleshoot-connection.md) for access issues
147+
- Use [Performance Monitoring](./docs/how-to/monitor-performance.md) for system health
148+
149+
**Advanced Usage:**
150+
- Understand [System Architecture](./docs/explanation/architecture.md)
151+
- Learn [Debug Console Design](./docs/explanation/debug-console-design.md)
152+
- Reference [API Documentation](./docs/reference/api-endpoints.md)
153+
154+
## 🤝 Contributing
155+
156+
This project follows standard React development practices:
157+
- TypeScript for type safety
158+
- ESLint and Prettier for code formatting
159+
- Component-based architecture with feature organization
160+
- Redux Toolkit for predictable state management
161+
162+
## 📄 License
163+
164+
MIT License - see [LICENSE](./LICENSE) file for details.
165+
166+
## 🆘 Support
167+
168+
**For Application Issues:**
169+
- Check the [How-to Guides](./docs/how-to/) for common solutions
170+
- Review system requirements and browser compatibility
171+
- Verify network connectivity to target processor
172+
173+
**For PepperDash Essentials Questions:**
174+
- Consult PepperDash documentation and support resources
175+
- Verify Essentials framework version compatibility
176+
- Check processor configuration and network settings
177+
178+
---
179+
180+
*Built with ❤️ for the PepperDash community. This web application makes PepperDash Essentials systems more accessible and manageable through modern web interfaces.*

README.old.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)