Prerequisites
Before you begin, ensure you have:- Node.js >= 20
- Yarn package manager
- Git for version control
MQTT Explorer requires Node.js 20 or higher. Check your version with
node --version.Quick Start with GitHub Codespaces
The fastest way to start developing is with GitHub Codespaces, which includes a pre-configured environment with Node.js and an MQTT broker:Open Codespaces
- Click the green “Code” button on the repository
- Select the “Codespaces” tab
- Click “Create codespace on [branch]”
Wait for Setup
The devcontainer will automatically install dependencies and start services. This takes 2-3 minutes.
Local Development Setup
Initial Setup
Development Modes
MQTT Explorer supports two development modes: Desktop (Electron) and Browser.Desktop Application (Electron)
Develop the native desktop application with hot reload:- App dev server - React frontend with hot reload
- Electron process - Desktop window
The
yarn dev command uses npm-run-all to run dev:app and dev:electron in parallel.Browser Mode (Web Application)
Develop the web version served by Node.js:http://localhost:3000 in your browser.
This runs:
- Webpack dev server - React frontend with hot reload (port 3000)
- Node.js backend - Express server with Socket.IO
Project Structure
Key directories:
app/- All UI and rendering logicbackend/- Models, tests, connection managementsrc/- Electron bindings and Node.js serverscripts/- Build and release automation
Available Scripts
Development
| Command | Description |
|---|---|
yarn dev | Start Electron app in development mode |
yarn dev:server | Start browser mode with hot reload |
yarn dev:app | Run only the frontend dev server |
yarn dev:electron | Run only Electron (after building) |
Building
| Command | Description |
|---|---|
yarn build | Build desktop application |
yarn build:server | Build browser mode for production |
yarn start | Start built Electron app |
yarn start:server | Start built Node.js server |
Testing
| Command | Description |
|---|---|
yarn test | Run all unit tests |
yarn test:app | Run frontend tests |
yarn test:backend | Run backend tests |
yarn test:ui | Run UI automation tests |
First Build
Verify your setup by building the application:Build failures? Check:
- Node.js version (
node --version>= 20) - Clean install:
rm -rf node_modules && yarn - TypeScript errors:
npx tsc --noEmit
Development Workflow
A typical development session:Setting Up an MQTT Broker
For testing, you’ll need an MQTT broker. The easiest option:localhost:1883 in MQTT Explorer.
Next Steps
Architecture
Understand the codebase structure and design patterns
Testing
Learn how to write and run tests
Styling
Follow Material-UI theming conventions
Contributing
Submit your first pull request
Troubleshooting
Port Already in Use
Dependencies Out of Sync
TypeScript Errors
Electron Won’t Start
Getting Help
- Issues: github.com/thomasnordquist/mqtt-explorer/issues
- Discussions: GitHub Discussions
- Documentation: mqtt-explorer.com