This is the backend of GhJob.
Written in nodejs, it enables additional services other than Github jobs API such as push notifications, Data projection, Small size of pagination and much more.
You can get the android app on play store
Clone the project and install every thing with
yarn install
After that, create .env
file by copying it from .env.example
and fill it with your values
Now, you can run the server.js
file with node server.js
or nodemon server.js
You can even make it more easy with pm2
so that it'll be launched at boot start
pm2 start server.config.js
Note: Feel free to change the configuration of pm2 as you wish.
But before you play with API, you need to fill in the database and to do so, run the following script:
node populate.js
It will fetch all data from Github jobs API and save them into database
The file notification.js
is a script to constantly notify registered devices about new jobs.
For it to be up-to-date, it needs to be handled by a cron service.
Example of running it each 5 minutes:
*/5 * * * * node /var/www/html/ghjob-nodejs/notification.js >> /var/log/ghjob-nodejs/cron.log
Note: Since we use cron, we need to be aware of paths. Therefore you should edit notification.js to insert absolute path of .env file For instance
change the line 2 from require('dotenv').config()
to
require('dotenv').config({ path: '/absolute-path/ghjob-nodejs/.env' });
Feel free to submit issues or pull requests.
The app is released under the MIT licence. For more information see LICENSE
.