Skip to content

A React.js powered Webapp using the Dropbox OAuth API and Disqus for getting feedback on your resume

License

Notifications You must be signed in to change notification settings

VVill-ga/ResumeRoast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Resume Roast

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

Configuration and Hosting

:octocat: > git clone {this repo} /var/www/ResumeRoast

📄 Create .env.local

DROPBOX_CLIENT_SECRET="{Get this from Dropbox}"
VITE_DROPBOX_CLIENT_ID="{This is also from Dropbox}"
VITE_DISQUS_SHORTNAME="{Get this from Disqus}"
VITE_BASE_URL="{Your absolute path to / (Like http://localhost:8000/) including the trailing slash}"

🏃 Run these commands!

# edit roast.service if you cloned this repo to a different location
cp roast.service /usr/lib/systemd/system/roast.service # Or wherever you store your service files
sudo systemctl daemon-reload
sudo systemctl enable roast
sudo systemctl start roast

🙅 No Systemd? Run this instead:

npm i && npm run build && npm run host # Builds and 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,
"body": {
    "id": "{Dropbox User ID}"
}

⬆️ /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

An SQLite Database (data.db)is maintained to track pdf links for all users. This database contains a single table called data, and each row contains a Dropbox User ID which acts as the primary key id, the name associated with the Dropbox account, and a string of comma deliminated pdf links links, which is ordered such that the latest resume is in the front.

{
    "id": "{Dropbox User ID}",
    "name": "{Dropbox Username}",
    "links": "{pdfLink1,pdfLink2,pdfLink3...}"
}

🖼️ 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

A React.js powered Webapp using the Dropbox OAuth API and Disqus for getting feedback on your resume

Resources

License

Stars

Watchers

Forks