Commit Graph

16 Commits

Author SHA1 Message Date
cproudlock
31436590ec Feature: Add IIS reverse proxy configuration
Added web.config for IIS to proxy requests to Flask backend.

Configuration:
- Proxies all requests to http://localhost:3001
- Passes through all HTTP errors
- Disables IIS static file handling (Flask serves everything)
- Removes ASP.NET handlers that were causing 500.31 errors

Requirements:
- IIS URL Rewrite module
- IIS Application Request Routing (ARR)
- ARR proxy enabled at server level
- Flask running on localhost:3001 (via NSSM service)

Deployment:
1. Copy web.config to IIS site root
2. Install URL Rewrite and ARR modules
3. Enable ARR proxy in IIS
4. Run Flask as Windows service
5. Restart IIS site

This allows Flask to run behind IIS with HTTPS support.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 14:29:34 -04:00
cproudlock
1feb508574 Feature: Add comprehensive debug logging to troubleshoot 500 errors
Added detailed debug logging throughout the application to diagnose
production issues on Windows Server with MySQL 5.6.

Debug Features:
- Enable with environment variable: DEBUG=true
- Logs database connection attempts with host, port, user, database
- Shows MySQL version on successful connection
- Tracks query execution step-by-step
- Reports row counts fetched from database
- Shows data conversion progress
- Categorization results (current vs upcoming events)
- All errors include error codes, SQL state, and full stack traces

Debug output includes:
- Connection parameters (host:port/database)
- MySQL server version
- Query execution status
- Number of rows returned
- Data conversion steps
- Event categorization counts

Startup now shows:
- DEBUG MODE: ENABLED/DISABLED
- Database connection info
- Instructions to enable debug mode

Error responses now include:
- Full error message
- Error code (errno)
- SQL state (if available)
- Complete stack trace

Usage on Windows production:
  set DEBUG=true
  python app.py

Or with PM2:
  pm2 delete shopfloor-dashboard
  pm2 start app.py --name shopfloor-dashboard --interpreter python3 --env DEBUG=true
  pm2 logs shopfloor-dashboard

This will help identify the exact cause of 500 errors without switching
to a different MySQL connector.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 13:46:49 -04:00
cproudlock
a92c2401dd Fix: Add MySQL 5.6 compatibility and detailed error logging
Added better error handling and MySQL 5.6 support for Windows Server:

1. Enhanced error logging in app.py:
   - Detailed database error messages with error codes
   - Full stack traces logged to console/PM2
   - Error details returned in JSON for debugging

2. Created app-pymysql.py:
   - Alternative version using PyMySQL instead of mysql-connector-python
   - Better compatibility with older MySQL 5.6 servers
   - Handles bit field conversion from bytes to boolean
   - Pure Python implementation (no C extensions)

3. Added requirements-mysql56.txt:
   - PyMySQL 1.1.0 for MySQL 5.6 compatibility
   - Use this on Windows servers with old MySQL

For production Windows servers with MySQL 5.6, use:
  pip install -r requirements-mysql56.txt
  python app-pymysql.py

For debugging 500 errors, check console/PM2 logs for detailed error messages.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 13:41:52 -04:00
cproudlock
f794cde35e Chore: Remove Node.js/npm files - Flask migration complete
Removed all Node.js/npm related files as they are no longer needed:
- server.js (replaced by app.py)
- package.json (replaced by requirements.txt)
- package-lock.json (npm lock file)
- node_modules/ (6.6 MB of npm packages)

Project size reduced from ~9 MB to 776 KB

The application now runs entirely on Python/Flask with only 2 dependencies:
- Flask
- mysql-connector-python

All functionality maintained and tested working.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 12:00:55 -04:00
cproudlock
fbe5312e7b Feature: Convert from Node.js/Express to Python/Flask
BREAKING CHANGE: Replaced Node.js backend with Python Flask

Reason: npm not available on production server, Python/pip is available.

Changes:
- Created app.py (Flask) to replace server.js (Node.js)
- Created requirements.txt with only 2 dependencies (Flask, mysql-connector-python)
- Updated README.md with Flask installation and deployment instructions
- Maintained all existing functionality:
  * Same API endpoints (/api/notifications, /health)
  * Same database queries (isshopfloor filter, 72-hour window)
  * Same priority sorting (incidents first)
  * Serves static files from public/ directory
  * Same environment variable configuration

Dependencies:
- Flask==3.0.0
- mysql-connector-python==8.2.0

The public/index.html frontend remains unchanged - only the backend was converted.

Tested and verified:
- API endpoint returns correct data
- Health check responds
- Dashboard displays properly
- Database connectivity working
- PM2 process manager compatible

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 11:52:34 -04:00
cproudlock
e0a500a364 Chore: Remove dev dependencies for production deployment
- Removed devDependencies section (nodemon) from package.json
- Removed "dev" script that referenced nodemon
- Reinstalled with --omit=dev flag
- Reduced node_modules from 8.4MB (105 packages) to 6.6MB (78 packages)

Only production dependencies remain:
- express (web server)
- mysql2 (database driver)

This creates a cleaner, smaller package for production deployment.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 10:51:38 -04:00
cproudlock
c4cc152934 Chore: Remove legacy PHP files and cleanup project structure
Removed unnecessary files from PHP-based version of dashboard:
- api_notifications.php (replaced by server.js /api/notifications endpoint)
- db_config.php (database config now in server.js)
- index.php (replaced by public/index.html)
- ge-aerospace-logo.svg (duplicate, public/ge-aerospace-logo.svg is served)

