Skip to content

Releases: williamveith/wastetags

v2.3.0 New Add Chemical Feature, Streamlined Versioning

25 Dec 22:02
v2.3.0
d8ec1af
Compare
Choose a tag to compare

Highlights

  1. Add Chemical Method Fully Implemented & Tested

    • A new AddChemical workflow to handle the creation of chemical entries, including CAS number validation and alias insertions.
    • A dedicated API endpoint (/api/get-cas) that checks the database for existing chemical records, reducing data duplication.
    • Enhanced error handling and user feedback for chemical creation and lookups.
  2. Improved CAS Number Validation

    • CAS validation logic has been relocated from input-validators.js to a dedicated module (cas-api.js), ensuring cleaner separation of concerns and easier maintainability.
    • JavaScript validation checks and in-application checks help prevent invalid CAS entries.
  3. GitHub Actions & Workflow Updates

    • Updated the GitHub Action (.github/workflows/build-and-release.yml) to automatically use TAG: "v2.3.0" for consistent versioning in releases.
    • Streamlined binary release creation: the final artifact’s tag and name are automatically updated to the new version.
    • Improved instructions for creating new Git tags and triggering the build using gh api.
  4. Documentation Enhancements

    • README.md now includes clearer instructions for:
      • Creating new tags and triggering binary compilation via GitHub Actions.
      • Understanding the general usage flow of the Waste Tagging System.
  5. Under-the-Hood Improvements

    • New SQL scripts (insert_chemical.sql and insert_alias.sql) to handle chemical and alias insertions more reliably.
    • Code cleanup to reduce redundancy and improve overall system stability.

Detailed Changelog

Added

  • InsertNewChemical Function
    Inserts new chemical entries along with a corresponding alias into the database.
  • /api/get-cas Endpoint
    Checks if a chemical entry already exists by CAS number. Returns detailed JSON feedback on success or failure.

Changed

  • GitHub Action (build-and-release.yml)
    • Now references an environment variable TAG: "v2.3.0" for versioning.
    • Updated release artifacts to use name: ${{ env.TAG }} and tag: ${{ env.TAG }}.
  • JavaScript CAS Validation
    • Removed old CAS validation logic in input-validators.js and replaced it with the new cas-api.js module for improved accuracy and maintainability.
  • README.md
    • Added a new “Github Action” section with usage and tagging instructions.
    • Updated usage flow details to reflect the new chemical-add workflow.

Fixed

  • Minor bugs in CAS validation that previously allowed incorrect numbers to pass.
  • Potential edge cases in adding a new chemical where aliases were not always inserted correctly.

Removed

  • Redundant CAS validation logic from input-validators.js, superseded by the new cas-api.js.

Upgrade Notes

  1. Pull the Latest Code: Ensure you have the latest main or master branch which includes the new tags and updated workflows.
  2. Use New Tagging Approach: Follow the updated instructions in the README for creating new tags and triggering binary builds via GitHub Actions.
  3. Check CAS-Related Logic: If you had custom CAS validation or used the old input-validators.js approach, update your references to the new cas-api.js module.

v2.2.0

25 Dec 10:08
v2.2.0
32b510c
Compare
Choose a tag to compare

Comparing changes from v2.1.0 to v2.2.0

1. Database & Schema Improvements

  • Alias & Mixtures
    • Introduced a new alias table and supporting mixtures_internal_names view to more easily associate chemicals with mixtures.
    • Updated schema.sql to create triggers that ensure consistency between the alias and mixtures tables when display names change.
    • Added updated Protobuf export/import definitions to include the new alias data.

2. Add Mixture Workflow

  • New “Add Mixture” Form
    • Created a skeleton page (add-mixture.html) to facilitate adding mixtures with multiple components.
    • Implemented basic styling (add-mixture.css), client-side validation, and dynamic row management for adding or removing components.

3. QR Code & UI Enhancements

  • Copy QR Code Data to Clipboard
    • Added a click handler on QR code images to copy the JSON content directly to the clipboard.
    • Improved the waste-tag template (waste-tag.html) to display better user feedback and streamline the printing process.
  • Help Menus & Preloading Scripts
    • Updated waste tag forms to include small info popups (help text) and preloaded scripts to optimize page loading.

4. Build & Deployment Pipeline

  • Docker Compose Build
    • Finished configuring a Docker Compose workflow to build for Linux (ARM64) targets, with instructions for Raspberry Pi deployment.
    • Introduced a minimal final image using busybox for smaller container sizes.
  • GitHub Actions for Auto-Deploy
    • Created a new build-and-release.yml workflow that can autodeploy Raspberry Pi–compatible binaries on tag or repository dispatch events.
    • Hardcoded test tags to validate the pipeline.
  • Makefile & Tooling
    • Refined the Makefile to unify local development, container builds, and minification steps.
    • Reorganized Dockerfiles (e.g., CompileGo.Dockerfile, MinifyJS.Dockerfile, MinifyCSS.Dockerfile) into logical folders.

