DSGT-DLP / Deep-Learning-Playground

Web Application where people new to Deep Learning can input a dataset and toy around with basic Pytorch modules without writing any code
MIT License
24 stars 8 forks source link

[FEATURE]: Handle File Uploading on Frontend Using SST Endpoints #917

Closed dwu359 closed 1 year ago

dwu359 commented 1 year ago

Feature Name

Handle File Uploading on Frontend Using SST Endpoints

Your Name

Daniel Wu

Description

The presigned upload url endpoint has been migrated from the backend to SST already. You can access it using the prod endpoint https://em9iri9g4j.execute-api.us-west-2.amazonaws.com/ with route GET /datasets/user/{type}/{filename}/presigned_upload_url. Keep in mind that this endpoint requires a bearer token for authentication.

The frontend also currently uses RTK Queries to send requests to the backend. It's like fetch or axios but it is easier to integrate with Redux and has extra features. You may find the Redux Devtools extension also helpful.

This medium article is also pretty good at explaining how AWS presigned urls work: https://medium.com/@aidan.hallett/securing-aws-s3-uploads-using-presigned-urls-aa821c13ae8d

Modify the uploadDatasetFile RTK Query in frontend/src/features/Train/redux/trainspaceApi.ts to use the SST presigned_upload_url endpoint to upload user dataset files.

github-actions[bot] commented 1 year ago

Hello @dwu359! Thank you for submitting the Feature Request Form. We appreciate your contribution. :wave:

We will look into it and provide a response as soon as possible.

To work on this feature request, you can follow these branch setup instructions:

  1. Checkout the main branch:

     git checkout nextjs
  2. Pull the latest changes from the remote main branch:

     git pull origin nextjs
  3. Create a new branch specific to this feature request using the issue number:

     git checkout -b feature-917

    Feel free to make the necessary changes in this branch and submit a pull request when you're ready.

    Best regards, Deep Learning Playground (DLP) Team

karkir0003 commented 1 year ago

will the api endpoint base url be a constant? @dwu359

noah-iversen commented 1 year ago

will the api endpoint base url be a constant? @dwu359

Did we end up deciding this?

karkir0003 commented 1 year ago

noah merged this PR in