- About
- Contributors
- Setup
- CLI Commands
- Testing
- Database Schema
- Endpoint Documentation
- Technologies
- Roadmap
HireUp aims to minimize bias in the hiring process, and reduce efforts required of job applicants to produce application materials and of employers to read through piles of those materials. Job seekers can create anonymous applicant profiles that highlight their skills and values, and employers can browse through those anonymous profiles and message applicants they believe would be a good fit for their open roles.
This repo is the back-end service for HireUp and is consumed by our front-end application. The front-end GitHub repo can be found here and the deployed site here.
- Back-End Team:
- Ruthie Rabinovitch | GitHub | LinkedIn | [email protected]
- Gaby MĂ©ndez | GitHub | LinkedIn | [email protected]
- Front-End Team:
- Erin Untermeyer | GitHub | LinkedIn | [email protected]
- Amy Karnaze | GitHub | LinkedIn | [email protected]
- Greyson Elkins | GitHub | LinkedIn | [email protected]
- If you do not yet have
pyenv
, Python3, or Pip3 installed, follow these instructions. - Clone repo:
git clone [email protected]:HireUp-Turing/HireUp_backend.git
- Virtual Environment Setup:
- Build and activate a virtual environment to install your Python packages with
$ python3 -m venv ./venv
- If you have Python3 set as your global version inside
pyenv
you probably can runpython
instead ofpython3
at the beginning of that command.
- If you have Python3 set as your global version inside
- Activate the virtual environment:
$ source venv/bin/activate
(Run$ deactivate
to deactivate the virtual environment when done working with the app)
- Build and activate a virtual environment to install your Python packages with
- Install Python packages:
$ pip install -r requirements.txt
- Set up local databases
$ createdb hireup_dev # creates your dev database $ createdb hireup_test # creates your test database $ export DATABASE_URL=postgresql://localhost:5432/hireup_dev # connects you to your dev database in order to run the following commands $ python manage.py db migrate # generates new migration files from any changes made to models.py $ python manage.py db upgrade # runs migrations on your dev database $ python manage.py db_seed # seed data in dev database $ export DATABASE_URL=postgresql://localhost:5432/hireup_test # connects you to your test database in order to run the following commands $ python manage.py db upgrade # runs migrations on your test database
- Run
$ export DATABASE_URL=postgresql://localhost:5432/hireup_dev
again to reset DATABASE_URL to the development database for any future work. - In order to avoid needing to restart the server manually after each change to your code, run the following commands, which enable all development features, including debug mode:
$ export FLASK_ENV=development $ flask run
$ python run.py
to run server onlocalhost:5000
(If you get errors concerning theFLASK_APP
environment not being set, try$ export FLASK_APP=manage.py
)
$ python manage.py routes
returns available routes$ python manage.py db_seed
drops all tables, creates all tables, and seeds whichever database is currently set toDATABASE_URL
environment variable.
- Run tests without coverage:
$ pytest -v
- Run tests with coverage report:
$ pytest --cov
- See browser-based coverage report
$ coverage html $ open coverage_html_report/index.html
- See browser-based coverage report
Base URL: Use localhost:5000
to explore endpoints with local server and hireup-be.herokuapp.com
to explore the endpoints via the live Heroku app
{
"success": true,
"data": [
{
"id": 1,
"username": "Anonymous Giraffe",
"email": "[email protected]",
"bio": "Noodle's mom!",
"skills": [
{
"attribute": "flask"
},
{
"attribute": "rails"
},
],
"values": [
{
"attribute": "creativity"
},
{
"attribute": "mentorship"
}
]
},
{
"id": 2,
"username": "Famous Hippo",
"email": "[email protected]",
"bio": "Noodle's mom's accountabilabuddy!",
"skills": [
{
"attribute": "flask"
},
{
"attribute": "rails"
},
],
"values": [
{
"attribute": "creativity"
},
{
"attribute": "mentorship"
}
]
}
]
}
{
"success": true,
"data": {
"id": 1,
"username": "Fancy Chipmunk",
"email": "[email protected]",
"bio": "I'm the best one you could possibly hire",
"skills": [
{
"attribute": "flask"
},
{
"attribute": "rails"
},
],
"values": [
{
"attribute": "creativity"
},
{
"attribute": "mentorship"
}
]
}
}
{
"first_name": "Greyson",
"last_name": "Johns",
"bio": "I'm the best one you could possibly hire",
"username": "Chipmunk",
"skills": [2, 3],
"values": [2]
}
{
"success": true,
"data": {
"id": 6,
"username": "Chipmunk",
"email": "[email protected]",
"bio": "I'm the best one you could possibly hire",
"skills": [
{
"attribute": "flask"
},
{
"attribute": "rails"
},
],
"values": [
{
"attribute": "creativity"
},
{
"attribute": "mentorship"
}
],
}
}
Error handling: Request body with empty arrays for either skills or values when being created will produce a 400 error message
Example erroneous request:
{
"first_name": "Greyson",
"last_name": "Johns",
"bio": "I'm the best one you could possibly hire",
"email": "[email protected]",
"username": "Chipmunk",
"skills": [2, 3]
}
# missing "values" array
Error message response:
{
"success": false,
"error": 400,
"errors": [
"required 'values' parameter is missing"
]
}
Response: Returns alphabetically ordered skills and values that are actively associated with applicant records. This endpoint is used on the front-end in in order to populate search filter options for employers to browse applicant profiles.
{
"success": true,
"data": [
{
"skills": [
{
"id": 2,
"attribute": "flask"
},
{
"id": 1,
"attribute": "rails"
},
{
"id": 3,
"attribute": "ruby"
}
],
"values": [
{
"id": 1,
"attribute": "creativity"
},
{
"id": 2,
"attribute": "mentorship"
}
]
}
]
}
Request Body: Attribute arrays contain ids associated with the selected skills and values attributes on the front-end search page. One of the arrays can be empty, but not both.
{
"skills": [2, 4],
"values": [3]
}
{
"success": true,
"data": [
{
"id": 1,
"username": "Chipmunk",
"email": "[email protected]",
"bio": "Noodle's mom!",
"skills": [
{
"attribute": "rails"
},
{
"attribute": "ruby"
}
],
"values": [
{
"attribute": "creativity"
}
]
},
{
"id": 2,
"username": "Anonymous Giraffe",
"email": "[email protected]",
"bio": "Noodle's mom's accountabilabuddy!",
"skills": [
{
"attribute": "rails"
},
{
"attribute": "flask"
}
],
"values": [
{
"attribute": "creativity"
},
{
"attribute": "mentorship"
}
]
}
]
}
Error handling: A request body that does not specify any skills or values will produce a 400 error message
Example erroneous request:
{
"skills": [],
"values": []
}
# missing skills and values ids
Error message response:
{
"success": false,
"error": 400,
"errors": "At least one skill or value id must be specified in order to filter applicant search results."
}
{
"success": true,
"data": [
{
"id": 1,
"applicant_id": 2,
"employer_name": "Google",
"employer_email": "[email protected]",
"body": "We know you'll rock our world as CEO of Google - please interview with us.",
"read_status": false,
"created_at": "2020-11-01 14:11:53.212912-07:00"
},
{
"id": 2,
"applicant_id": 2,
"employer_name": "Aerion Inc",
"employer_email": "[email protected]",
"body": "Come work for us. Pretty please.",
"read_status": true,
"created_at": "2020-11-01 14:11:53.212912-07:00"
}
]
}
Request: Body should specify applicant_id
(referencing the message recipient), employer_name
, employer_email
, and a message body
. read_status
defaults to false
and should not be included in the request body.
{
"applicant_id": 1,
"employer_name": "Turing",
"employer_email" : "[email protected]",
"body" : "We're interested in interviewing you for our Back-End Instructor role. You'll rock our students' worlds!"
}
{
"success": true,
"data": {
"id": 3,
"applicant_id": 1,
"employer_name": "Blop",
"employer_email": "[email protected]",
"body": "We're desperate to hire you at Blop Corp. Will you interview with us this Friday?",
"read_status": false,
"created_at": "2020-11-02 02:10:15.909406-07:00",
"success": true
}
}
Response: Returns all skills. Used on the front-end to populate the list of skills an applicant may select when creating their profile.
{
"success": true,
"data": [
{
"id": 1,
"attribute": "rails"
},
{
"id": 2,
"attribute": "flask"
},
{
"id": 3,
"attribute": "ruby"
},
{
"id": 4,
"attribute": "java"
},
...
]
}
Response: Returns all values. Used on the front-end to populate the list of values an applicant may select when creating their profile.
{
"success": true,
"data": [
{
"id": 1,
"attribute": "creativity"
},
{
"id": 2,
"attribute": "mentorship"
},
{
"id": 3,
"attribute": "engages with community"
},
...
]
}
- Python
- Flask
- SQLAlchemy
- Pytest
- TravisCI
Feel free to explore our list of open issues and our project board to learn about what our team has in mind for future iterations of HireUp