5. Minor Fixes & Housekeeping

  • Removed .github from .gitignore to allow GitHub workflow files to remain in source control.
  • Cleaned up repeated or unused Docker instructions, ensuring the container build steps remain consistent across development and production.

Improved data validation, build optimization, and configs embedding

22 Dec 08:50
v2.1.0
3fd1c6b
Compare
Choose a tag to compare

v2.1.0

🚀 Overview

Version v2.1.0 builds on the significant refactoring and modernization introduced in v2.0.0. This release refines our Add Chemical and Add Mixture workflows, enhances the overall developer/user experience through improved error handling, and streamlines Docker-based build processes. We’ve also incorporated additional validation checks and minor UI/UX tweaks to ensure smoother deployments and daily usage.

🔑 Key Highlights

  1. Improved CAS Number Validation

    • The Add Chemical form now enforces more robust checks for CAS numbers, preventing malformed inputs.
    • Enhanced JavaScript-based validation for numeric fields and standardized messages to guide users.
  2. Refined Mixture Interface

    • The Add Mixture page lays groundwork for combining multiple chemicals into a single record.
    • Though still under development, core features are in place for basic mixture creation.
  3. Docker Build Optimization

    • Linux Docker-based builds are now more efficient:
      • Reduced build image size.
      • Faster build times due to refined caching layers and minimal base images.
  4. UI Enhancements

    • CSS tweaks and layout adjustments for mobile compatibility.
    • Updated footer and navbar for a consistent, clean look.
  5. Expanded Logging & Error Reporting

    • More granular logs in both CLI and systemd-based deployments.
    • Clearer error messages for debugging database connectivity and configuration issues.

📄 Changes & Improvements

  • Build Tools:
    • Adjusted Makefile targets for faster local development cycles (make dev).
    • Streamlined artifact output structure under bin/ to match newly introduced directory patterns.
  • Service Stability:
    • Improved systemd handling for Linux (wastetags.service), ensuring correct restarts on crash or reboot.
    • More graceful error handling if the database file is locked or missing on startup.
  • Documentation:
    • Additional notes on config usage and environment variables.
    • Clarified upgrade steps for existing deployments.

⚙️ Upgrading to v2.1.0

  1. Pull or Download
    • git fetch --tags && git checkout v2.1.0
    • Or download the release from GitHub directly.
  2. Build
    • Linux: make linux
    • macOS: make mac
    • Development: make dev
  3. Deploy
    • For Linux, run make push-linux to copy artifacts and restart the systemd service.
    • For other platforms, copy the generated binary and config files into your environment manually.
  4. Verify
    • Check logs to confirm a successful start.
    • Ensure your existing waste tags, database records, and UI pages load correctly.

🔎 Known Issues

  • Mixture Functionality: Still incomplete; advanced mixture editing will arrive in future releases.
  • OS-Specific Config Overlaps: If you are running multiple OS-based builds in parallel (e.g., macOS for dev, Linux for production), ensure you specify correct config flags (--dev, --config, etc.).

🔮 Looking Ahead

  • Enhanced Automated Testing: We aim to broaden test coverage, especially around mixtures and QR generation routines.
  • CI/CD Pipeline: Integration with additional CI providers for cross-platform build validations.

Easy Configuration, Automated Build/Test/Deploy Tools

19 Dec 06:03
v2.0.0
632a87e
Compare
Choose a tag to compare

🚀 Overview

This release introduces a significant re-architecture and modernization of our build process and project structure. With v2.0.0, we have:

  • Modularized components to improve code maintainability and reusability.
  • Introduced OS-specific configuration files, enabling platform-targeted deployments.
  • Implemented refined build tools using Docker-based builds for Linux and native go build processes for macOS and development environments.

These changes streamline the workflow for developers, DevOps engineers, and system administrators alike, reducing complexity and ensuring more reliable, repeatable builds.


