Skip to content

Commit

Permalink
Merge pull request #12 from NathanWorkman/feature/tooling
Browse files Browse the repository at this point in the history
Feature/tooling
  • Loading branch information
NathanWorkman authored Apr 9, 2018
2 parents d3d15dd + f53fff4 commit 6f20c0d
Show file tree
Hide file tree
Showing 16 changed files with 4,897 additions and 27 deletions.
30 changes: 22 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,32 @@ ECHO_GREEN = @echo "\033[33;32m $1\033[0m"
HOST ?= localhost:8000

reset: delete_sqlite migrate user run
setup: virtualenv requirements migrate user yarn build collectstatic

virtualenv:
# Create virtualenv
$(call ECHO_GREEN, Creating virtualenv... )
virtualenv -p python3 $(VIRTUALENV_NAME)

requirements:
# Install project requirements
$(call ECHO_GREEN, Installing requirements... )
( \
source venv/bin/activate;\
$(PIP_INSTALL_CMD) -r requirements.txt; \
)

migrate:
# Run django migrations
$(call ECHO_GREEN, Running migrations... )
( \
cd seeker; \
$(MANAGE_CMD) migrate; \
)

user:
# Create user account
$(call ECHO_GREEN, Creating super user... )
( \
cd seeker; \
echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'admin@email.com', 'pass')" | ./manage.py shell; \
Expand Down Expand Up @@ -90,15 +95,9 @@ migrations:
$(MANAGE_CMD) makemigrations; \
)

migrate:
# Run database migrations
( \
cd seeker; \
$(MANAGE_CMD) migrate; \
)

collectstatic:
# Collect static assets
$(call ECHO_GREEN, Collecting static assets...)
( \
cd seeker; \
$(MANAGE_CMD) collectstatic; \
Expand All @@ -109,7 +108,7 @@ run:
$(call ECHO_GREEN, Starting Django Server...)
( \
cd seeker; \
$(MANAGE_CMD) runserver; \
gulp; \
)


Expand All @@ -135,3 +134,18 @@ delete_sqlite:
cd seeker; \
rm -rf db.sqlite3;\
)

yarn:
# install npm modules
$(call ECHO_GREEN, Installing npm modules... )
( \
yarn; \
)

build:
# build static assets
$(call ECHO_GREEN, Compiling static assets... )
( \
cd seeker; \
gulp build; \
)
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,19 @@ To change the search terms edit the query inside each spider.

## Setup

Some quick setup instructions
Some quick setup instructions:

You will need `yarn` and `virtualenv` installed on your machine.

Install Yarn
```
brew install yarn
```

Install virtualenv
```
pip install virtualenv
```

