Skip to content

Implement resume upload with GCP bucket#72

Open
NickBurnett wants to merge 1 commit into
devfrom
feature/resume
Open

Implement resume upload with GCP bucket#72
NickBurnett wants to merge 1 commit into
devfrom
feature/resume

Conversation

@NickBurnett

Copy link
Copy Markdown
Contributor
  • installed express dependencies for file upload (multer)
  • added bucket reference to firebase admin
  • added express endpoint for resume upload

I haven't tested this iteration locally since it seems to still be suspect on my machine 👀 However the implementation works on a custom project I made so once the local development issue is resolved there shouldn't be many changes (if any) to make.

Additionally, I'm waiting on Sai to get back to me about how he plans on uploading the file from the front end. My solution currently works with forms, so depending on his implementation, this may need to change.

It would probably be best to wait on the merger until the first coding hangouts just to make sure everything is acceptably functional, but I'm making the PR so that's it's here for any feedback you might have😄

- installed express dependencies for file upload (multer)

- added bucket reference to firebase admin

- added express endpoint for resume upload
@ghost

ghost commented Aug 21, 2021

Copy link
Copy Markdown

Sider has detected 1 error and 2 warnings on analyzing the commit ec80f8e.

If the errors persist even after retrying, the following actions may resolve them:

If you still have problems, feel free to ask us via chat. 💬


You can turn off such notifications if unnecessary.

1 similar comment
@ghost

ghost commented Aug 21, 2021

Copy link
Copy Markdown

Sider has detected 1 error and 2 warnings on analyzing the commit ec80f8e.

If the errors persist even after retrying, the following actions may resolve them:

If you still have problems, feel free to ask us via chat. 💬


You can turn off such notifications if unnecessary.

@WillieCubed WillieCubed changed the title Implemented resume upload with GCP bucket Implement resume upload with GCP bucket Oct 4, 2021
@WillieCubed WillieCubed enabled auto-merge October 4, 2021 16:17
@NickBurnett

Copy link
Copy Markdown
Contributor Author

@WillieCubed This will now be done in MongoDB since it's just easier and abstracts the portal-backend a bit more for potential future cloud migrations.

@Balstun Balstun left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can discuss the changes to allow the upload of both a resume and cv in a future commit.
Note that you'll need to resolve the functions/package-lock.json conflicts.

})
}
// The filename used in the GCP bucket and the local temporary store...
const FILENAME = `${request.body.userID}${path.extname(request.file.originalname)}`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, the filename for the resumes seems to be the userID, followed by the file extension. While this is secure and accessible (to portal-backend), it only allows a user to upload a resume or a cv, not both. Note that we don't need more than one resume or cv on hand for a particular member.

Option 1: Add 'Resume' to the filename

Add the string "_resume" to the filename to help differentiate between the resume and cv when accessing data.

Option 2: Upload resume documents within a separate folder from the cvs

Currently, there also exists a folder called profiles, under which the folders resumes and cvs exist. You could upload to the profiles/resumes or profiles/cvs folder respectively, to avoid such confusion.
Note: By generalizing/abstracting the upload function, you could allow the upload the file automatically to a certain folder, based on the fieldname of the request.

// Delete the file from the local store...
fs.rmdir(path.join(RESUMES_DIRECTORY, FILENAME), () => { });
});
// File upload succeeded...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upon the successful upload of a file, we'd like to:

  • Add the corresponding URL to retrieve the resume/cv to the profile.experience.resume field
  • Rename the profile folder to experience, to match the properties of the profile object.
    Note: This is to be done following the refactoring of the profile interface/object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants