Upload images into public folder within two frontend applications

16 Views Asked by At

I'm building a project which has 3 applications: server (nest.js), admin (next.js), client (next.js).

Currently I'm adding a feature into admin so him (or moderator) to be able to create a product which requires image, this part is happening in admin application f.e. within the route ./admin/src/app/products/[productId]/create

I decided I will be storing images which relate to the client in the public/ folder on the client in order not to send base64 string or whatever else between server and client.

Want to know if it has any sense to do so. Following this scheme I'll store in the database a path to the image instead of image itself which will save me a lot of space as well as make requests lighter

On of the approaches is to save images via next.js api f.e. and send multipart/formdata but here question appears if it's possible to save images within different applications?

0

There are 0 best solutions below