I would recommend installing [virtualenv](https://virtualenv.readthedocs.io/).

Expand All @@ -24,11 +36,12 @@ cd seeker/
virtualenv venv -p python3
source venv/bin/activate
pip install -r requirements.txt
yarn
cd seeker/
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
make build
make run
```

### To run the spiders
Expand Down Expand Up @@ -74,12 +87,12 @@ Want a spider not listed here? Feel free to open a pull request and add it to th
- [x] [Stack Overflow](https://www.stackoverflow.com/jobs)
- [x] [Indeed](https://www.indeed.com)
- [ ] [Angel.co](https://angel.co/)
- [ ] [RemotePython](https://www.remotepython.com)
- [x] [RemotePython](https://www.remotepython.com)
- [ ] [DjangoJobs](https://djangojobs.net/jobs/)
- [ ] [DjangoGigs](https://djangogigs.com)
- [x] [DjangoGigs](https://djangogigs.com)
- [ ] [Jobspresso](http://jobspresso.co)
- [ ] [We Work Remotely](https://weworkremotely.com/)
- [ ] [Python.org](https://www.python.org/jobs/)
- [x] [Python.org](https://www.python.org/jobs/)
- [ ] [Working Nomads](https://www.workingnomads.co/jobs)
- [ ] [Remote Work Hub](https://remoteworkhub.com)
- [ ] [Telecommunity](http://remotejobs.telecommunity.net/#s=1)
Expand Down
27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "seeker",
"version": "1.0.0",
"description": "Job Board Aggregator",
"main": "index.js",
"repository": "git@github.com:NathanWorkman/seeker.git",
"author": "Nathan Workman <nathancworkman@gmail.com>",
"license": "MIT",
"private": false,
"dependencies": {
"browser-sync": "^2.18.13",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^4.0.0",
"gulp-concat": "^2.6.1",
"gulp-cssnano": "^2.1.2",
"gulp-load-plugins": "^1.5.0",
"gulp-notify": "^3.0.0",
"gulp-plumber": "^1.1.0",
"gulp-sass": "^3.1.0",
"gulp-sourcemaps": "^2.6.1",
"gulp-spawn": "^0.4.0",
"gulp-uglify": "^3.0.0",
"gulp-util": "^3.0.8",
"gulp-watch": "^4.3.11",
"node-sass": "^4.5.3"
}
}
1 change: 0 additions & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ pytest-django==3.1.2
flake8==3.5.0
tox==3.0.0
pytest-factoryboy==2.0.1

81 changes: 81 additions & 0 deletions seeker/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var browserSync = require('browser-sync');
var gutil = require('gulp-util');
var exec = require('child_process').exec;
var spawn = require('child_process').spawn;
var reload = browserSync.reload;
var src = 'seeker/static_src/';
var dist = 'seeker/static_src/dist/';
var ignore = ['!node_modules'];

// +++++++++++++++++++++++++++++++++++++++
// Gulp tasks to build static assets
// +++++++++++++++++++++++++++++++++++++++

function errorAlert(err) {
$.notify.onError({
title: "Gulp Error",
message: "Check your terminal",
sound: "Basso"
})(err);
gutil.log(gutil.colors.red(err.toString()));
this.emit("end");
}

// Styles
gulp.task('css', function() {
return gulp.src(src + 'css/style.scss')
.pipe($.plumber({errorHandler: errorAlert}))
.pipe($.sourcemaps.init())
.pipe($.sass())
.pipe($.autoprefixer({
browsers: ['last 2 versions'],
cascade: false }))
.pipe($.cssnano())
.pipe($.sourcemaps.write('.'))
.pipe(gulp.dest(dist + 'css/'))
});

// Scripts
gulp.task('js', function() {
return gulp.src([
src + 'js/lib/**.js',
src + 'js/**.js'
])
.pipe($.plumber({errorHandler: errorAlert}))
.pipe($.concat('main.min.js'))
.pipe($.uglify())
.pipe(gulp.dest(dist + 'js/'))
});

// Move Images
gulp.task('images', function() {
return gulp.src(src + 'img/**/**')
.pipe(gulp.dest(dist + 'img'))
})

// Build static assets
gulp.task('build',['css','js','images']);

// Deafult Gulp Task
gulp.task('default',['runserver'], function() {
browserSync.init({
notify: true,
online: true,
injectChanges: true,
proxy: "localhost:8000"
});
gulp.watch(ignore, ['/**/**/**/**/*.{html,py}'], reload);
gulp.watch(src + 'css/**/*.scss', ['css', reload]);
gulp.watch(src + 'js/**/*.js', ['js', reload]);
});

// Start Virtualenv and start server
gulp.task('runserver', function() {
var proc;
proc = exec('PYTHONUNBUFFERED=1 ./manage.py runserver');
proc.stderr.on('data', function(data) {
return process.stdout.write(data);
});
});
2 changes: 1 addition & 1 deletion seeker/seeker/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
]

STATICFILES_DIRS = [
"seeker/static/",
"seeker/static_src/",
]

STATICFILES_LOCATION = 'static'
Expand Down
3 changes: 0 additions & 3 deletions seeker/seeker/static/css/style.css

This file was deleted.

File renamed without changes.
11 changes: 11 additions & 0 deletions seeker/seeker/static_src/css/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@import 'bootstrap.min';

body {
padding-top: 5rem;
}


div {
padding: 4px;
margin: 10px;
}
File renamed without changes.
File renamed without changes.
13 changes: 5 additions & 8 deletions seeker/seeker/templates/base.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<!DOCTYPE html> {% load i18n staticfiles %}
<!DOCTYPE html>
{% load i18n staticfiles %}
<html lang="en">

<head>
<meta charset="utf-8">
<title>{% block title %}{{ request.site.name }}{% endblock %}</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">
<link rel="stylesheet" href="{% static 'css/style.css' %}">
<link rel="shortcut icon" href="{% static 'img/favicon.ico' %}">
<link rel="stylesheet" href="{% static 'dist/css/style.css' %}">
</head>

<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<div class="container">
<a class="navbar-brand" href="/"><img width="30" height="30" src="data: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DQxLjQyMi0zMy44OTJjMC4wMDIsMCwwLjAwNSwwLDAuMDA3LDBjMjAuMDMsMCwzNy40NDcsMTQuMjUsNDEuNDEzLDMzLjg4Nmw0Ljc1OCwyMy41NTggIGMyLjMxNCwxMS40NjMsMTIuMDkzLDE5Ljc1NiwyMy43OCwyMC4xNjdsOTQuMTY3LDMuMzE2YzEwLjI5NCwwLjM2NywxOS40OTYtNS45MDksMjIuOTMtMTUuNjA3bDIwLjY2OS01OC4zNzIgIGMyLjM1Ny02LjY1NiwxLjc4NS0xMy43MjgtMS42MS0xOS45MTZjLTMuMzU1LTYuMTE0LTkuMTgxLTEwLjUyMi0xNS45ODYtMTIuMDkyYy0zOC4wMzMtOC43NzctOTQuMDEyLTE2LjQ2OS0xNDQuNzE5LTMuMjQ1ICBjLTE1LjEzMSwzLjk0NS0zMC40MDgsNS45NDYtNDUuNDA5LDUuOTQ2Yy0xNSwwLTMwLjI3OS0yLjAwMS00NS40MS01Ljk0NkMxOTUuOTcyLDE4NC4yNTUsMTc1LjkzMiwxODAuOTY5LDE1MC4zMTEsMTgwLjk2OXoiLz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==" /> Seeker</a>
Seeker</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
Expand Down Expand Up @@ -48,13 +48,10 @@
<footer class="py-5 bg-dark">
<div class="container">
<p class="m-0 text-center text-white">Seeker &copy; 2018</p>
<div class="text-center text-white">Icons made by <a href="http://www.freepik.com" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></div>
</div>
<!-- /.container -->
</footer>
<script src="{% static 'js/jquery.min.js' %}"></script>
<script src="{% static 'js/bootstrap.bundle.min.js' %}"></script>
<script src="{% static 'js/main.js' %}"></script>
<script src="{% static 'dist/js/main.min.js' %}"></script>
</body>

</html>
Loading

0 comments on commit 6f20c0d

Please sign in to comment.