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

Feat: Set Up Cloudinary for Universal Image Upload Functionality #319

Closed
4 tasks done
samar12-rad opened this issue Oct 16, 2024 · 5 comments · Fixed by #438
Closed
4 tasks done

Feat: Set Up Cloudinary for Universal Image Upload Functionality #319

samar12-rad opened this issue Oct 16, 2024 · 5 comments · Fixed by #438
Assignees
Labels
enhancement New feature or request gssoc-ext gssoc-extd program hacktoberfest accepted hacktoberfest-accepted repo level3 for 45 points

Comments

@samar12-rad
Copy link
Contributor

samar12-rad commented Oct 16, 2024

Describe the feature

Description: We need to integrate Cloudinary for handling image uploads across the cafe website, ensuring a scalable and reusable solution that can be used for various features. This API will allow for future functionality, such as adding images to event creation, user profile editing, and other media-related needs. The implementation should be universal and not restricted to any single part of the website.

Tasks:
Install and Configure Cloudinary:
Install the Cloudinary SDK in both the backend and frontend if necessary.
Create a Cloudinary account and configure API keys in a .env file to keep them secure.
Set up Cloudinary configurations (e.g., API secret, API key, cloud name) on the server.

Develop a Universal Image Upload API:
Implement a reusable API endpoint to handle image uploads. This API should:
Accept file uploads (e.g., images from forms).
Integrate with Cloudinary for storing and managing images.
Return the uploaded image's URL for storage in the database.

Ensure that this API can be used for multiple features, including:
Event creation (upload event banners or images).
User profile page (upload profile pictures).
Future features that require image management.

Client-Side Integration:
Create a frontend utility function that can call the image upload API whenever needed.
Add file input handling for event creation and profile editing forms to allow users to upload images.
Display a preview of the image after it is selected for upload (optional).

Database Integration:
Ensure the URLs of uploaded images are stored correctly in the database for their respective features.
Adjust the existing database schema if necessary to accommodate these image links (e.g., events and user profiles).

Validation and Error Handling:
Add proper validation for image uploads:
Restrict file types to valid image formats (e.g., JPEG, PNG).
Set file size limits.
Handle errors gracefully on both frontend and backend, providing feedback to users (e.g., if an image fails to upload or is too large).
Secure the upload endpoint by verifying that only authenticated users can upload images (relevant for profile editing).

Testing and Deployment:
Test the API thoroughly for different scenarios (successful upload, invalid file types, large file sizes).
Ensure images are correctly uploaded to Cloudinary and the correct URLs are returned.

Additional Considerations:
Plan for handling multiple image uploads in the future if needed (e.g., for galleries).
Ensure security and privacy around images uploaded by users (especially profile pictures).
Keep API endpoints extensible for future media-related features.

Add ScreenShots

Record

  • I agree to follow this project's Code of Conduct
  • I have starred the repository
  • I'm a gssoc-24-extd contributor
  • I want to work on this issue
@samar12-rad samar12-rad added the enhancement New feature or request label Oct 16, 2024
Copy link
Contributor

Thank you for creating this issue! 🎉 We'll look into it as soon as possible. In the meantime, please make sure to provide all the necessary details and context. If you have any questions or additional information, feel free to add them here. Your contributions are highly appreciated! 😊

You can also check our CONTRIBUTING.md for guidelines on contributing to this project.
for more information join our discord https://discord.gg/Jh3bWQ7FRN

@RamakrushnaBiswal
Copy link
Owner

good idea @samar12-rad

@RamakrushnaBiswal RamakrushnaBiswal added level3 for 45 points gssoc-ext gssoc-extd program hacktoberfest accepted hacktoberfest-accepted repo labels Oct 16, 2024
@harshbhar0629
Copy link
Contributor

@RamakrushnaBiswal Can i work on this issue..?

@RamakrushnaBiswal
Copy link
Owner

@harshbhar0629 yes you can

Copy link
Contributor

github-actions bot commented Nov 2, 2024

Hello @samar12-rad! Your issue #319 has been closed. Thank you for your contribution!🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gssoc-ext gssoc-extd program hacktoberfest accepted hacktoberfest-accepted repo level3 for 45 points
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants