EventHopper / EHServerSide

Server-Side functionality including REST API, hosting scripts & client-server modules
0 stars 0 forks source link

Configure Amazon S3 for Upload & Storage #90

Open kylermintah opened 4 years ago

kylermintah commented 4 years ago

Amazon S3 Setup 📦

Rationale

When a user changes their profile picture via a route, the image needs to be compressed and uploaded to S3, the URL of the S3 object then needs to be stored in MongoDB under the user document's image URL field.

When an event creator uploads event-related photo(s) via a route, the image(s) need to be compressed and uploaded to S3. The URL of the S3 object then needs to be stored in MongoDB under the relevant event document's image URL field.

List of requirements for Node

  • Create a Storage module for all things related to file management. Other classes will be able to use it.
  • express enabled uploading
  • uploadImage(): should upload an image to S3 and return a Download URL to the image for storage in relevant mongo document
  • updateDocument(): should update the relevant mongo document with the Download URL of the S3 image object

Helpful Resources

Medium Tutorial freeCodeCamp Tutorial (recommended)