-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement resume upload with GCP bucket #72
base: dev
Are you sure you want to change the base?
Conversation
- installed express dependencies for file upload (multer) - added bucket reference to firebase admin - added express endpoint for resume upload
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
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 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. |
There was a problem hiding this comment.
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)}` |
There was a problem hiding this comment.
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... |
There was a problem hiding this comment.
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.
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😄