stark-dusk-42855
Live link to client Client repo here
This server is made with Node and Express with a PostgreSQL database. This is a job board app that allows users to search for and post new jobs.
Users can upload their resume, update, and delete it. They can save jobs to view later as well as apply for job post - if they already have a resume provided.
In the future the jobs will have a default expiry time and ways for the user to set their own desired time. A notification system will be implemented as well. It would notify a user when the job poster has viewed their resume and allow the job poster to automatically send a response back to the user based on their opinion of the resume/cover letter
This server uses SendGrid email API to send an email to the job post's contact with the user's resume and optional cover letter.
Sample Response: 200 ok
"notExpired": [
{
"id": 1,
"user_id": 1,
"title": "Test Title",
"company": "Test Company inc.",
"description": "This is a test job desription",
"salary": 85000,
"exp_level": "mid",
"job_type": "part-time",
"expiry": "30 days",
"location": "Denver, CO",
"created_on": "2021-02-05T08:45:39.999Z",
"has_expired": false,
"contact": "hirelocal01@gmail.com"
}, ... ],
"expired" : []
Sample Response: 200 ok
{
"id": 1,
"user_id": 1,
"title": "Test Title",
"company": "Test Company inc.",
"description": "This is a test job desription",
"salary": 85000,
"exp_level": "mid",
"job_type": "part-time",
"expiry": "30 days",
"location": "Denver, CO",
"created_on": "2021-02-05T08:45:39.999Z",
"has_expired": false,
"contact": "hirelocal01@gmail.com",
"reqs": [
{
"id": 1,
"job_id": 1,
"requirement": "2 years with Node.js"
},
{
"id": 2,
"job_id": 1,
"requirement": "2 years with Express.js"
},
{
"id": 3,
"job_id": 1,
"requirement": "2 years with React"
},
{
"id": 4,
"job_id": 1,
"requirement": "2 years with Cloud Services"
},
{
"id": 5,
"job_id": 1,
"requirement": "2 years with HTML and CSS"
}
]
}
(Requires a bearer token)
Sample Request:
{
"title": "Software Engineer III",
"user_id": "1",
c
"description": "Casual company seeking laid-back software person",
"salary": "420000",
"exp_level": "senior",
"job_type": "full-time",
"contact": "dontemailme@email.com",
"location": "remote"
"reqs": [
{
"requirement": "2 years in one thing"
},
{
"requirement": "2 years in something"
},
{
"requirement": "2 years in something else"
},
{
"requirement": "2 years in not that"
},
{
"requirement": "2 years in business"
}
]
}
Sample Response: 201 ok
{
"id": 8,
"user_id": 1,
"title": "Software Engineer III",
"company": "Test Company inc.",
"description": "Casual company seeking laid-back software person",
"salary": 420000,
"exp_level": "senior",
"job_type": "full-time",
"expiry": "30 days",
"location": "remote",
"created_on": "2021-02-05T09:07:59.060Z",
"has_expired": false,
"contact": "dontemailme@email.com",
"reqs": [
{
"requirement": "2 years in one thing"
},
{
"requirement": "2 years in something"
},
{
"requirement": "2 years in something else"
},
{
"requirement": "2 years in not that"
},
{
"requirement": "2 years in business"
}
]
}
Sample Request:
{
"title": "Updated Job Title"
}
Sample Response:
{
"id": 8,
"user_id": 1,
"title": "Updated Job Title",
"company": "Test Company inc.",
"description": "Casual company seeking laid-back software person",
"salary": 420000,
"exp_level": "senior",
"job_type": "full-time",
"expiry": "30 days",
"location": "remote",
"created_on": "2021-02-05T09:07:59.060Z",
"has_expired": false,
"contact": "dontemailme@email.com",
"reqs": [
{
"requirement": "2 years in one thing"
},
{
"requirement": "2 years in something"
},
{
"requirement": "2 years in something else"
},
{
"requirement": "2 years in not that"
},
{
"requirement": "2 years in business"
}
]
}
Sample Response: 200 ok
{
"saves": [
{
"id": 1,
"user_id": 1,
"job_id": 1
}
]
}
Sample Request:
{
"user_id": 1,
"job_id": 1
}
Sample Response: 201 created
{
"id": 1,
"user_id": 1,
"job_id": 1
}
Sample Response: 204 No Content
Sample Response: 200 ok
{
[
{
"id": 1,
"user_id": 1,
"job_id": 1
}
]
}
Sample Request:
{
"coverLetter": <example.pdf>,
"job_id": 1
}
Sample Response: 201 created
{
"id": 1,
"user_id": 1,
"job_id": 1
}
Sample Response: 200 ok
Postman cannot read .pdf files. As a result, the response view looks very wonky. VScode also requires a special extension to read .pdf files
Sample Request:
{
"resumePDF": resumeFile.pdf
}
Sample Response: 201 created
{
"id": 7,
"user_id": 1,
"resume": {
"type": "Buffer",
"data": [
37,
80,
68,
...
],
},
"original_name": "resumeFile.pdf"
}
Sample Request:
{
"resumePDF": resumeFile.pdf
}
Sample Response: 204 No Content
Sample Response: 204 No Content
If using user dunder-mifflin
:
mv example.env .env
createdb -U dunder-mifflin spaced-repetition
createdb -U dunder-mifflin spaced-repetition-test
If your dunder-mifflin
user has a password be sure to set it in .env
for all appropriate fields. Or if using a different user, update appropriately.
npm install
npm run migrate
env MIGRATION_DB_NAME=spaced-repetition-test npm run migrate
And npm test
should work at this point
For tests involving time to run properly, configure your Postgres database to run in the UTC timezone.
- Locate the
postgresql.conf
file for your Postgres installation.- E.g. for an OS X, Homebrew install:
/usr/local/var/postgres/postgresql.conf
- E.g. on Windows, maybe:
C:\Program Files\PostgreSQL\11.2\data\postgresql.conf
- E.g on Ubuntu 18.04 probably: '/etc/postgresql/10/main/postgresql.conf'
- E.g. for an OS X, Homebrew install:
- Find the
timezone
line and set it toUTC
:
# - Locale and Formatting -
datestyle = 'iso, mdy'
#intervalstyle = 'postgres'
timezone = 'UTC'
#timezone_abbreviations = 'Default' # Select the set of available time zone
Start the application npm start
Start nodemon for the application npm run dev
Run the tests mode npm test
Run the migrations up npm run migrate
Run the migrations down npm run migrate -- 0