Skip to content

Commit

Permalink
Merge pull request #34 from jobapis/1.0
Browse files Browse the repository at this point in the history
Version 1.0 Release
  • Loading branch information
karllhughes authored Dec 31, 2016
2 parents 54c8891 + a51518b commit 492a61d
Show file tree
Hide file tree
Showing 5 changed files with 122 additions and 15 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ language: php

php:
- 7.0
- 7.1

addons:
postgresql: "9.4"
Expand Down
75 changes: 75 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"name": "JobsToMail",
"description": "Your personal job-search assistant.",
"repository": "https://github.com/jobapis/jobs-to-mail",
"logo": "https://www.jobstomail.com/img/logo.png",
"keywords": [
"job boards",
"emails"
],
"addons": [
"heroku-postgresql:hobby-dev",
"scheduler:standard"
],
"env": {
"APP_ENV": "production",
"APP_KEY": {
"description": "Generate a unique key after deployment by running `php artisan key:generate`",
"value": "base64:Pqfff+YzQZNkTHm6pkgmNm2gdpLxBZ3VXhdpWAkIzNI="
},
"APP_DEBUG": {
"description": "Debug mode",
"value": "false"
},
"APP_URL": {
"required": true
},
"CACHE_DRIVER": "file",
"QUEUE_DRIVER": "database",
"SESSION_DRIVER": "file",
"DB_CONNECTION": {
"description": "Use Heroku's Postgresql by default",
"value": "pgsql_heroku"
},
"MAIL_DRIVER": "sendgrid",
"SENDGRID_API_KEY": {
"description": "Required for email delivery",
"required": true
},
"GA_TRACKING_ID": {
"description": "Google Analytics ID for your app",
"required": false
},
"CAREERBUILDER_KEY": {
"required": false
},
"CAREERJET_KEY": {
"required": false
},
"INDEED_KEY": {
"required": false
},
"JUJU_KEY": {
"required": false
},
"USAJOBS_KEY": {
"required": false
},
"ZIPRECRUITER_KEY": {
"required": false
}
},
"formation": {
"web": {
"quantity": 1,
"size": "hobby"
},
"queue": {
"quantity": 1,
"size": "hobby"
}
},
"scripts": {
"postdeploy": "echo Done"
}
}
3 changes: 1 addition & 2 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php namespace JobApis\JobsToMail\Providers;

use Illuminate\Support\Facades\Validator;
use Illuminate\Support\ServiceProvider;
use JobApis\Jobs\Client\JobsMulti;
use League\Csv\Writer;
Expand Down Expand Up @@ -39,7 +38,7 @@ public function register()
return new JobsMulti(config('jobboards'));
});
// CSV Writer
$this->app->bind('League\Csv\Writer', function ($app) {
$this->app->bind('League\Csv\Writer', function () {
return Writer::createFromString('');
});
}
Expand Down
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ All Notable changes to `jobs-to-mail` will be documented in this file.
- Premium interest page and form.
- Added images of providers on home page.
- Upgraded to [JobsMulti v1.0](https://github.com/jobapis/jobs-multi).
- Support for PHP 7.1.
- One-click Heroku deploy.

### Fixed
- Plaintext email job listings were showing up as blank.
Expand Down
56 changes: 43 additions & 13 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Installation requires the following:
- [Composer](https://getcomposer.org/)
- [Node 6.0+](https://nodejs.org/en/blog/release/v6.0.0/)
- [NPM](https://www.npmjs.com/)
- [Gulp](https://github.com/gulpjs/gulp-cli)
- A web server ([Nginx](https://nginx.org/en/) recommended)

### Local installation
Expand All @@ -46,31 +47,60 @@ composer create-project jobapis/jobs-to-mail

### Heroku installation

1. Run `heroku create` to create a new app on Heroku
1. Use the one-click Deploy to Heroku button: [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)

2. Run `heroku buildpacks:set heroku/php` to declare it as a PHP application
2. After it's deployed, you should be able to visit your app and see the home page.

3. Set Laravel encryption key with: `heroku config:set APP_KEY=$(php artisan --no-ansi key:generate --show)`
3. Set an application key by running `heroku run "php artisan key:generate --show" --app=j2m` and adding the key that is displayed to your app's config variables.

4. Add Postgres to Heroku with: `heroku addons:add heroku-postgresql:hobby-dev`
4. Add a job in Heroku Scheduler to run `php artisan jobs:email` every night. This will ensure that users receive their emails.

5. Set the appropriate database config with: `heroku config:set DB_CONNECTION="pgsql_heroku"`
### Server installation

#### Additional Requirements
- A server running [Linux Ubuntu 16.04+](http://releases.ubuntu.com/16.04/)
- [PHP-FPM](https://php-fpm.org/)
- [NGINX](https://www.nginx.com/resources/wiki/)

1. Use composer to [create a new project](https://getcomposer.org/doc/03-cli.md#create-project):

```
composer create-project jobapis/jobs-to-mail
```

6. Push the code to Heroku with: `git push heroku master`
2. Copy `.env.example` to `.env` and customize it with your environmental variables.

7. Run `heroku run php artisan migrate` to perform database migrations
3. Run `npm install && gulp` to build the frontend.

8. Run the job collection/email job: `heroku run php artisan jobs:email`. This can be run via [Scheduler](https://elements.heroku.com/addons/scheduler) in order to send emails at regular intervals.
4. Point NGINX to serve to the `/public` directory. Your NGINX config block should look something like this:

9. Run `heroku config:set QUEUE_DRIVER="database"` to queue up jobs and perform them asynchronously. This is optional, but since Heroku limits your process time it's pretty helpful if you want to process more than a couple records.
```conf
server {
listen 80;
server_name yourdomain.com;
root /home/user/jobs-to-mail/public;
index index.html index.htm index.php;
9. Launch the app on Heroku by running `heroku open`
charset utf-8;
### Server installation
```
Coming soon.
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
```

5. Ensure that PHP-FPM is running, and ensure that your site is running at your domain.

6. Create a [cron job](https://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/) to run the job collection and notification process nightly: `php artisan jobs:email`.

## Command Line
After users sign up for a job search, the only thing needed to collect jobs and send them emails is the following command:

Expand Down

0 comments on commit 492a61d

Please sign in to comment.