Added comprehensive CORS headers to the nginx proxy configuration to
fix network errors when the frontend tries to fetch from the API.
Changes:
- Added Access-Control-Allow-Origin header with dynamic origin
- Added Access-Control-Allow-Methods for all needed HTTP methods
- Added Access-Control-Allow-Headers for Content-Type and Authorization
- Added Access-Control-Allow-Credentials for cookie support
- Added X-Forwarded-Proto header to pass HTTPS scheme to backend
- Implemented preflight OPTIONS request handling
This resolves "NetworkError when attempting to fetch resource" errors
in the browser by ensuring proper CORS handling at the nginx level.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Added comprehensive recipe editing functionality with improved image handling
and better UX for large file uploads.
**Features:**
- Recipe editing: Full CRUD support for recipes with edit page
- Image management: Upload, replace, and delete recipe images
- Upload feedback: Processing and uploading states for better UX
- File size increase: Raised limit from 10MB to 20MB for images
- Nginx configuration: Added client_max_body_size for large uploads
**Changes:**
- Created EditRecipe.tsx page for editing existing recipes
- Created NewRecipe.tsx page wrapper for recipe creation
- Created RecipeForm.tsx comprehensive form component with:
- Simple and multi-section recipe modes
- Image upload with confirmation dialogs
- Processing state feedback during file handling
- Smaller, button-style upload controls
- Updated recipes.routes.ts:
- Increased multer fileSize limit to 20MB
- Added file validation for image types
- Image upload now updates Recipe.imageUrl field
- Added DELETE /recipes/:id/image endpoint
- Automatic cleanup of old images when uploading new ones
- Updated nginx.conf: Added client_max_body_size 20M for API proxy
- Updated App.css: Improved upload button styling (smaller, more compact)
- Updated RecipeForm.tsx: Better file processing feedback with setTimeout
- Updated help text to reflect 20MB limit and WEBP support
**Technical Details:**
- Fixed static file serving path in index.ts
- Added detailed logging for upload debugging
- Improved TypeScript type safety in upload handlers
- Better error handling and user feedback
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>