🔑 Key Highlights

  1. Modularization of Components

    • The codebase has been reorganized to better separate concerns and functionalities.
    • Common functionality has been moved into pkg/, making it easier to reuse database connections, ID generation logic, and QR code generation.
    • Command-line (CLI) logic and templating reside in cmd/wastetags/, simplifying the main application structure.
  2. OS-Specific Configurations

    • Configuration files for Linux, macOS, and development builds are now neatly segregated under configs/.
    • Linux builds use linux.json to configure production deployments.
    • macOS builds use macos.json for Apple platform–aligned setups.
    • Dev builds use dev.json for rapid development and testing cycles.
  3. Enhanced Build & Deployment Workflow

    • The Makefile now supports platform-specific targets:
      • make linux builds via Docker for consistent environment replication.
      • make mac relies on native go build for macOS.
      • make dev provides a streamlined development build.
    • A new push-linux target deploys Linux artifacts to a remote host, ensuring smooth updates and service restarts post-deployment.
  4. Service Configuration for Linux

    • The wastetags.service file is included and automatically installed as a systemd service for Linux deployments.
    • This ensures wastetags can easily start on boot and be managed via systemd.
  5. Data & Asset Management

    • data/chemicals.sqlite3 is integrated into the deployment workflow, ensuring the database is correctly placed at /var/lib/wastetags/.
    • Templates, CSS, JS, and images are organized under cmd/wastetags/assets/ and cmd/wastetags/templates/ for easy UI component serving.

📁 Directory Structure

├── Makefile
├── README.md
├── bin/
│   └── linux/
│       ├── config.json
│       ├── wastetags
│       └── wastetags.service
├── build/
│   ├── linux/
│   │   ├── Dockerfile
│   │   └── wastetags.service
│   └── mac/
│       ├── Info.plist
│       └── iconfile.icns
├── cmd/
│   └── wastetags/
│       ├── addchemical.go
│       ├── addmixture.go
│       ├── assets/...
│       ├── home.go
│       ├── main.go
│       ├── query/...
│       ├── templates/...
│       ├── wastetag.go
│       └── wastetagform.go
├── configs/
│   ├── dev.json
│   ├── linux.json
│   └── macos.json
├── data/
│   └── chemicals.sqlite3
├── pkg/
│   ├── database/database.go
│   ├── idgen/idgen.go
│   └── qrcodegen/qrcodegen.go
└── qrSchema/
    ├── v0.js
    ├── v0.json
    ├── v1.js
    └── v1.json

⚙️ How to Build

Linux Build:

make linux
  • Docker-based build and artifact placement in bin/linux/.
  • Copies linux.json and wastetags.service.

macOS Build:

make mac
  • Native go build for macOS.
  • Copies macos.json and chemicals.sqlite3 to bin/macos/.

Development Build:

make dev
  • Dev environment build with dev.json config.

▶️ Running the Application

  • Linux:

    make run-linux
  • macOS:

    make run-mac
  • Development:

    make run-dev

📤 Deployment (Linux)

make push-linux

This will:

  1. Clean and rebuild the Linux artifacts.
  2. Securely copy the binary, config, and database to the remote server.
  3. Move them to their final destinations:
    • /usr/local/bin/wastetags
    • /etc/wastetags/config.json
    • /var/lib/wastetags/chemicals.sqlite3
  4. Restart the wastetags service.

🔧 Known Issues & Future Enhancements

  • Known Issues:

    • None identified at this time.
  • Planned Enhancements:

    • Enhanced CI/CD integration for automated tests.
    • Cross-platform testing improvements.
    • Additional configuration management for other UNIX-like platforms.

Full Changelog: https://github.com/williamveith/wastetags/commits/v2.0.0

Add Chemicals, Generate QR Codes, Simplify Labels

15 Dec 13:54
v1.1.0
eb08512
Compare
Choose a tag to compare

🚀 New Features

  • Chemical and Mixture Addition:

    • Added addChemical and addMixture endpoints for submitting chemical and mixture data.
    • Supports CAS number input formatted as XXX-XX-X and chemical names.
  • QR Code Generation:

    • Implemented functionality to generate QR codes for waste tags.
    • Supports dynamic JSON payloads with embedded component data.
    • Includes makeCopy for cloning QR code data with unique tags.
  • Waste Label Management:

    • completedWasteTag generates detailed waste tags with QR codes and chemical components.
    • Form-based UI for creating and submitting waste tags, accessible via /create-tag.
  • Embedded Resources:

    • Integrated embedded templates and assets for streamlined deployment.
    • Embedded SQL files for schema and query management.

🛠 Enhancements

  • Database Initialization:

    • Automated SQLite database creation and schema loading from embedded SQL.
    • Structured data retrieval for chemicals, mixtures, locations, units, and containers.
  • Improved Middleware:

    • Added addCurrentPathMiddleware for consistent route tracking and path management in templates.
  • Simplified Routing:

    • Centralized routing logic with pageHandler for uniform HTML rendering.

🐛 Bug Fixes

  • Improved error handling for database queries and QR code generation.
  • Fixed type assertions for retrieved database values to prevent runtime errors.
  • Enhanced form validation for chemical and mixture submission.

