trebol-ecommerce / trebol-backend-monolith

Monolithic eCommerce backend web application that exposes a RESTful API.
MIT License
16 stars 21 forks source link

Figure out storage for product images #25

Closed bglamadrid closed 2 years ago

bglamadrid commented 3 years ago

Said services can be external, each one may behave and integrate differently. Nowadays, a path must be created for images to be stored somewhere, their references saved in a database.

mutasDev commented 3 years ago

Would it be fine to make a storageservice that stores the images on the hard disk, with a reference UUID and store this UUID (resolves to the path of image on the disk) in the db of products?

bglamadrid commented 3 years ago

Would it be fine to make a storageservice that stores the images on the hard disk, with a reference UUID and store this UUID (resolves to the path of image on the disk) in the db of products?

Yes, it could work. But I'd like to separate its implementation logic, abstracting to an interface that enables to use different, maybe multiple storage solutions at once. See #26 too. Problem is, Image entities and related API requests have little metadata to support anything but sending hot links to already stored images. It is not yet designed in a way to support doing the uploading itself in the process. I think I should work a little more on the API before this is implemented, to make both ends comply.