Skip to content

feat(daemon): add full dashboard and daemon api improvements#6

Merged
adcondev merged 6 commits into
masterfrom
feat/tuis
Feb 4, 2026
Merged

feat(daemon): add full dashboard and daemon api improvements#6
adcondev merged 6 commits into
masterfrom
feat/tuis

Conversation

@adcondev

@adcondev adcondev commented Feb 4, 2026

Copy link
Copy Markdown
Owner

This pull request introduces major updates to documentation, code organization, and test coverage for the Scale Daemon project. The README has been extensively rewritten in Spanish to provide a more detailed and user-friendly overview, including architecture diagrams, configuration instructions, and feature highlights. Several files have been reorganized and renamed for clarity, and embedded resource handling has been standardized. Additionally, the test suite has been simplified by removing integration and memory leak tests, focusing on core functionality.

Documentation and User Guidance Improvements:

  • The README.md has been completely rewritten in Spanish, with expanded sections on architecture, concurrency model, WebSocket protocol, build configuration, project structure, and log management. It now includes diagrams, tables, and usage instructions tailored for retail/logistics environments.
  • The example HTML dashboard files have been renamed and updated to use the correct WebSocket endpoint (/ws), and configuration defaults now reflect the new endpoint. [1] [2] [3]

Embedded Resource and Build System Updates:

  • The resource embedding logic has been consolidated into a new embed.go file, which now uses Go's embed package to include both the service binary and web assets. Legacy and environment-specific embed files have been removed for simplicity. [1] [2] [3]
  • The legacy Windows batch file for dependency installation (init/deps.bat) has been removed, reflecting a shift towards modern Go and Taskfile-based build automation.

Test Suite Simplification:

  • The test suite in scale_installer_test.go has been significantly reduced: integration tests for WebSocket log status, verbose toggling, memory leak detection, and viewport resizing have been removed, as well as the log polling benchmark. This streamlines the test coverage to focus on essential functionality. [1] [2] [3] [4]
  • Unused imports related to concurrency and runtime have been removed from the test file, further simplifying the codebase.

Main Service Entry Point:

  • A new main.go entry point for BasculaServicio has been added, initializing build variables, seeding randomness for simulation mode, and starting the Windows service using the svc package.

@adcondev adcondev requested a review from Copilot February 4, 2026 17:15
@adcondev adcondev added bug Something isn't working enhancement New feature or request labels Feb 4, 2026
@adcondev adcondev moved this to In review in POS RED2000 Feb 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request represents a comprehensive refactoring of the Scale Daemon project, transforming a monolithic service into a well-structured, modular architecture with professional web dashboard integration. The changes introduce significant improvements in code organization, separating concerns into distinct internal packages (daemon, server, config, scale, logging), while adding a full-featured HTML/CSS/JS dashboard for real-time monitoring and configuration.

Changes:

  • Complete architectural refactoring from monolithic scale_service.go (712 lines) into modular internal packages with clear separation of concerns
  • Addition of embedded web dashboard with WebSocket-based real-time weight display and service diagnostics
  • Migration from environment-specific build tags to ldflags-based configuration injection with new naming conventions (local/remote vs test/prod)
  • Consolidation of resource embedding system from multiple environment-specific files to single embed.go
  • Simplification of test suite by removing integration tests, memory leak tests, and log viewer functionality

Reviewed changes

Copilot reviewed 28 out of 30 changed files in this pull request and generated 25 comments.

Show a summary per file
File Description
cmd/BasculaServicio/main.go New minimal entry point delegating to internal/daemon package
internal/daemon/program.go Service lifecycle orchestration implementing svc.Service interface
internal/server/handler.go HTTP/WebSocket handlers with embedded dashboard serving
internal/server/broadcaster.go Fan-out pattern for distributing weight readings to multiple clients
internal/server/models.go JSON message structures for WebSocket protocol
internal/scale/scale.go Serial port communication and simulated weight generation
internal/config/config.go Thread-safe configuration management with hot-reload support
internal/logging/*.go Log rotation and filtered logging with verbose mode
internal/assets/web/* Complete dashboard implementation (HTML/CSS/JS)
embed.go Consolidated embedding of service binary and web assets
Taskfile.yml Complete rewrite with new naming conventions and ldflags injection
cmd/BasculaInstalador/scale_installer.go Refactored to use injected variables for service naming
README.md Extensive Spanish rewrite with architecture diagrams and protocol documentation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/server/handler.go
Comment thread cmd/BasculaServicio/main.go Outdated
Comment thread internal/daemon/program.go Outdated
Comment thread internal/config/config.go
Comment thread internal/server/handler.go Outdated
Comment thread cmd/BasculaServicio/main.go Outdated
Comment thread internal/server/handler.go
Comment thread embed.go
Comment thread internal/assets/web/js/config.js
Comment thread cmd/BasculaInstalador/scale_installer.go Outdated
@adcondev adcondev changed the title feat(daemon)!: add full dashboard and daemon api improvements feat(daemon): add full dashboard and daemon api improvements Feb 4, 2026
@adcondev adcondev merged commit 8a51581 into master Feb 4, 2026
@adcondev adcondev deleted the feat/tuis branch February 4, 2026 20:54
@github-project-automation github-project-automation Bot moved this from In review to Done in POS RED2000 Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants