This pull request introduces image upload functionality to the website, enhancing the user experience by allowing sellers to add images to their listings. The implementation includes schema modifications, the integration of Cloudinary for image storage, a reusable image uploader component, and updates to the global state management and backend action for posting listings.
Changes Made
1. Image Upload Functionality
Implemented a new feature that allows users to upload images for their listings directly through the UI.
2. Schema Updates
Modified the Listing model to include an images array, establishing a relationship with the Image model. This allows each listing to have multiple associated images.
3. Cloudinary Integration
Set up Cloudinary in the project to handle image uploads and storage efficiently.
Updated the Next.js configuration (next.config.js) to include necessary Cloudinary settings for seamless integration.
4. Reusable Image Uploader Component
Developed a reusable image uploader component that can be utilized across different parts of the application, promoting consistency and reducing code duplication.
5. Global State Modifications
Updated the global state management of the form to accommodate the image uploading feature. This ensures that the images are properly tracked in the application's state.
6. Backend Action Adjustments
Modified the backend action for posting listings to handle the upload of images alongside other listing data. This ensures that images are correctly associated with their respective listings in the database.
7. New Form Page with Image Uploader
Added a new page in the listing form specifically for the image uploader component, providing a dedicated space for users to upload images for their listings.
Testing
Thoroughly tested the image upload functionality, ensuring that images are uploaded to Cloudinary and correctly associated with the listings in the database.
Conclusion
This enhancement significantly improves the listing submission process, making it easier for sellers to add visual content to their listings, thereby improving the overall user experience on the platform.
Pull Request: Image Upload Functionality
Overview
This pull request introduces image upload functionality to the website, enhancing the user experience by allowing sellers to add images to their listings. The implementation includes schema modifications, the integration of Cloudinary for image storage, a reusable image uploader component, and updates to the global state management and backend action for posting listings.
Changes Made
1. Image Upload Functionality
2. Schema Updates
Listing
model to include animages
array, establishing a relationship with theImage
model. This allows each listing to have multiple associated images.3. Cloudinary Integration
next.config.js
) to include necessary Cloudinary settings for seamless integration.4. Reusable Image Uploader Component
5. Global State Modifications
6. Backend Action Adjustments
7. New Form Page with Image Uploader
Testing
Conclusion
This enhancement significantly improves the listing submission process, making it easier for sellers to add visual content to their listings, thereby improving the overall user experience on the platform.
https://github.com/user-attachments/assets/66ff5b9e-801b-46a6-99b2-81d437127772
closes #413