Commit graph

6 commits

Author SHA1 Message Date
Vadym Samoilenko
36b12888b2 Add better error handling in init function
Check that response is ok and files is an array before processing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:55:08 +00:00
Vadym Samoilenko
0a946ba2ac Add 401 redirect handling in frontend
JavaScript now checks for 401 status and redirects to login page when session expires.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:53:18 +00:00
Vadym Samoilenko
2aeb8299ac Add simple login authentication
Added session-based login system to protect the application.

Features:
- Login page with credentials: admin3_M / Pa$$w0rd2026_!
- Session-based authentication using Flask sessions
- All routes protected with @login_required decorator
- Logout functionality with button in header
- Clean login UI matching H&M branding

Security:
- Secret key for session encryption (should be set via env var)
- Password stored in code (consider hashing for production)

Files:
- server.py: Added login/logout routes and auth decorator
- static/index.html: Added logout button in header
- static/logout.html: Logout redirect page
- .env.example: Added SECRET_KEY configuration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:52:04 +00:00
Vadym Samoilenko
75d5519215 Update paths for production domain and HTTPS
Changed application path from /hm-ems/ to /hm-ems-report/ to match production URL structure. Updated all references to use HTTPS and correct domain.

Changes:
- Path prefix: /hm-ems/ → /hm-ems-report/
- Production URL: https://ai-sandbox.oliver.solutions/hm-ems-report/
- Created apache/hm-ems-report.conf with full Apache configuration
- Updated all API and image paths in frontend and backend
- Updated documentation with correct URLs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:33:46 +00:00
Vadym Samoilenko
14d67b5f2b Add production deployment setup for Ubuntu with Apache
Configured application for deployment with Apache reverse proxy and systemd service. The app runs without Docker, using Python venv and Gunicorn.

Key changes:
- deploy.sh: Idempotent deployment script with backup, health checks
- systemd/hm-ems.service: Systemd unit for auto-start/restart
- DEPLOY.md: Complete deployment and troubleshooting guide
- .env.example: Configuration template
- Updated API paths: /api/* → /hm-ems/api/* for Apache routing
- Updated image URLs: /images/* → /hm-ems/images/* for Apache alias
- Updated CLAUDE.md: Added production deployment section

Architecture:
- Flask/Gunicorn on localhost:5000 (systemd service)
- Apache reverse proxy for /hm-ems/api/*
- Apache serves static files from /var/www/html/hm-ems-report/
- Apache serves images from /opt/hm-ems-data/campaign_images/
- Data persistence in /opt/hm-ems-data/ (JSON + images)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:30:54 +00:00
Vadym Samoilenko
5904326d0c Add H&M EMS Product Review Tool with complete project structure
Added Flask-based web application for reviewing and editing H&M product data across multiple languages. Includes inline editing, approval workflow, change logging, and multi-image support.

Key components:
- server.py: Flask API with thread-safe JSON read/write
- html_generator.py: Standalone HTML generator with language utilities
- static/index.html: Interactive review UI with dynamic column management
- CLAUDE.md: Comprehensive development guide
- Sample campaign data (1022A, 2023) with images
- Updated .gitignore for Python projects

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:05:03 +00:00