🔧 Maintenance

  • Refactored database operations to use shared SQL templates.
  • Standardized naming conventions across handlers and middleware.
  • Added robust error logging for easier debugging.

📚 Documentation

  • Updated inline comments for clarity on new and existing features.
  • Rewritten README to explain new features & how to build/use app

🌐 Routes Overview

  • Home Page: /home
  • Waste Tag Creation: /create-tag
  • Add Chemical: /add-chemical
  • Add Mixture: /add-mixture
  • QR Code API: /api/generate-qr

📦 Dependencies

  • github.com/gin-gonic/gin for HTTP handling.
  • github.com/williamveith/wastetags/pkg/database for database operations.
  • github.com/google/uuid for generating unique identifiers.
  • github.com/williamveith/wastetags/pkg/qrcodegen for QR code generation.

Full Changelog: v1.0.0...v1.1.0

WasteTag Generator v1.0.0

13 Dec 05:58
v1.0.0
254f8b3
Compare
Choose a tag to compare

Overview

This is the initial release of the WasteTag Generator system. The system provides a web-based form to generate physical waste tags that encode chemical waste information within a QR code. Once a tag is printed and attached to a container, waste disposal personnel can scan the QR code to automatically submit the waste data into a central disposal system.

Purpose

The introduction of the WasteTag Generator replaces a previously manual and error-prone process:

  • Old Process: Each waste container’s identifying tag was handwritten. Operators later transcribed these hand-written tags into a form, leading to potential errors, delays, and extra administrative work.

  • New Process: A digital form ensures accurate data entry at the source. Once submitted, the system generates a printable tag, complete with a QR code. The QR code encapsulates all necessary waste information. Scanning the code bypasses manual data re-entry, streamlining the disposal workflow and improving data accuracy.

Example Waste Label

Key Features

  1. Digital Data Collection:
    Users fill out a web-based form selecting the chemical mixture, location, container type, and other relevant details directly from validated dropdown lists sourced from a central database.

  2. Automated QR Code Generation:
    Upon form submission, a unique identifier (waste tag number) is generated and embedded in a JSON structure. This data is then encoded as a QR code, which is displayed in the browser and can be printed directly onto a label.

  3. Database Integration:
    The system uses a SQLite database to store:

    • Available chemical mixtures (with component percentages)
    • Locations
    • Units of measure
    • Container types
    • Physical states of materials

    Users select these standardized values from dropdown menus, ensuring consistent and valid data entry.

  4. Printable Tags:
    The final web page displays a cleanly formatted label with:

    • Room number (location)
    • Tag number (unique waste identifier)
    • Generator name
    • List of chemical components and their percentages
    • A QR code encoding all waste tag data

    Operators can print this label and attach it to the waste container.

Technology Stack

  • Backend:

    • Go (Golang) for main server logic
    • SQLite database for persistent storage
  • Frontend:

    • HTML templates (embedded via embed.FS)
    • Gin web framework for routing and form handling
  • QR Code Generation:

    • github.com/skip2/go-qrcode for generating inline PNG QR codes

Code Organization

  • main.go:
    The primary entry point. Initializes the database, sets up routing using Gin, and defines handlers for the form and tag generation.

  • database.go (in package database):
    Handles database initialization, querying for dropdown values, and retrieving chemical mixture components.

  • qrcodegen.go (in package qrcodegen):
    Manages QR code creation as data URIs for inline embedding.

  • templates/ directory:
    Contains HTML templates for the input form (tag-form.html) and the final output tag (tag.html).

  • query/ directory:
    Includes SQL files for the schema and queries used to retrieve data.

  • Makefile:
    Provides convenient build and run targets.

    • make build: Builds the Wails application and generates the executable.
    • make run: Runs the built application immediately after building.

Installation & Setup

  1. Building the Application:

    make build
  2. Running the Application:

    make run

    The server runs at http://localhost:8080.

Usage

  1. Navigate to http://localhost:8080.
  2. Fill out the form, selecting the chemical mixture, container details, and location from dropdown menus.
  3. Submit the form.
  4. The system generates a printable waste tag with a QR code.
  5. Print and attach the tag to the waste container.
  6. Scanning the QR code at the disposal stage provides a fast, accurate way to submit waste information without re-entry.

Known Limitations and Future Enhancements

  • Manual Printing: Users currently print the tag from their browser. Future versions may integrate directly with label printers.
  • Reporting & Audit Trails: Future releases may include dashboards or APIs to track waste tags over time.
  • UI to Add New Chemicals and Mixtures: A planned feature is a dedicated UI where authorized users can add new chemicals, define their mixtures, and update reference data directly from the application. This will simplify database maintenance and ensure the system stays current with available chemicals and waste components.