Skip to content

Uploads#171

Merged
zakkiyyat merged 5 commits intoMixMatch-Inc:mainfrom
inteee:uploads
Mar 7, 2026
Merged

Uploads#171
zakkiyyat merged 5 commits intoMixMatch-Inc:mainfrom
inteee:uploads

Conversation

@inteee
Copy link
Contributor

@inteee inteee commented Mar 7, 2026

Image upload endpoint that allows restaurants to upload high-quality food images. Images are not stored directly in the database; instead they are uploaded to cloud storage and the public URL is returned.

Changes Implemented

  1. Added POST /api/upload endpoint.
  2. Integrated multer for handling multipart/form-data uploads.
  3. Connected file storage to AWS S3 (configurable via environment variables).

Implemented validation for:

  • Allowed file types: jpeg, png, webp
  • Maximum file size: 5MB
  • Uploaded images are stored in S3 and the public URL is returned in the response.

closes #143

Copy link
Contributor

@zakkiyyat zakkiyyat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changes and they look good. Once the conflicts are addressed, this can be merged.

Comment on lines +5 to +9
const upload = multer({
storage: multer.memoryStorage(),
limits: { fileSize: 5 * 1024 * 1024 },
})

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add strict MIME allowlist enforcement in the upload route (jpeg/png/webp check), focus on

  • MIME type allowlist enforcement (image/jpeg, image/png, image/webp)
  • File size validation behavior and response shape
  • S3 key/public URL safety and error handling
  • Env var assumptions and missing-config behavior

inteee added 3 commits March 7, 2026 15:33
# Conflicts:
#	README.md
#	backend/README.md
#	backend/package.json
#	backend/src/middleware/error.middleware.ts
#	backend/src/routes/index.ts
Copy link
Contributor

@zakkiyyat zakkiyyat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The requested changes have been applied and everything looks good from my side. Approved.

@zakkiyyat zakkiyyat merged commit 1493160 into MixMatch-Inc:main Mar 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restaurant Image Upload Service

2 participants