Skip to content

[FEATURE] Upload image of recipe / meal and render dynamically created URL #744

@shanthisa

Description

@shanthisa

Is your feature request related to a problem? Please describe.
Currently all the images are stored and rendered statically. If any new image needs to be added it needs to be added by the one who manages AWS

Describe the solution you'd like
When there are more recipes and we want to give the control to the admin to upload the image to user, then we need to render the image dynamically for the recipe (meal).
We had initially rendered directly the images from the public URL.
The images are at AWS Bucket mealplanner-static in the ca-central-1 region.
I am creating a test bucket and will give access to the developer for testing purposes.
You need to dynamically generate the URLs for each image.

** Dev Notes **

  • The BUCKET_NAME should be read from an environment variable. The bucket is stored in ca central
  • AWS Credentials should be read from the environment variables or standard AWS profile so that we can use instance role later
  • When a user requests to upload a file, create a mutation that returns a pre-signed url to upload a file
  • The react client should now be able to upload the file via the presigned url
  • The database should store the path to the image relative to the bucket
  • The model generating the image url should implement a resolver that constructs the bucket + path url. Since these assets are public we need not generate a presigned get url.

Describe alternatives you've considered
Everytime the system admin (AWS Admin) has to upload each and every image and that is not practical in a production environment when we want them to have smooth user experience.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA feature request for new functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions