Skip to content
This repository was archived by the owner on Jan 5, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
db5eeb4
move files to new repo
mbuchthal Oct 13, 2015
56c16b6
Merge pull request #1 from mbuchthal/movefiles
mbuchthal Oct 13, 2015
bf8f8f7
add extra gulp, working api request
mbuchthal Oct 14, 2015
615de5d
Merge pull request #3 from mbuchthal/gitapi
bentongreen Oct 14, 2015
e08e676
add html to gulp watch, add blogs_list view
mbuchthal Oct 14, 2015
80e8e3d
Merge pull request #4 from mbuchthal/addblogs
bentongreen Oct 14, 2015
07c235d
add pagination effect
mbuchthal Oct 14, 2015
34a6255
Merge pull request #5 from mbuchthal/addblogs
bentongreen Oct 14, 2015
d88d80f
blog_details added
bentongreen Oct 14, 2015
28c2d7f
Merge pull request #8 from mbuchthal/details-final
mbuchthal Oct 14, 2015
780b314
add style to page button, blog list page
mbuchthal Oct 14, 2015
0626b8e
added search bar to blog list semi functional
bentongreen Oct 14, 2015
9861bb4
Merge branch 'master' of https://github.com/mbuchthal/mean-stack-2 in…
bentongreen Oct 14, 2015
237b95f
add json form to details view, working route to details view
mbuchthal Oct 15, 2015
77282ad
merge conflict
mbuchthal Oct 15, 2015
70df8c0
Merge pull request #9 from mbuchthal/blogroute
bentongreen Oct 15, 2015
c5562e6
end of branch work
bentongreen Oct 15, 2015
794bc12
merge fix
bentongreen Oct 15, 2015
e1d2b95
update create form and functionality to gist creation
mbuchthal Oct 15, 2015
18a5ddc
Search bar functionality completed
bentongreen Oct 15, 2015
8b80a29
search bar minimalist styling finished
bentongreen Oct 15, 2015
a21d478
begin adding delete function
mbuchthal Oct 15, 2015
e3d87b9
Merge pull request #10 from mbuchthal/search-bar
mbuchthal Oct 15, 2015
5a7e127
Merge pull request #11 from mbuchthal/creategist
bentongreen Oct 15, 2015
d15c9e7
update functionality work
bentongreen Oct 15, 2015
f88c002
delete working in blog view
mbuchthal Oct 16, 2015
822a17c
remove delete button from list view
mbuchthal Oct 16, 2015
6a23eba
merge conflict
mbuchthal Oct 16, 2015
cb29cfd
Merge pull request #12 from mbuchthal/update-part-1
mbuchthal Oct 16, 2015
46c11a7
merge conflict
mbuchthal Oct 16, 2015
e7dcf9e
Merge pull request #13 from mbuchthal/creategist
bentongreen Oct 16, 2015
01e28e9
refactor create method, delete working
mbuchthal Oct 16, 2015
7424813
Merge pull request #14 from mbuchthal/creategist
bentongreen Oct 16, 2015
7f93f8c
refactor to update method
mbuchthal Oct 16, 2015
0b11cc8
add update functionality
mbuchthal Oct 16, 2015
98e4c85
Merge pull request #15 from mbuchthal/creategist
bentongreen Oct 16, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ pids
*.pid
*.seed

### OSX ###
.DS_Store
.AppleDouble
.LSOverride

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

Expand All @@ -26,3 +31,5 @@ build/Release
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
build
public

41 changes: 20 additions & 21 deletions gulp/config.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
var dest = "./build";
var dest = './public';
var src = './src';

module.exports = {
javascript: {
src: src + '/js/**/*.js',
src: src + '/app/**/*.js',
dest: dest + '/js/',
entry: src + '/js/app.js',
outputFilename: 'app.js'
},
assets: {
src: src + "/assets/**/*",
dest: dest + '/assets/'
entryPoint: src + '/webpack-entry.js',
packedFile: 'packed.js'
},
sass: {
src: src + "/css/**/*.{sass,scss}",
src: src + "/sass/**/*.{sass,scss}",
dest: dest + '/css/',
settings: {
indentedSyntax: true, // Enable .sass syntax!
indentedSyntax: true,
}
},
html: {
src: src + '/**/*.html',
dest: dest
},
server: {
src: dest,
serverFile: '.server.js',
livereload: true,
directoryListing: false,
open: false,
port: 9000
},
index: {
src: src + '/app/index.html',
dest: dest + '/',
},
partials: {
src: [src + '/app/**/*.html', '!' + src + '/app/index.html'],
dest: dest + '/partials/'
},
production: {
cssSrc: dest + '/css/*.css',
jsSrc: dest + '/js/*.js',
cssDest: dest + '/css/',
jsDest: dest + '/js/',
jsSrc: dest + '/*.js',
dest: dest
},
ngConfig: {
dest: dest + '/js',
}
};
9 changes: 0 additions & 9 deletions gulp/tasks/assets.js

This file was deleted.

5 changes: 3 additions & 2 deletions gulp/tasks/default.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var gulp = require('gulp');

gulp.task('default', ['sass', 'markup', 'webpack', 'watch', 'serve']);
var gulp = require('gulp');

gulp.task('serve', ['sass', 'ngConfig', 'webpack', 'watch', 'server', 'index', 'partials']);
gulp.task('default', ['sass', 'ngConfig', 'webpack', 'watch', 'server', 'index', 'partials']);
7 changes: 7 additions & 0 deletions gulp/tasks/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var gulp = require("gulp");
var config = require("../config").index;

gulp.task("index", function() {
return gulp.src(config.src)
.pipe(gulp.dest(config.dest));
})
7 changes: 0 additions & 7 deletions gulp/tasks/javascript.js

This file was deleted.

8 changes: 0 additions & 8 deletions gulp/tasks/markup.js

This file was deleted.

11 changes: 0 additions & 11 deletions gulp/tasks/minifyCss.js

This file was deleted.

18 changes: 18 additions & 0 deletions gulp/tasks/ngConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
var gulp = require("gulp");
var ngConfig = require("gulp-ng-config");
var config = require("../config").ngConfig;
var fs = require("fs");

gulp.task("ngConfig", function() {
var tokenFile = config.dest + "/token.txt"; // !!! .txt?

// Create a temp file with the token stored in it
fs.writeFileSync(tokenFile, '{"token": "' + process.env.GITHUBTOKEN + '"}');
//fs.writeFileSync(tokenFile, '{"token": "' + "" + '"}');

// Generate the token config file
gulp.src(tokenFile)
.pipe(ngConfig("gisty.config"))
.pipe(gulp.dest(config.dest));

});
7 changes: 7 additions & 0 deletions gulp/tasks/partials.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var gulp = require("gulp");
var config = require("../config").partials;

gulp.task("partials", function() {
return gulp.src(config.src)
.pipe(gulp.dest(config.dest));
})
7 changes: 0 additions & 7 deletions gulp/tasks/production.js

This file was deleted.

19 changes: 9 additions & 10 deletions gulp/tasks/sass.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
var gulp = require('gulp');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var handleErrors = require('../util/handleErrors');
var autoprefixer = require('gulp-autoprefixer');
var config = require('../config').sass;

