├── server.js ├── images └── bedrock.jpg ├── README.md ├── .gitignore ├── tasks ├── build.js ├── server │ ├── nodemon.js │ └── livereload.js ├── scripts │ ├── jsdocs.js │ ├── uglify.js │ ├── lint.js │ ├── vendor.js │ └── browserify.js ├── default.js └── styles │ └── compass.js ├── gulpfile.js ├── config.rb ├── nodemon.json ├── package.json ├── LICENSE └── .eslintrc /server.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/bedrock.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidchase/bedrock/master/images/bedrock.jpg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Bedrock 2 | ======= 3 | 4 | A foundation for building SOLID web projects 5 | 6 | ![bedrock](images/bedrock.jpg) 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### Node ### 2 | # Logs 3 | logs 4 | *.log 5 | 6 | node_modules 7 | 8 | *.DS_Store 9 | 10 | .sass-cache/ 11 | -------------------------------------------------------------------------------- /tasks/build.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | gulp.task('build', [ 3 | 'compass', 4 | 'vendor', 5 | 'browserify', 6 | 'uglify', 7 | 'lint', 8 | 'jsdocs' 9 | ]); -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var glob = require('glob'); 3 | var filepaths = glob.sync('./tasks/**/*.js'); 4 | 5 | // load gulp tasks from directory 6 | filepaths.forEach(function(filepath) { 7 | require(filepath); 8 | }); -------------------------------------------------------------------------------- /config.rb: -------------------------------------------------------------------------------- 1 | add_import_path "node_modules/foundation/scss" 2 | add_import_path "client/src/scss" 3 | 4 | preferred_syntax = :scss 5 | output_style = :compressed 6 | relative_assets = true 7 | line_comments = false 8 | http_path = "/" 9 | css_dir = "client/dist/css" 10 | sass_dir = "client/src/scss" -------------------------------------------------------------------------------- /tasks/server/nodemon.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'); 4 | var nodemon = require('gulp-nodemon'); 5 | 6 | gulp.task('nodemon', function () { 7 | nodemon({ 8 | script: 'server.js', 9 | ext: 'js', 10 | options: '--watch server --watch both --watch tasks' 11 | }); 12 | }); -------------------------------------------------------------------------------- /nodemon.json: -------------------------------------------------------------------------------- 1 | { 2 | "verbose": true, 3 | "ignore": [ 4 | ".gitignore", 5 | ".eslintrc", 6 | "README.md", 7 | ".git/*", 8 | ".idea/*", 9 | ".sass-cache/*", 10 | "node_modules/*", 11 | "client/*", 12 | "images/*", 13 | "public/*", 14 | "tmp/*" 15 | ] 16 | } -------------------------------------------------------------------------------- /tasks/scripts/jsdocs.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'); 4 | var jsdoc = require("gulp-jsdoc"); 5 | 6 | gulp.task('jsdocs', function () { 7 | return gulp.src('./client/src/**/*.js') 8 | .pipe(jsdoc('./client/dist/js/docs')) 9 | .on('error', function (err) { 10 | console.log(err); 11 | }); 12 | }); -------------------------------------------------------------------------------- /tasks/scripts/uglify.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'); 4 | var uglify = require('gulp-uglify'); 5 | 6 | gulp.task('uglify', function() { 7 | return gulp.src('./public/js/*.js') 8 | .pipe(uglify()) 9 | .on('error', function(err) { 10 | console.log(err); 11 | }) 12 | .pipe(gulp.dest('./public/js')); 13 | }); -------------------------------------------------------------------------------- /tasks/default.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'); 4 | 5 | gulp.task('default', [ 6 | 'compass', 7 | 'browserify', 8 | 'vendor', 9 | 'nodemon', 10 | 'livereload' 11 | ], function() { 12 | // execute watchers 13 | gulp.watch(['client/src/scss/**/*.scss'], ['compass']); 14 | gulp.watch(['client/src/**/*.js', 'both/**/*.hbs'], ['browserify']); 15 | }); -------------------------------------------------------------------------------- /tasks/scripts/lint.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var jshint = require('gulp-jshint'); 3 | var stylish = require('jshint-stylish'); 4 | var gulp = require('gulp'); 5 | 6 | gulp.task('lint', function() { 7 | return gulp.src([ 8 | 'gulpfile.js', 9 | 'tasks/**/*.js', 10 | 'src/scripts/**/*.js', 11 | 'test/**/*.js' 12 | ]) 13 | .pipe(jshint()) 14 | .pipe(jshint.reporter(stylish)); 15 | }); -------------------------------------------------------------------------------- /tasks/server/livereload.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'); 4 | var livereload = require('gulp-livereload'); 5 | 6 | gulp.task('livereload', function () { 7 | var server = livereload(); 8 | return gulp.watch(['both/**/*', 'client/**/*', 'server/**/*']) 9 | .on('change', function(file) { 10 | server.changed(file.path); 11 | }) 12 | .on('error', function (err) { 13 | console.log(err); 14 | }); 15 | }); -------------------------------------------------------------------------------- /tasks/styles/compass.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'); 4 | var compass = require('gulp-compass'); 5 | 6 | gulp.task('compass', function() { 7 | return gulp.src('./client/src/**/*.scss') 8 | .pipe(compass({ 9 | css: './client/dist/css', 10 | sass: './client/src/scss' 11 | })) 12 | .on('error', function(err) { 13 | console.log(err); 14 | }) 15 | .pipe(gulp.dest('./client/dist/css')); 16 | }); -------------------------------------------------------------------------------- /tasks/scripts/vendor.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'); 4 | var browserify = require('browserify'); 5 | var source = require('vinyl-source-stream'); 6 | var buffer = require('vinyl-buffer'); 7 | var uglify = require('gulp-uglify'); 8 | var libs = ['rest', 'rest/interceptor/mime', 'rest/interceptor/errorCode', 'hbsfy', 'hbsfy/runtime']; 9 | 10 | gulp.task('vendor', function() { 11 | // create external libraries 12 | var bundleStream = browserify(); 13 | bundleStream 14 | .require(libs) 15 | .bundle() 16 | .pipe(source('vendor-bundle.js')) 17 | .pipe(buffer()) 18 | .pipe(uglify()) 19 | .on('error', function(err) { 20 | console.log(err); 21 | }) 22 | .pipe(gulp.dest('./client/dist/js')); 23 | }); 24 | 25 | module.exports.libs = libs; -------------------------------------------------------------------------------- /tasks/scripts/browserify.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'); 4 | var browserify = require('browserify'); 5 | var source = require('vinyl-source-stream'); 6 | var buffer = require('vinyl-buffer'); 7 | var ugilfy = require('gulp-uglify'); 8 | var index = [ 9 | './client/src/' 10 | ]; 11 | var libs = require('./vendor').libs; 12 | var html = require('hbsfy'); 13 | var watchify = require('watchify'); 14 | 15 | gulp.task('browserify', function() { 16 | var bundleStream = browserify({ 17 | entries: index 18 | }); 19 | bundleStream 20 | .external(libs) 21 | .transform(html) 22 | .bundle() 23 | .pipe(source('app.js')) 24 | .pipe(buffer()) 25 | .pipe(ugilfy()) 26 | .pipe(gulp.dest('./client/dist/js')) 27 | .on('error', function(err) { 28 | console.log(err); 29 | }); 30 | }); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bedrock", 3 | "version": "0.0.1", 4 | "description": "A foundation for building SOLID web projects", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "tape" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/davidchase/bedrock.git" 12 | }, 13 | "keywords": [ 14 | "boilerplate", 15 | "solid", 16 | "foundation" 17 | ], 18 | "author": "David Annopolsky ", 19 | "license": "MIT", 20 | "bugs": { 21 | "url": "https://github.com/davidchase/bedrock/issues" 22 | }, 23 | "homepage": "https://github.com/davidchase/bedrock", 24 | "devDependencies": { 25 | "good": "^2.3.0", 26 | "gulp": "^3.8.8", 27 | "gulp-eslint": "^0.1.8", 28 | "gulp-jsdoc": "^0.1.4", 29 | "gulp-uglify": "^1.0.1", 30 | "hapi": "^6.8.1", 31 | "hbsfy": "^2.1.0", 32 | "vinyl-buffer": "^1.0.0", 33 | "vinyl-source-stream": "^1.0.0", 34 | "watchify": "^1.0.2" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 David Chase 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "node": true 5 | }, 6 | 7 | "rules": { 8 | "block-scoped-var": 2, 9 | "complexity": [1, 2], 10 | "consistent-return": 2, 11 | "curly": 2, 12 | "default-case": 2, 13 | "dot-notation": 2, 14 | "eqeqeq": 2, 15 | "guard-for-in": 2, 16 | "no-alert": 2, 17 | "no-caller": 2, 18 | "no-comma-dangle": 2, 19 | "no-div-regex": 2, 20 | "no-dupe-keys": 2, 21 | "no-else-return": 2, 22 | "no-empty-label": 2, 23 | "no-eq-null": 2, 24 | "no-eval": 2, 25 | "no-extend-native": 2, 26 | "no-extra-bind": 2, 27 | "no-extra-boolean-cast": 2, 28 | "no-fallthrough": 2, 29 | "no-floating-decimal": 2, 30 | "no-implied-eval": 2, 31 | "no-labels": 2, 32 | "no-iterator": 2, 33 | "no-lone-blocks": 2, 34 | "no-loop-func": 2, 35 | "no-multi-str": 2, 36 | "no-native-reassign": 2, 37 | "no-new": 2, 38 | "no-new-func": 2, 39 | "no-new-wrappers": 2, 40 | "no-octal": 2, 41 | "no-octal-escape": 2, 42 | "no-proto": 2, 43 | "no-redeclare": 2, 44 | "no-return-assign": 2, 45 | "no-script-url": 2, 46 | "no-self-compare": 2, 47 | "no-sequences": 2, 48 | "no-unused-expressions": 2, 49 | "no-unused-vars": 1, 50 | "no-unreachable": 2, 51 | "no-void": 2, 52 | "no-warning-comments": 2, 53 | "no-with": 2, 54 | "radix": 2, 55 | "vars-on-top": 2, 56 | "wrap-iife": [2, "inside"], 57 | "yoda": 2, 58 | "quotes": 0, 59 | "eol-last": 0, 60 | "no-extra-strict": 2, 61 | "camelcase": 2, 62 | "consistent-this": [2, "self"], 63 | "new-cap": 2, 64 | "new-parens": 2, 65 | "func-style": [2, "expression"], 66 | "no-lonely-if": 2, 67 | "no-new-object": 2, 68 | "no-space-before-semi": 2, 69 | "brace-style": [2, "1tbs"], 70 | "no-wrap-func": 2, 71 | "space-after-keywords": [2, "always"], 72 | "use-isnan": 2, 73 | "valid-jsdoc": [2, { 74 | "prefer": { 75 | "return": "returns" 76 | } 77 | }], 78 | "max-nested-callbacks": [2, 3], 79 | "semi": [2, "always"] 80 | } 81 | } --------------------------------------------------------------------------------