Upload API
Handles image uploads to S3 storage for menu items and other assets.
POST /t/:slug/upload
Uploads a file directly to S3.
Auth: Admin JWT required. Content-Type: multipart/form-dataField: file — image file (JPEG/PNG/WebP, max 5 MB)
Response:
json
{ "url": "https://s3.amazonaws.com/bucket/tenants/slug/abc123.jpg" }POST /t/:slug/upload/url
Fetches an image from a public URL and re-uploads it to S3.
Auth: Admin JWT required. Content-Type: application/json
Body:
json
{ "url": "https://external-site.com/image.jpg" }Response:
json
{ "url": "https://s3.amazonaws.com/bucket/tenants/slug/abc123.jpg" }Environment Variables
| Variable | Description |
|---|---|
AWS_ACCESS_KEY_ID | S3 credentials |
AWS_SECRET_ACCESS_KEY | S3 credentials |
AWS_REGION | AWS region (e.g. us-east-1) |
AWS_S3_BUCKET | Target S3 bucket name |
Frontend Component
frontend-react/src/components/ui/ImageUpload.tsx — dual-tab (file/URL) upload with drag-drop and preview. Used in menu item forms.