- System status monitoring (Network, Internal, Hardware services)
- Mining pool metrics display
- Daily and monthly power consumption charts (from Prometheus)
- Battery configuration management
- Responsive and modern user interface
- Go: Primary language
- Gin Web Framework: For routing and API handling
- Prometheus: For time-series data storage and retrieval (power metrics)
- React: JavaScript library for building user interfaces
- TypeScript: Superset of JavaScript that adds static typing
- Vite: Fast frontend build tool
- Shadcn/ui: Reusable UI components built with Radix UI and Tailwind CSS
- Recharts: Composable charting library built with React
- Tailwind CSS: Utility-first CSS framework
To get this project up and running on your local machine, follow these steps:
Make sure you have the following installed:
- Go: Version 1.18 or higher (https://go.dev/doc/install)
- Node.js: Version 18 or higher (https://nodejs.org/en/download/)
- npm or bun: Package manager for Node.js (npm comes with Node.js, bun: https://bun.sh/docs/installation)
- Prometheus: Running and collecting metrics, specifically
bluecollar_aux_current_sensor(This project expects Prometheus to be accessible athttp://localhost:9090). - bluecollar core services: The Go backend communicates with other
bluecollarservices via a Unix socket at/tmp/bluecollar.sockand manages systemd services likebluecollarSerial,bluecollarCore, andNetworkManager. These services should be set up and running on your system for full functionality.
- Navigate to the root directory of the project:
cd /path/to/your/project/webGUI - Download the Go modules:
go mod tidy
- Build the Go application:
This will create an executable named
go build -o ~/webguiwebguiin the root directory.
- Navigate to the
staticdirectory:cd /path/to/your/project/webGUI/static - Install the Node.js dependencies using npm (or bun):
npm install # OR bun install - Build the frontend for production:
This will create a
npm run build # OR bun run builddistdirectory insidestatic, containing the optimized static assets for the frontend.
-
Ensure you have built both the backend and frontend as described in the "Setup" section.
-
From the project's root directory (
/path/to/your/project/webGUI), run the Go backend executable:./webgui
The application will start on port 8080 (e.g.,
http://localhost:8080).
You can now access the BlueCollar Web GUI in your web browser.
-
Create and edit service file:
sudo nano /etc/systemd/system/juakaliSerial.service
-
Add the following to the file:
[Unit] Description=Jua kali web service After=network.target [Service] ExecStart=/home/{USER_NAME}/juakaliWeb Type=simple Restart=on-failure RestartSec=5s [Install] WantedBy=multi-user.target -
Enable and start the service:
sudo systemctl daemon-reload sudo systemctl enable juakaliWeb sudo systemctl start juakaliWeb -
Check if the service is running:
sudo systemctl status juakaliWeb
If you are working on the frontend, you can start the Vite development server for hot-reloading:
- Navigate to the
staticdirectory:cd /path/to/your/project/webGUI/static - Start the development server:
This will typically serve the frontend on
npm run dev # OR bun run devhttp://localhost:5173. Note that when the Vite dev server is running, the Go backend will serve theindex.htmlfrom thestatic/directory, but the frontend assets will be requested from the Vite dev server.
To run the linter for the frontend:
- Navigate to the
staticdirectory:cd /path/to/your/project/webGUI/static - Run the lint command:
npm run lint # OR bun run lint