Skip to content

final-project-resume-roast created by GitHub Classroom

License

Notifications You must be signed in to change notification settings

osu-cs494-w24/ResumeRoast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 

Repository files navigation

Resume Roast

A React.js powered Webapp using the Dropbox API and Disqus for getting feedback on your resume. Upload your resume to Dropbox using our OAuth API frontend, then leave feedback on other people's resumes using the Disqus thread linked to each document.

Configuration and Hosting

:octocat: > git clone && cd ResumeRoast/resume-roast

📦 > npm i

📂 > mkdir thumbnails

📄 Create .env.local

DROPBOX_CLIENT_SECRET="{Get this from Dropbox}" # Or from Will if you are on the team
VITE_DROPBOX_CLIENT_ID="{This is also from Dropbox}" # Or from Will if you are on the team
VITE_OAUTH_REDIRECT_URL="{Your absolute path to /login (Like http://localhost:5173/login)}"

🏃 Run this command!

npm run host # Runs the server on port 8000

Routes

Website Routes

🏠 /

🔑 /login

📙 /r/

😃 /me

📜 /about


API Routes

🪙 /api/tokenExchange

"method": "POST",
"body": {
    "code": "{Authentication Code granted by Dropbox}"
}

⬇️

"status": 200,

⬆️ /api/upload

"method": "POST",
"body": "{Byte array of PDF file}"
"header": {
    "Auth-Code": "{Authentication Code granted by Dropbox}",
    "Content-Type": "application/octet-stream",
}

⬇️

"status": 200,
"content-type": "application/json",
"body": {
    "link": "{Dropbox link to pdf file}",
    "version": "{Number of pdfs associated with this user}"
}

📚 /api/allpdfs

"method": "GET",

⬇️

"status": 200,
"content-type": "application/json",
"body": [
    {
        "id": "{Dropbox User ID}", 
        "link": "{Link to this user's latest resume}"
    }
]

📗 /api/pdf

"method": "GET",
"queryParameters": {
    "id": "{Dropbox User ID}",
    "version": "[OPTIONAL] {Number used to identify older resume version}"
}

⬇️

"status": 200,
"content-type": "application/json",
"body": {
    "link": "{Link to pdf file}",
}

📷 /api/thumbnail

"method": "GET",
"queryParameters": {
    "id": "{Dropbox User ID for pdf owner (used for caching)}"
}

⬇️

"status": 200,
"content-type": "image/png",
"body": "{Thumbnail Image Data}"

Data Storage

🗝️ Dropbox Access Tokens

Dropbox Access Tokens are only kept in runtime storage on the server. They are kept in a variable tokens in server.js, and each one is deleted every 4 hours as it expires according to Dropbox. Each access token is paired with the authentication code used to generate it, so that the server can identify each client. The structure of tokens is as so:

{
    "{Dropbox Authentication Code}": {
        "token": "{Latest Dropbox Access Token for that User}",
        "id": "{Dropbox User ID}"
    }
}

⛓️ Public PDF Links

A similar object is kept to store the links we generate for each uploaded pdf, with the biggest difference being that this object is instantiated by reading in data.json, and each time a new pdf is added, we modify data.json. The structure of pdfLinks/data.json is as so:

{
    "{Dropbox User ID}": ["{Array of pdf links, with latest at the start}"]
}

🖼️ PDF Thumbnail Images

Upon each new resume upload, a thumbnail for the pdf is generated and stored in /thumbnails. A thumbnail is only kept for the latest pdf generated for each user. The thumbnail is named using the Dropbox User ID for the account, minus the dbid: at the start, and in the .png format. The API route /api/thumbnail handles removing the dbid: from the Dropbox User ID.

About

final-project-resume-roast created by GitHub Classroom

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •