Commit Graph

28 Commits

Author SHA1 Message Date
3dcbfecbe4 feat: add info field to articles for shop display
Added optional info text field to articles that can be managed in the backend and is displayed in the shop only when filled. The info appears in both card view and detail modal with an informative style.

- Added info column to items table with migration
- Updated backend edit form with textarea for info text
- Modified API to include info field in bestand response
- Enhanced shop frontend to display info badge when available

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-11 15:12:12 +01:00
470044c9c9 fix: resolve merge conflicts in app.py
Fixed remaining merge conflict markers in INSERT and SELECT statements for orders table to include email field.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10 13:19:49 +01:00
16f26691af Merge remote changes 2026-02-10 13:15:10 +01:00
e7ca524fda chore: update file permissions and binary files
Minor updates to file permissions and binary assets.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10 13:13:32 +01:00
bc00eeb526 feat: add orders API endpoint with filtering capabilities
Added /api/orders endpoint to retrieve all orders via API with optional filters for status (open/completed/canceled) and payment status (paid/unpaid).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10 13:12:31 +01:00
832aaf2b05 feat: add email notifications, order references, stock badges, and sale flags
- Add customer email field and PayPal payment reminder emails with order reference (HEL-YEAR-ID format)
- Display stock availability with color-coded badges (available/low/unavailable)
- Add sale/clearance flag with animated red badge overlay
- Implement automatic fallback placeholder for missing/broken product images
- Add email column to order management view

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-09 13:56:16 +01:00
aa0de2fe4a feat: add payment tracking for orders
- Add payment method selection (PayPal/Bar) to order form
- Store payment_method and payment_status in database
- Add payment status badges in admin orders view
- Add "mark as paid" functionality for admins
- PayPal account configurable via PAYPAL_ACCOUNT env variable
- Frontend loads PayPal account dynamically from /wawi/config endpoint
- Update email notifications to include payment method

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-09 08:28:33 +01:00
99ecea1de9 feat: add payment tracking for orders
- Add payment method selection (PayPal/Bar) to order form
- Store payment_method and payment_status in database
- Add payment status badges in admin orders view
- Add "mark as paid" functionality for admins
- PayPal account configurable via PAYPAL_ACCOUNT env variable
- Frontend loads PayPal account dynamically from /wawi/config endpoint
- Update email notifications to include payment method

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-09 08:26:54 +01:00
fd3f49a2e1 feat: add automatic image optimization and thumbnails
Image Processing:
- Add Pillow dependency for image manipulation
- Auto-create optimized versions on upload
- Generate main image (max 800x800, 85% quality)
- Generate thumbnail (max 400x400, 80% quality)
- Delete original after optimization

Quality Improvements:
- Auto-correct EXIF orientation (photos from phones)
- Convert RGBA/transparency to RGB with white background
- Use LANCZOS resampling for high-quality downscaling
- Optimize JPEG compression

Performance:
- Smaller file sizes = faster page loads
- Thumbnails for product listings
- Optimized full-size for detail views
- Reduced storage usage

Fallback:
- Graceful degradation if Pillow not installed
- Error handling preserves original on failure
- Logging for monitoring optimization success

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 08:22:11 +01:00
a40b028a0e feat: replace alert() with modern toast notifications
UI Improvements:
- Add animated toast notification system
- Replace browser alert() with styled toast messages
- Support success, error, and info types
- Auto-dismiss after 4 seconds
- Smooth slide-in animation
- Mobile-responsive positioning (bottom on mobile)

User Experience:
- Success: "Bestellung erfolgreich gesendet! Wir melden uns bei dir."
- Error: "Fehler beim Senden der Bestellung. Bitte versuche es erneut."
- Non-blocking notifications (no modal interruption)
- Modern, polished look matching site design

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 08:20:07 +01:00
450a4b062f perf: add database indexes for better query performance
Indexes added:
- items.artikel - frequently searched/filtered
- items(artikel, groesse) - unique article/size lookup
- orders.done - order completion filter
- orders.canceled - order cancellation filter
- orders(done, canceled) - combined status filter for "open orders"
- ausbuchungen.item_id - foreign key for JOINs

All indexes use IF NOT EXISTS for idempotent execution.
This improves performance for:
- Article search/filtering in admin interface
- Order status filtering
- Stock movement queries

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 08:16:30 +01:00
a8b26a25da feat: add logging and SMTP error handling
Logging:
- Add structured logging with timestamps
- Log successful and failed login attempts
- Log new orders and order completions
- Log email sending success/failures

SMTP Error Handling:
- Add try/except block around SMTP operations
- Catch authentication errors, SMTP exceptions, and general errors
- Log all email failures with detailed error messages
- Ensure orders are saved even if email fails

This allows monitoring of critical operations and troubleshooting
email delivery issues through systemd journal.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 08:11:40 +01:00
630595bce9 security: add SECRET_KEY validation
- Prevent server startup if SECRET_KEY is not set in production
- Raise RuntimeError with helpful message if using default value
- Allow debug mode for local development

This ensures the application never runs with an insecure session
secret in production environments.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 08:09:45 +01:00
e062a1e836 security: add CSRF protection to all forms
- Add Flask-WTF dependency for CSRF protection
- Initialize CSRFProtect in app.py
- Add CSRF tokens to all POST forms in templates
- Exempt /order JSON API endpoint (uses API key instead)

This protects against Cross-Site Request Forgery attacks on all
admin and user management operations.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 08:01:22 +01:00
12eece0226 docs: anonymize env examples 2026-01-30 12:41:09 +01:00
b9ea2c2625 docs: clarify order key location 2026-01-30 12:39:29 +01:00
68bfbd55a2 docs: add developer env section 2026-01-30 12:36:51 +01:00
7ff74cb18c docs: verbessern inline-doku in wawi app 2026-01-30 12:35:37 +01:00
db2767a496 Fix api_key_required indentation 2026-01-30 12:24:48 +01:00
efffdfa3fa Document uploads in fix permissions script 2026-01-30 12:17:04 +01:00
65ec9466eb Use APP_API_KEY for order auth 2026-01-30 12:12:40 +01:00
ec2d8945b3 Hide order API key input 2026-01-30 12:10:10 +01:00
513c126fba Send order API key from live page 2026-01-30 12:09:13 +01:00
a61e96e8b8 Harden order endpoint and async mail; improve security defaults 2026-01-30 12:08:08 +01:00
Bjoern Welker
a7d058b57c Clean up unused live page code 2026-01-30 12:00:02 +01:00
Bjoern Welker
f6495eb82a Remove totals from live page 2026-01-30 09:04:18 +01:00
Bjoern Welker
1bcaad503a Update README with deployment and env docs 2026-01-30 08:58:52 +01:00
Bjoern Welker
81a1ed7eef Initial commit 2026-01-30 08:55:14 +01:00