Feat/image admin#34
Merged
Merged
Conversation
…o make the images persist in db, full functionality works
…d a popup with nice ui
RLee64
approved these changes
Apr 28, 2026
Collaborator
RLee64
left a comment
There was a problem hiding this comment.
Great work! Just gotta resolve the merge conflicts and you should be good to merge in.
Just thinking about future tickets:
- At some point we'll want to represent a collection of images (i.e. admins can add and delete from a related set of images, e.g. for an event)
- We'll want more efficient querying at some point where we try to fetch multiple images at once rather than one-by-one, we'll cross that bridge when we get there though and assess what needs to be done
- User roles probably gets fetched from the User Auth context that Vincent made in #30, so the current flow probably gets adjusted a bit (my bad for saying it should be a prop). Change is insignificant though.
| @@ -1,7 +1,7 @@ | |||
| { | |||
| "trailingComma": "es5", | |||
Collaborator
There was a problem hiding this comment.
Prettiered the prettier config 😭
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📑 Description
Adds dynamic image management to the frontend and backend, allowing admins to upload and replace images directly from the UI. Images are stored in AWS S3 and tracked in MongoDB, with each image slot identified by a
pageKeytag.✏️ Summary of Changes
Backend
tagfield to theImagemongoose model to identify image slots (e.g."hero","events")uploadImageinimageController.tsto accept atagfrom the request body and automatically delete the previous S3 object and MongoDB record for that tag before uploading the new onegetImageByTaginimageController.tsto fetch the most recent image for a given tag and return a fresh signed S3 URLGET /api/images/tag/:tagrouteFrontend
fetchImageByTagand updateduploadImageinimageApi.tsto send the tag with the uploadImageBlockcomponent — fetches and displays an image by tag, shows a placeholder if none exists, and exposes a pencil edit button for adminsUploadModalcomponent — file picker with preview, sends image to backend, closes and refreshes the image on success📸 Screenshots
Screen.Recording.2026-04-28.105633.mp4
❗️ For the reviewer
roleprop onImageBlockis hardcoded for now ("admin"or"user") — this will be replaced with real auth laterpageKeystring (e.g."hero","events"). Make sure any new image blocks on other pages use a uniquepageKeyto avoid overwriting the wrong image✅ Ready?