A modern, real-time web dashboard for monitoring NM Miner devices. Built with Node.js, Express, and EJS following the MVC pattern.
- Real-time monitoring - Auto-refreshes every 5 seconds
- Responsive design - Works on desktop and mobile devices
- Connection status indicator - Shows online/offline status
- Clean MVC architecture - Organized and maintainable code
- Modern UI - Dark theme with intuitive layout
- Error handling - Graceful handling of connection issues
- ⚡ Mining Status - Uptime, hash rate, and board type
- 🏊 Pool Information - Pool details, shares, and validation
- 📊 Difficulty Stats - Network and pool difficulty metrics
- 📡 System Info - Signal strength and memory usage
- Node.js (v14 or higher)
- npm or yarn
- Access to NM Miner device at
http://<ip address>/data
-
Clone the repository
git clone <repository-url> cd nmminer-ui
-
Install dependencies
npm install
-
Configure the application
# Copy the example environment file cp .env.example .env # Edit the .env file with your miner's IP address nano .env
-
Start the application
# Development mode (with auto-reload) npm run dev # Production mode npm start
-
Open your browser Navigate to
http://localhost:3000
nmminer-ui/
├── controllers/
│ └── minerController.js # Request handling logic
├── models/
│ └── minerModel.js # Data fetching and processing
├── routes/
│ └── minerRoutes.js # Route definitions
├── views/
│ └── dashboard.ejs # HTML template
├── public/
│ ├── css/
│ │ └── dashboard.css # Stylesheet
│ └── js/
│ └── dashboard.js # Client-side JavaScript
├── app.js # Main application file
├── package.json # Dependencies and scripts
└── README.md # This file
GET /- Main dashboard pageGET /api/data- JSON API endpoint for miner data
Create a .env file in the root directory to configure the application:
# Copy the example file
cp .env.example .envEdit the .env file with your settings:
# Miner Configuration
MINER_IP=192.168.0.61
MINER_PORT=80
MINER_ENDPOINT=/data
MINER_TIMEOUT=5000
# Server Configuration
PORT=3000
# UI Configuration
REFRESH_INTERVAL=5000| Variable | Description | Default |
|---|---|---|
MINER_IP |
IP address of your NM Miner device | 192.168.0.61 |
MINER_PORT |
Port of the miner web interface | 80 |
MINER_ENDPOINT |
API endpoint for miner data | /data |
MINER_TIMEOUT |
Request timeout in milliseconds | 5000 |
PORT |
Server port for the dashboard | 3000 |
REFRESH_INTERVAL |
Auto-refresh interval in milliseconds | 5000 |
Via command line:
MINER_IP=192.168.1.100 PORT=8080 npm startVia code (config/config.js):
Edit the default values in /config/config.js if you prefer not to use environment variables.
The dashboard expects JSON data in the following format:
{
"timeMining": "00d 18:09:07",
"boardtype": "cyd 2.8",
"hashRate": "1.0066MH/s",
"pool": "pool.tazmining.ch:3343",
"shares": "69/5308 (98.7%)",
"netDiff": "117.0T",
"poolDiff": "0.0035",
"lastDiff": "0.0077",
"bestDiff": "88.221",
"valid": "0",
"rssi": "-63dBm",
"freeHeap": "63.211KB"
}npm run devThis uses nodemon for automatic server restart on file changes.
- Models (
/models/) - Handle data fetching and processing - Controllers (
/controllers/) - Handle HTTP requests and responses - Views (
/views/) - EJS templates for rendering HTML - Routes (
/routes/) - Define application endpoints - Public (
/public/) - Static assets (CSS, JavaScript, images)
- Verify the miner device is accessible at the configured URL
- Check network connectivity to the miner
- Ensure the miner's
/dataendpoint is working
# Kill process using port 3000
sudo lsof -ti:3000 | xargs kill -9
# Or use a different port
PORT=8080 npm start# Clean install
rm -rf node_modules package-lock.json
npm install- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the troubleshooting section above
- Review the console logs for error messages
- Verify your miner device is responding correctly
- Open an issue in the repository