gulp.task('sass', function () {
var gulp = require("gulp");
var sass = require("gulp-sass");
var sourcemaps = require("gulp-sourcemaps");
var handleErrors = require("../util/handleErrors");
var config = require("../config").sass;

gulp.task("sass", function() {
return gulp.src(config.src)
.pipe(sourcemaps.init())
.pipe(sass(config.settings))
.on('error', handleErrors)
.on("error", handleErrors)
.pipe(sourcemaps.write())
.pipe(autoprefixer({ browsers: ['last 2 version'] }))
// .pipe(autoprefixer({ browsers: ["last 2 version"] }))
.pipe(gulp.dest(config.dest));
});

15 changes: 0 additions & 15 deletions gulp/tasks/serve.js

This file was deleted.

10 changes: 10 additions & 0 deletions gulp/tasks/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var gulp = require("gulp");
var config = require("../config").server;
var server = require("gulp-express");

gulp.task("server", function() {
server.run(["server.js"]);

// restart the server when it changes
gulp.watch(["server.js"], [server.run]);
});
11 changes: 0 additions & 11 deletions gulp/tasks/uglifyJs.js

This file was deleted.

14 changes: 7 additions & 7 deletions gulp/tasks/watch.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
var gulp = require('gulp');
var config = require('../config');

gulp.task('watch', function() {
gulp.watch(config.javascript.src, ['webpack']);
gulp.watch(config.sass.src, ['sass']);
gulp.watch(config.markup.src, ['markup']);
// Watchify will watch and recompile our JS, so no need to gulp.watch it
var gulp = require("gulp");
var config = require("../config");

gulp.task("watch", function() {
gulp.watch(config.javascript.src, ["webpack"]);
gulp.watch(config.sass.src, ["sass"]);
gulp.watch(config.partials.src, ["partials"]);
});
24 changes: 12 additions & 12 deletions gulp/tasks/webpack.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
var gulp = require('gulp');
var config = require('../config').javascript;
var webpack = require('webpack-stream');

gulp.task('webpack', function(callback) {
return gulp.src(config.entry)
.pipe(webpack({
output: {
filename: config.outputFilename
}
}))
.pipe(gulp.dest(config.dest));
});
var gulp = require("gulp");
var config = require("../config").javascript;
var webpack = require("webpack-stream");

gulp.task("webpack", function (callback) {
return gulp.src(config.entryPoint)
.pipe(webpack({
output: {
filename: "packed.js",
}
}))
.pipe(gulp.dest(config.dest));
});
5 changes: 3 additions & 2 deletions gulp/util/handleErrors.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

var notify = require("gulp-notify");

module.exports = function() {
Expand All @@ -11,5 +12,5 @@ module.exports = function() {
}).apply(this, args);

// Keep gulp from hanging on this task
this.emit('end');
};
this.emit("end");
};
15 changes: 0 additions & 15 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
/*
gulpfile.js
===========
Rather than manage one giant configuration file responsible
for creating multiple tasks, each task has been broken out into
its own file in gulp/tasks. Any files in that directory get
automatically required below.

To add a new task, simply add a new task file that directory.
gulp/tasks/default.js specifies the default set of tasks to run
when you run `gulp`.
*/

var requireDir = require('require-dir');

// Require all tasks in gulp/tasks, including subfolders
requireDir('./gulp/tasks', { recurse: true });

14 changes: 14 additions & 0 deletions models/blog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Load required packages
var mongoose = require("mongoose");

// Define our teams schema
var BlogSchema = new mongoose.Schema({
title: String,
content: String,
author: String,
date: { type: Date, default: Date.now },
comments: Number
});

// Export the Mongoose model
module.exports = mongoose.model("Blog", BlogSchema);
52 changes: 34 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,41 @@
{
"name": "",
"name": "mean-stack-2",
"version": "1.0.0",
"description": "",
"description": "Last week we focussed on JavaScript basics. This week we're going to build up a function web application. You'll be expected to build on knowledge you've already learned (semantic HTML, Sass instead of CSS, in addition to all of the Angular work we'll be doing) and produce a \"production-ready\" blog for your assignment this week.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/mbuchthal/mean-stack-2.git"
},
"author": "Mark Buchthal",
"license": "ISC",
"bugs": {
"url": "https://github.com/mbuchthal/mean-stack-2/issues"
},
"homepage": "https://github.com/mbuchthal/mean-stack-1#readme",
"dependencies": {
"gulp": "^3.8.11",
"gulp-autoprefixer": "^2.1.0",
"gulp-changed": "^1.1.1",
"gulp-filesize": "0.0.6",
"gulp-minify-css": "~0.5.1",
"angular": "^1.4.7",
"angular-cookies": "^1.4.7",
"angular-route": "^1.4.7",
"body-parser": "^1.14.1",
"connect-livereload": "^0.5.3",
"express": "^4.13.3",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^3.0.2",
"gulp-express": "^0.3.5",
"gulp-jshint": "^1.11.2",
"gulp-livereload": "^3.8.1",
"gulp-ng-config": "^1.2.1",
"gulp-notify": "^2.2.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "~1.3.3",
"gulp-sourcemaps": "^1.5.0",
"gulp-uglify": "^1.1.0",
"gulp-util": "^3.0.4",
"gulp-webserver": "^0.9.0",
"lodash": "^3.3.1",
"merge-stream": "^0.1.7",
"pretty-hrtime": "~1.0.0",
"require-dir": "^0.1.0",
"vinyl-source-stream": "~1.0.0",
"gulp-sass": "^2.0.4",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^1.4.1",
"mongoose": "^4.1.10",
"require-dir": "^0.3.0",
"webpack": "^1.12.2",
"webpack-stream": "^2.1.1"
}
}
Binary file added public/.DS_Store
Binary file not shown.
Binary file added public/css/fonts/icomoon.eot
Binary file not shown.
Loading