The project now uses Node.js/Express exclusively with static files
served from the public/ directory.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 10:34:02 -04:00
cproudlock
7190606dd6 Feature: Enable scrolling and remove event display limits
- Removed overflow: hidden and height: 100vh from body to allow scrolling
- Removed MAX_UPCOMING limit - now displays all upcoming events
- Removed "more events" indicator since all events are shown
- Added grid layout to upcoming events section for consistent display
- Both current and upcoming events now use 2-column grid (single column for 1 event)

This allows users to scroll and interact with the page to view all events
without artificial limits, improving usability for TV displays.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 10:23:37 -04:00
cproudlock
850885c911 Feature: Implement 2-column grid layout for current events
- Removed display limits on current events to show all active notifications
- Implemented responsive 2-column grid layout (single column for 1 event, 2 columns for 2+)
- Added min-height to event-header for consistent spacing with/without ticket badges
- Fixed padding inconsistency between events with and without ticket numbers
- Maintained 2-event limit for upcoming events to preserve screen space
- Scaled proportionally for 4K displays (90px min-height, 24px margin)

This allows the dashboard to display all current events efficiently without
vertical overflow, addressing user feedback about event count limitations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 10:14:15 -04:00
cproudlock
49f8274f47 Feature: Priority-based sorting and display limit optimization
Backend (server.js):
- Implemented severity-based sorting for current events
- Priority hierarchy: Incident > Change > Awareness > TBD
- Events with same severity sorted by starttime (earliest first)
- Upcoming events remain sorted by starttime only
- Added severityPriority mapping for consistent ordering

Frontend (index.html):
- Reduced display limits for 1080p TVs: 2 current + 2 upcoming = 4 total
- Prevents content overflow on 1080p displays
- 4K displays still auto-scale content appropriately
- Ensures critical incidents always appear first in current events

Testing:
- Verified Incident appears before Change before Awareness
- Verified all 4 events fit on 1080p screen without scrolling

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 10:01:55 -04:00
cproudlock
c9bc2c68a8 Feature: Responsive sizing for 4K and 1080p displays
- Added CSS media query for screens 2560px+ width (4K displays)
- 4K displays automatically scale up all elements:
  * Logo: 90px → 180px (2x)
  * Main title: 42px → 84px (2x)
  * Clock: 28px → 56px (2x)
  * Section titles: 36px → 72px (2x)
  * Event titles: 32px → 64px (2x)
  * Event times: 22px → 44px (2x)
  * Color bar: 60px → 100px (1.67x)
  * LIVE badge: 18px → 32px (1.78x)
  * Footer: 18px → 36px (2x)
- 1080p displays use default optimized sizes
- Responsive design adapts automatically based on screen resolution
- No configuration needed - works out of the box

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 09:55:59 -04:00
cproudlock
fbdb39ce13 Feature: Dynamic severity-based badge colors and UI improvements
- Implemented dynamic Current Events badge color based on severity hierarchy:
  * RED (danger) if any Incident exists
  * YELLOW (warning) if any Change exists (and no incidents)
  * GREEN (success) if only Awareness/TBD exists
- Added getHighestSeverity() function to determine badge color
- Removed all emojis from UI for cleaner professional appearance
- Increased event card height (padding: 20px→30px vertical, 30px→40px horizontal)
- Increased color bar thickness from 40px to 60px for better visibility
- Improved visual hierarchy and clarity for TV display

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 09:54:49 -04:00
cproudlock
ca46c9a404 Feature: Add type-based color coding and optimize for TV display
- Extended time window from 48 hours to 72 hours
- Added isshopfloor filter - only show notifications marked for shopfloor
- Added JOIN with notificationtypes table to get type colors
- Implemented type-based color coding with 40px thick left border:
  * Green (#0ad64f) for Awareness and TBD types
  * Yellow (#ffc107) for Change type
  * Red (#dc3545) for Incident type
- Optimized layout for single-screen TV display (no scrolling):
  * Reduced all font sizes and spacing significantly
  * Set overflow: hidden and height: 100vh on body
  * Reduced header, section titles, event cards, and footer sizes
- Limited display to 3 current + 3 upcoming events max
- Shows "+ X more event(s)" indicator when needed
- Positioned LIVE badge in absolute top-right corner
- Updated all text references from 48 hours to 72 hours

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 09:46:43 -04:00
cproudlock
81cb74cdef Improve TV display visibility and add Windows deployment guide
- Increased font sizes across dashboard for better TV readability
  - Headers: 72px (was 48px)
  - Event titles: 56px (was 38px)
  - Clock: 48px (was 36px)
  - Connection status: 28px (was 18px)
- Enhanced spacing and padding throughout
- Larger logo (160px vs 100px)
- Thicker borders for better visibility
- Added comprehensive Windows deployment documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-23 15:53:25 -04:00
cproudlock
8e52a05c57 Add Git repository and SSH key documentation to README 2025-10-21 16:22:44 -04:00
cproudlock
6a9bb8c7a4 Initial commit - Shopfloor Dashboard
- Node.js Express server with MySQL integration
- Real-time event dashboard with live updates
- GE Aerospace branding and design
- Auto-refresh every 10 seconds (AJAX)
- Shows current and upcoming events (48 hour window)
- Connection status monitoring
- Optimized for TV display

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 16:17:45 -04:00