Automated Raspberry Pi service for printing Hello Club event attendance lists with web dashboard monitoring
- Overview
- Features
- Quick Start
- Installation
- Configuration
- Usage
- Documentation
- Project Structure
- Testing
- Troubleshooting
- License
Hello Club Event Attendance Auto-Print is a professional Raspberry Pi service that automatically fetches, monitors, and prints attendee lists for upcoming Hello Club events. It runs as a systemd service in the background and provides a modern web dashboard for remote monitoring and control.
The application uses a smart two-stage process:
- Event Discovery - Periodically scans the Hello Club API for upcoming events
- Just-in-Time Processing - Fetches the latest attendee list moments before an event starts
- Automatic Printing - Generates a professional PDF and prints it (locally or via email)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Web Dashboard β
β (Express + WebSocket) β
β β’ Real-time log streaming β
β β’ Service control (start/stop/restart) β
β β’ Configuration editor β
β β’ Connection tests & statistics β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β HTTP/WS (Port 3000)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β systemd Service β
β (Always-Running Background) β
β β’ Fetches events every N hours β
β β’ Schedules processing for each event β
β β’ Auto-restarts on failure β
β β’ Health monitoring & statistics β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββΌβββββββββββββ
βΌ βΌ βΌ
[Hello Club] [SQLite DB] [Printer]
API (Event Queue) (CUPS/Email)
- β Automated Event Fetching - Scans for upcoming events within configurable time windows
- β Smart Scheduling - Processes events at optimal times to capture last-minute sign-ups
- β Professional PDFs - Generates clean, printable attendee lists with custom layouts
- β Flexible Printing - Print locally or send via email to network printers
- β Category Filtering - Only process events from specified categories
- β Always Running - Starts automatically with Raspberry Pi via systemd
- β Self-Healing - Automatically restarts if it crashes
- β Background Operation - Runs headless without user interaction
- β Production Ready - Battle-tested systemd service management
- β Low Power - Energy-efficient 24/7 operation
- π Remote Access - Monitor from any device on your network
- π Real-time Monitoring - Live log streaming via WebSocket
- π Log Viewer - Browse activity and error logs with auto-scroll
- π Statistics - Events processed, success rates, and trends
- ποΈ Service Control - Start, stop, and restart the service remotely
- βοΈ Settings Editor - Edit configuration and credentials via web UI
- π Connection Tests - Test API, Email, and Printer with one click
- πΎ Backup Management - Create and restore configuration backups
- β Comprehensive Tests - 118 unit tests with Jest
- β Type Safety - Joi schema validation for all configuration
- β Error Handling - Robust error handling with detailed logging
- β Modular Architecture - Clean separation of concerns
- β Well Documented - Extensive JSDoc comments
Raspberry Pi Deployment - The recommended way to run in production:
- Get a Raspberry Pi 5 with 8GB RAM (see hardware list)
- Follow the Raspberry Pi Setup Guide:
- Flash Raspberry Pi OS Lite 64-bit
- Configure static IP and SSH
- Run the automated setup script
- Access the Web Dashboard at
http://helloclub-pi.local:3000 - Configure your settings via the dashboard:
- Enter your Hello Club API key
- Configure email printing
- Set event categories
That's it! The service runs 24/7 in the background. Use the web dashboard to:
- View real-time logs
- Monitor service status
- Edit configuration
- Test API and Email connections
- Control the service (start/stop/restart)
To upgrade to the latest version:
cd /opt/helloclub/app
sudo bash setup/pi-upgrade.shThe upgrade script automatically pulls the latest code, preserves your settings, and restarts services. See the Raspberry Pi Setup Guide for details.
If you want to run from source or contribute:
# 1. Clone the repository
git clone https://github.com/ispyisail/Hello-Club-Event-Attendance-Auto-Print.git
cd Hello-Club-Event-Attendance-Auto-Print
# 2. Install dependencies
npm install
# 3. Configure your API key
cp .env.example .env
# Edit .env and add your API_KEY
# 4. Run the service (foreground)
npm start
# 5. Or run with web dashboard
npm run dashboard # In separate terminal
npm start # Main service- Hardware: Raspberry Pi 5 (8GB recommended) or any Linux server
- Operating System: Raspberry Pi OS Lite 64-bit (Debian/Ubuntu also supported)
- Node.js: Version 18.0.0 or higher
- Network: Ethernet connection recommended for reliability
npm installThis installs all required packages including:
better-sqlite3- Local databasepdfkit- PDF generationwinston- Loggingexpress- Web dashboardaxios- API clientnodemailer- Email service- And more...
Note: Some dependencies (node-windows, electron) are legacy Windows-only packages not needed for Raspberry Pi deployment.
Create .env file:
# Copy the example
copy .env.example .envEdit .env and add your credentials:
# Required: Your Hello Club API key
API_KEY=your_api_key_here
# Optional: For email printing mode
PRINTER_EMAIL=printer@yourdomain.com
SMTP_USER=your_email@gmail.com
SMTP_PASS=your_app_password
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587Edit config.json:
{
"categories": ["NBA - Junior Events", "Your Category"],
"preEventQueryMinutes": 5,
"fetchWindowHours": 24,
"serviceRunIntervalHours": 1,
"printMode": "local",
"outputFilename": "attendees.pdf",
"pdfLayout": {
"fontSize": 10,
"columns": [
{ "id": "name", "header": "Name", "width": 140 },
{ "id": "phone", "header": "Phone", "width": 100 },
{ "id": "signUpDate", "header": "Signed up", "width": 100 },
{ "id": "fee", "header": "Fee", "width": 60 },
{ "id": "status", "header": "Status", "width": 90 }
]
}
}Create and enable the systemd service:
# Create service file
sudo nano /etc/systemd/system/helloclub.service
# Copy the service configuration from setup/helloclub.service
# Then enable and start:
sudo systemctl daemon-reload
sudo systemctl enable helloclub
sudo systemctl start helloclubSee DEPLOYMENT.md for the complete systemd service configuration.
Open a browser and navigate to:
http://helloclub-pi.local:3000
Or use the Pi's IP address: http://192.168.1.XX:3000
Login with the credentials from your .env file.
β οΈ Note: Windows deployment is no longer recommended. For new deployments, use Raspberry Pi 5 (see above).
For Existing Windows Users (v1.0.x):
If you're currently running on Windows, you can continue using it with manual installation:
- Clone repository:
git clone https://github.com/ispyisail/Hello-Club-Event-Attendance-Auto-Print.git - Install dependencies:
npm install - Create
.envfile with your credentials - Run:
node src/index.js start-service
Windows-specific documentation:
Migration to Raspberry Pi:
We recommend migrating to Raspberry Pi for:
- β Lower power consumption (~10W vs 100W+)
- β Silent 24/7 operation
- β Better reliability for always-on service
- β Lower cost (~$80 total)
- β Remote management via web dashboard
See RASPBERRY-PI-SETUP.md for migration guide.
The application uses two configuration files:
.env- Secrets and credentials (never commit this! Already in .gitignore)config.json- Application settings (safe to commit - no secrets)
Configuration Options:
- Web Dashboard: Edit configuration via the dashboard's Settings page (recommended)
- Manual Editing: Edit
.envandconfig.jsonfiles directly - Automatic Backups: Dashboard creates backups before saving changes
| Variable | Required | Description | Default |
|---|---|---|---|
API_KEY |
β Yes | Hello Club API authentication key | - |
PRINTER_EMAIL |
For email mode | Email address of network printer | - |
SMTP_USER |
For email mode | SMTP username (e.g., Gmail address) | - |
SMTP_PASS |
For email mode | SMTP password or app-specific password | - |
SMTP_HOST |
For email mode | SMTP server hostname | smtp.gmail.com |
SMTP_PORT |
For email mode | SMTP server port | 587 |
EMAIL_FROM |
For email mode | Sender email address | Same as SMTP_USER |
LOG_LEVEL |
No | Logging verbosity (error, warn, info, debug) | info |
DB_PATH |
No | Path to SQLite database file | ./events.db |
See CONFIGURATION.md for detailed configuration documentation.
Enable webhook notifications to receive real-time updates when events are processed. Add the following to your config.json:
{
"webhook": {
"enabled": true,
"url": "https://your-server.com/webhook",
"timeoutMs": 10000,
"maxRetries": 2,
"retryDelayMs": 2000
}
}Webhook Events:
| Event | Description |
|---|---|
event.processed |
Event successfully processed with attendee count |
event.failed |
Event processing failed with error message |
job.retry |
Job is being retried (includes retry count) |
job.permanent_failure |
Job failed after all retries exhausted |
service.started |
Service has started with configuration info |
Example Payload:
{
"event": "event.processed",
"timestamp": "2025-01-15T10:30:00.000Z",
"data": {
"eventId": "abc123",
"eventName": "Basketball Practice",
"attendeeCount": 15
}
}The web dashboard provides comprehensive remote management:
Access: http://helloclub-pi.local:3000
Main Features:
- π Dashboard Home - Service status, statistics, and recent activity
- π Live Logs - Real-time log streaming with auto-scroll
- ποΈ Service Control - Start/Stop/Restart the systemd service
- βοΈ Configuration Editor - Edit .env and config.json via web UI
- π Connection Tests - Test API, Email, and Printer connectivity
- πΎ Backup Manager - Create and restore configuration backups
- π Statistics - Events processed, success rates, and trends
Service Status Indicators:
- π’ Running - Service active and healthy
- π΄ Stopped - Service not running
- π‘ Starting - Service initialization in progress
βοΈ Configuration Editor: Edit all settings via the web dashboard without touching files:
- Access dashboard β Configuration tab
- Environment Variables Section:
- Edit API key and SMTP credentials
- Password fields with show/hide toggle
- Real-time validation
- Application Settings Section:
- Manage event categories (add/remove)
- Adjust timing settings
- Change print mode (local/email)
- Edit PDF layout
- Click Save - automatic backups created before changes
- Restart service to apply changes (via dashboard Service Control)
π Connection Tests: Verify your configuration via the dashboard:
-
Test API Connection:
- One-click test of Hello Club API
- Shows response time and success/failure
- Validates API key format
- Provides troubleshooting hints
-
Test Email Connection:
- Verify SMTP settings without sending email
- Tests connection to SMTP server
- Detects common Gmail/authentication issues
- Confirms printer email is configured
You can also run the application from the command line:
# Fetch events once (manual run)
node src/index.js fetch-events
# Process pending events once
node src/index.js process-schedule
# Run as continuous service (foreground)
node src/index.js start-service
# View help
node src/index.js --help# Check service status
sudo systemctl status helloclub
# Start service
sudo systemctl start helloclub
# Stop service
sudo systemctl stop helloclub
# Restart service
sudo systemctl restart helloclub
# View logs
journalctl -u helloclub -f
# Enable auto-start on boot
sudo systemctl enable helloclubLogs are written to the project directory (/opt/helloclub/app/):
activity.log- Normal operations, events processederror.log- Errors and warnings only
View logs via:
- Web Dashboard β "Live Logs" (real-time streaming)
- Terminal:
tail -f /opt/helloclub/app/activity.log - systemd:
journalctl -u helloclub -f - SSH: Any text editor (nano, vim, cat)
π Complete Documentation Index: See docs/INDEX.md for organized documentation by role and topic.
| Document | Description |
|---|---|
| CONFIGURATION.md | Detailed configuration guide |
| WEB-DASHBOARD.md | Web dashboard usage and API reference |
| TROUBLESHOOTING.md | Common issues and solutions |
| Document | Description |
|---|---|
| RASPBERRY-PI-SETUP.md | Raspberry Pi 5 setup and hardening |
| DEPLOYMENT.md | Production deployment guide |
| Document | Description |
|---|---|
| legacy/ | Archived Windows documentation |
| legacy/README.md | Windows platform overview |
| Document | Description |
|---|---|
| ARCHITECTURE.md | System design and architecture |
| API.md | Module and function reference |
| DEVELOPMENT.md | Developer setup and contribution guide |
| TESTING-GUIDE.md | Testing documentation |
hello-club-event-attendance/
βββ src/ # Application source code
β βββ core/ # Core business logic
β β βββ api-client.js # Hello Club API integration
β β βββ database.js # SQLite database management
β β βββ functions.js # Event processing logic
β β βββ service.js # Service scheduler
β βββ services/ # Supporting services
β β βββ email-service.js # SMTP email sending
β β βββ logger.js # Winston logging configuration
β β βββ pdf-generator.js # PDF creation
β βββ utils/ # Utilities and helpers
β β βββ args-parser.js # CLI argument parsing
β β βββ config-schema.js # Configuration validation
β βββ index.js # Application entry point
β
βββ web-dashboard/ # Express web dashboard
β βββ server.js # Express + WebSocket server
β βββ connection-tests.js # API/Email/Print tests
β βββ middleware/
β β βββ auth.js # Authentication middleware
β βββ routes/
β β βββ api.js # REST API endpoints
β βββ public/ # Frontend assets
β βββ index.html # Dashboard UI
β βββ js/app.js # Frontend JavaScript
β βββ css/ # Styling
β
βββ setup/ # Raspberry Pi setup scripts
β βββ pi-configure.sh # System hardening script
β βββ pi-install-app.sh # Application installation
β βββ helloclub.service # systemd service file
β βββ helloclub-dashboard.service # Dashboard service file
β
βββ tests/ # Unit tests (118 tests)
β βββ api-client.test.js # API client tests
β βββ email-service.test.js # Email service tests
β βββ functions.test.js # Core logic tests
β βββ health-check.test.js # Health check tests
β βββ pdf-generator.test.js # PDF generation tests
β βββ service.test.js # Service scheduling tests
β βββ webhook.test.js # Webhook notification tests
β
βββ docs/ # Documentation
β βββ RASPBERRY-PI-SETUP.md # Pi setup guide
β βββ WEB-DASHBOARD.md # Dashboard guide
β βββ DEPLOYMENT.md # Deployment guide
β βββ ARCHITECTURE.md # System architecture
β βββ API.md # API reference
β βββ legacy/ # Archived Windows docs
β βββ ...
β
βββ backups/ # Configuration backups (gitignored)
β
βββ .env # Environment variables (gitignored)
βββ .env.example # Environment template
βββ config.json # Application configuration
βββ package.json # Node.js project manifest
βββ README.md # This file
# Run all tests
npm test
# Run with coverage report
npm run coverage
# Run specific test file
npx jest tests/functions.test.js
# Run in watch mode (for development)
npx jest --watchCurrent test coverage:
- 118 unit tests passing across 7 test suites
- Core business logic fully tested (functions.js, service.js)
- PDF generation tested with mocks
- API client error handling and pagination tested
- Email service error scenarios tested
- Webhook notifications tested
- Health check module tested
- Service scheduling and retry logic tested
Service won't start
- Check service status:
sudo systemctl status helloclub - View error logs:
journalctl -u helloclub -xe - Verify API_KEY in
.envis correct - Check file permissions:
/opt/helloclub/app/
No events being processed
- Check category filters in
config.json - Verify events exist in the time window
- Run manually:
node src/index.js fetch-events - Check logs:
tail -f activity.log
Dashboard not accessible
- Check service is running:
sudo systemctl status helloclub - Verify firewall:
sudo ufw status - Test locally:
curl http://localhost:3000 - Check dashboard port in
.env
PDF not printing
- Email mode: Verify SMTP credentials in
.env - Local mode: Check CUPS configuration:
lpstat -p - Test email: Use dashboard "Test Email Connection"
- Check
error.logfor printing errors
401 Unauthorized errors
- Your API_KEY is invalid or expired
- Get a new key from Hello Club
- Update
.envand restart service
Webhook not receiving notifications
- Verify
webhook.enabledistrueinconfig.json - Check that the webhook URL is accessible from your server
- Ensure URL uses HTTPS (HTTP localhost URLs are blocked for security)
- Check
error.logfor webhook delivery failures
Events failing repeatedly
- Check
error.logfor the specific error message - Events are retried 3 times with exponential backoff (5min, 10min, 20min)
- After 3 failures, the event is marked as permanently failed
- Use the health check file (
service-health.json) to monitor failed job counts
Database errors
- Ensure the database file (
events.db) is not locked by another process - Check disk space availability
- Try deleting
events.dband restarting (will re-fetch events)
See TROUBLESHOOTING.md for more solutions.
Contributions are welcome! Please see DEVELOPMENT.md for:
- Development setup
- Code style guidelines
- Testing requirements
- Pull request process
This project is licensed under the MIT License - see the LICENSE file for details.
- Hello Club for the excellent event management platform
- Raspberry Pi Foundation for affordable, reliable hardware
- Node.js and the open-source community
- PDFKit for PDF generation
- Express for the web dashboard
- Legacy Windows support: node-windows, Electron
- Issues: GitHub Issues
- Documentation: See the
docs/folder - Email: Check the package.json for contact information
Made with β€οΈ for Hello Club users