Aggregate job opportunities with homeless service providers so that people can search for a job that fits their skillset.
- Clone this repo to your local drive.
- Change to the jobs-for-hope directory:
cd jobs-for-hope
- Install the node server npm depedencies:
npm install
- Obtain the
.env
file from the slack channel and place it in this directory. It contains private info (i.e., the production database connection string) that we cannot put in this public GitHub repo. - Change to the client directory:
cd client
- Install the client (React) dependencies:
npm install
- Run
npm start
from the jobs-for-hope directory to start the node server. - Run
npm start
from the jobs-for-hope/client directory to start the react app and open the browser.
-
Download the required software for the project
a. For OSX
brew install python@2 git
b. For Windows, install them from the official sites or via chocolatey
- Python 2.7 (https://www.python.org/downloads/release/python-2715/)
- Git (https://git-scm.com/downloads) GUI Add-Ons(https://git-scm.com/downloads/guis)
-
Install virtualenv using pip
pip install virtualenv virtualenvwrapper
-
Find virtualenvwrapper.sh location
which virtualenvwrapper.sh
-
Create directory to hold virtual environments
mkdir $HOME/.virtualenvs
-
Add to .bash_profile
export WORKON_HOME=$HOME/.virtualenvs source /path/to/virtualenwrapper.sh
-
Create the virtualenv
source ~/.bashrc // activate virtualenvwrapper.sh, just for the first time mkvirtualenv jobs-for-hope mkvirtualenv -p /usr/local/bin/path/to/python2.7 jobs-for-hope // use this if the system default is python3
-
Activate the virtualenv
workon // list the existing virtual environments, blank if none is created workon jobs-for-hope // activate virtual environment, not needed when first creating the virtualenv
-
Install project dependencies
pip install -r ./requirements.txt
-
Work on the scraper and run
a. for sqlite
python jfh_scraper.py
b. for postgres
python scraper_runner.py
-
Deactivate the virtualenv
deactivate // switch back to system python
We're moving towards using postgres and using the instance hosted on aws. The sqlite will go away soon.
-
Install DBeaver for your system.
-
Add a database connection with the .env file credentials from the slack channel.
-
The jobs are in the jobs table.
-
Install sqlite
brew install sqlite
-
Make sure the db file is there
ls -l jobs_for_hope.db
-
Open the database environment (Ctrl-D to exit)
sqlite3 jobs_for_hope.db
-
Print the db schema
.schema
-
Print the jobs table row count
select count(*) from jobs;
-
Print all the jobs
select * from jobs;
-
Exit db. Press Ctrl-D
- app.py: This is the main entrypoint into the application that contains the routes and associated business logic. This file also contains the main instantiation of the app object
- api.py: This is the main class for the REST API that allows interaction with the database
- backend/requirements.txt: This is the file that contains all of the projects backend dependencies. Pip looks inside here when it installs all dependencies
- backend/jfh_scraper.py: This is the scraper which parses websites for jobs data and stores them in an sqlite database
- readme.md: This is the file that contains all instructions and descriptions about jobs-for-hope
- static folder: This folder contains all of the Javascript and CSS content. Place all JS and CSS into their respective folders.
- templates folder: This folder contains all of the html templates that are rendered by the application. All Jinjas2 and HTML templates go here.
- utilities folder: This folder contains all of the helper tools used to write and read data to and from the database. It also contains utility scripts used for the application
- master: main stable branch with frontend and backend getting data from a temporary spreadsheet
- seleniumscrapers: development branch for the python scraper
- db_backend: development branch which integrates the frontend with the backend api using real data from the sqlite database