-
Notifications
You must be signed in to change notification settings - Fork 58
Create Image upload component for products admin page #54
Comments
Hey i would like to work on this. I have few doubts, so instead of manually uploading to ImgBB, admin need to upload file to the DB right? |
Yes, you're right! Also, you should take care of rendering the images in the frontend. Could you explain doing this? Also if you have another solution you're welcome to discuss it. |
I have done some research about storing files directly in mongodb and i got to know that it is not the best way but we can try. |
And yes, imgBB provides API so we can use the api service and upload |
I don't like the service of ImgBB because it has a lot of bugs. I ended up with an authentication bug a few days back. Instead, we can Cloudinary. What' 's your thought on this? |
Seems like cloudinary is the next better option. |
@roopeshsn i have a doubt in case if we are using cloudinary then i need to add a new env variable of api key given by cloudinary and then if everything goes well you are going to merge and then you are going set a new env variable as cloudinary api key in heroku dashboard then deploy. This is the flow right ? |
Yes, you're right! |
so should i start working on this? |
Yeah, go ahead! Work on a new branch. We'll discuss weekly the progress. |
Sure. |
@roopeshsn do we need to show review of the image after successfully uploading? |
Could you share what that review looks like? |
I haven't worked on it but beside file input field we can show preview. |
I will review the code and let you know tomorrow. Also, add screenshots of your work. |
Sure! |
@roopeshsn screen-capture.1.mp4 |
@roopeshsn i have made few modifications to CreateProduct page which are
Any thoughts on this changes? Here is the demo - |
How will it be if that path component is removed? Bear with me for delaying accepting the PR as I don't find time to review the code. |
Could you also show the product page with the image, description, and pricing? |
No problem😃. |
|
No, I am saying that remove the img path component. Why do we need to show the path of the image to the user? |
@roopeshsn Can i commit changes then? |
For admin, there is an option to create a new product.
Here is the form when you click that "Create Product" button.
For the Image Src field, Freshbey uses ImgBB service. ImgBB is an image hosting service. You can host images and get direct links. If I want to add an image, I'll manually go to ImgBB and upload the image and I will get the direct link. I'll then paste that link into this "Img Src" field. After that when I click the "Update" button the data will be stored in the Database.
As you see this is a very hectic process. I don't want admins or editors to go to that ImgBB service to upload the product image. Create an image upload component so that we can directly upload the image from the local system. That image should directly store in the database.
We have the "Edit Product" option. Take care of the image upload there too.
If you have any queries feel free to reach out. Also, if you have any other solutions do let me know!
The text was updated successfully, but these errors were encountered: