Commit Graph

8 Commits

Author SHA1 Message Date
0881b0ecee fix(6): resolve static asset serving and proxy header issues
Fixed issues:
1. Caddy not forwarding X-Forwarded headers to Next.js
   - Added X-Forwarded-For, X-Forwarded-Proto, X-Forwarded-Host
2. Removed X-Content-Type-Options: nosniff (blocks static assets)
3. Copy static files to standalone build directory
   - Next.js standalone requires files in .next/standalone/.next/static/
4. Made script auto-copy static files after build

Result:
  ✓ CSS/JS loading with correct MIME types (text/css, text/javascript)
  ✓ Frontend fully rendering via HTTPS
  ✓ All static assets cached and served correctly
  ✓ Tested working via IP address (192.168.84.131:8919)
2026-04-22 19:34:32 +03:00
e664215ab8 fix(6): fix argparse default for foreground mode
Changed default from 'foreground' (invalid choice) to None
Now correctly handles no arguments to start in foreground mode

Tested and verified:
  ✓ python3 start_servers.py        (foreground - all 3 services running)
  ✓ python3 start_servers.py start   (background)
  ✓ python3 start_servers.py status  (shows all services)
  ✓ python3 start_servers.py stop    (graceful shutdown)
  ✓ HTTP endpoints responding on 8916/8917
  ✓ HTTPS endpoints responding on 8918/8919 (Caddy)
  ✓ All three services (backend, frontend, caddy) working together
2026-04-22 19:21:16 +03:00
6fa146fae2 feat(6): add Caddy reverse proxy with SSL to standalone deployment
Complete feature parity with Docker deployment:
  - Caddy reverse proxy manages SSL/TLS
  - Ports: 8916/8917 (HTTP), 8918/8919 (HTTPS)
  - Self-signed certificates (development-friendly)
  - Automatic certificate generation via on-demand TLS
  - Security headers (HSTS, XSS Protection, etc.)

Changes:
  - Created Caddyfile.standalone for localhost config
  - Enhanced start_servers.py with Caddy startup/monitoring
  - Auto-install Caddy via apt if not present
  - Updated status output to show both HTTP and HTTPS URLs
  - All three services (backend, frontend, caddy) in one launcher

Both Docker and Standalone modes now have IDENTICAL capabilities:
  - Full production-ready SSL/TLS support
  - Reverse proxy with auto-certificate management
  - HTTPS-only capable

Resolves dual-deployment equivalence requirement
2026-04-22 19:16:26 +03:00
dee8941f15 feat(6): add background mode and lifecycle commands to standalone launcher
New commands:
  start_servers.py            # Foreground (interactive, Ctrl+C to stop)
  start_servers.py start      # Background mode (detached)
  start_servers.py stop       # Stop background servers
  start_servers.py restart    # Stop then start background servers
  start_servers.py status     # Show running servers and PIDs

Features:
  - Process IDs saved to .servers.pid for management
  - Status command shows all running servers and URLs
  - Full argument parsing with help and examples
  - Graceful process group handling for clean shutdown
2026-04-22 19:10:54 +03:00
b1a63e98ab fix(6): fix TypeScript type consistency issues
- Make Item.id required (items from DB always have id)
- Use shared Item type from db.ts in QuantityAdjustmentModal
- Show full npm build output instead of silencing errors
- Ensures all modals use consistent type definitions
2026-04-22 18:50:06 +03:00
37b6d295ff fix(6): add missing Toast component and fix backend startup
- Create Toast component for success/error messages
- Fix uvicorn invocation: use backend.main:app from project root
- Ensures relative imports work correctly in backend modules
2026-04-22 18:46:32 +03:00
bd39f6f1b7 fix(6): standalone launcher improvements
- Use uvicorn CLI directly (not python -c workaround)
- Add process group handling for cleaner shutdown
- Silent npm output during setup
- Better error messages and logging
- Support graceful SIGTERM/SIGINT handling
2026-04-22 18:44:18 +03:00
ec4e11c2e0 feat(6): create python standalone server launcher
- Replaces bash script with robust Python implementation
- Simpler process management using subprocess module
- Better error handling and logging
- Manages venv, dependencies, and both services
- Handles graceful shutdown on Ctrl+C
2026-04-22 18:38:24 +03:00