Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added Image functionality #243

Merged
merged 1 commit into from
Nov 8, 2024
Merged

Conversation

ShivanshPlays
Copy link
Contributor

Pull Request: Image Upload Functionality

Overview

This pull request introduces image upload functionality to the website, enhancing the user experience by allowing vendors to add images to their dishes. 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 dishes.

Changes Made

1. Image Upload Functionality

  • Implemented a new feature that allows users to upload images for their dishes directly through the UI.

2. Schema Updates

  • Modified the Dish model to include an images array, establishing a relationship with the Image model. This allows each Dish 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 dishes to handle the upload of images alongside other Dish data. This ensures that images are correctly associated with their respective dishes in the database.

7. New Form Page with Image Uploader

  • Added a new page in the Dish form specifically for the image uploader component, providing a dedicated space for users to upload images for their dishes.

Testing

  • Thoroughly tested the image upload functionality, ensuring that images are uploaded to Cloudinary and correctly associated with the dishes in the database.

Conclusion

This enhancement significantly improves the new Dish submission process, making it easier for vendors to add visual content to their dishes, thereby improving the overall user experience on the platform.

PS: I have also pushed a well descriptive .env.example so that other contributors can setup the project easily

closes #241

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

🚀 Thank you for contributing to this project, your support is much appreciated.

Stay awesome! 😎

@Vimall03 Vimall03 merged commit 5875e15 into Vimall03:main Nov 8, 2024
1 check passed
@ShivanshPlays ShivanshPlays deleted the ImageUpload branch November 8, 2024 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Image Upload Functionality for Vendors
2 participants