Skip to content

Commit

Permalink
Init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePFMind committed Jan 16, 2016
0 parents commit 1fb61a0
Show file tree
Hide file tree
Showing 25 changed files with 1,683 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "bower_components"
}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.DS_Store
bower_components
node_modules
npm-debug.log
css
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/basic-foundation.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/jsLibraryMappings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/libraries/basic_foundation_node_modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/watcherTasks.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

464 changes: 464 additions & 0 deletions .idea/workspace.xml

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## Version 1.0 (Jan 19, 2016)

Initial release.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Nodejs + Foundation template

This is a template to start your own Nodejs+Foundation project that uses Grunt and libsass!

## Requirements

You'll need to have the following items installed before continuing.

* [Node.js](http://nodejs.org): Use the installer provided on the NodeJS website.
* [Grunt](http://gruntjs.com/): Run `[sudo] npm install -g grunt-cli`
* [Bower](http://bower.io): Run `[sudo] npm install -g bower`

## Quickstart

```bash
git clone [email protected]:ThePFMind/nodejs-foundation-template.git
npm install && bower install
```

While you're working on your project, run:

`grunt`

And you're set!

## Directory Structure

* `scss/_settings.scss`: Foundation configuration settings go in here
* `scss/app.scss`: Application styles go here
58 changes: 58 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
'use strict';

const Hapi = require('hapi');
const Hoek = require('hoek');

const server = new Hapi.Server();

server.connection({host: 'localhost', port: 3000});

server.register([
require('inert')
], (err) => {
if (err) throw err;
server.route([
{
method: 'GET',
path: '/assets/{path*}',
handler: {
directory: {
path: 'public',
listing: false
}
}
},
{
method: 'GET',
path: '/',
handler: (response, reply) => {
reply.view('home');
}
}
])
});

server.register([
require('vision')
], (err) => {
Hoek.assert(!err, err);

server.views({
engines: {
hbs: require('handlebars')
},
relativeTo: __dirname,
path: './views',
layout: true,
layoutPath: './views/layouts'
//partialsPath: './views/partials'
})
});

server.start((err) => {
Hoek.assert(!err, err);
console.log('Server running at ', server.info.uri);
});

module.exports = server;

21 changes: 21 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "nodejs-foundation-template",
"version": "1.0.0",
"authors": [
"ThePFMind <[email protected]>"
],
"description": "Basic template for a new Nodejs + Foundation for Sites project.",
"license": "MIT",
"dependencies": {
"foundation-sites": "~6.1.0",
"motion-ui": "~1.1.0"
},
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"private": true
}
52 changes: 52 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var rimraf = require('rimraf');
var sequence = require('run-sequence');

// File paths to various assets are defined here.
var PATHS = {
sass: [
'bower_components/foundation-sites/scss',
'bower_components/motion-ui/src'
],
javascript: [
'bower_components/foundation-sites/dist/foundation.js',
'bower_components/jquery/dist/jquery.js',
'bower_components/what-input/what-input.js'
]
};

// Delete the "dist" folder
// This happens every time a build starts
gulp.task('clean', function (done) {
rimraf('public/js/libs', done);
});

// Compile Sass into CSS
gulp.task('sass', function () {
return gulp.src('public/scss/app.scss')
.pipe($.sass({
includePaths: PATHS.sass
}).on('error', $.sass.logError))

.pipe($.autoprefixer({
browsers: ['last 2 versions', 'ie >= 9']
}))

.pipe(gulp.dest('css'));
});

// Copy files to assets folder
gulp.task('copy', function () {
return gulp.src(PATHS.javascript)
.pipe(gulp.dest('public/js/libs'));
});

// Build the "public" folder by running all of the above tasks
gulp.task('build', function (done) {
sequence('clean', ['sass', 'copy'], done);
});

gulp.task('default', ['sass'], function () {
gulp.watch(['public/scss/**/*.scss'], ['sass']);
});
3 changes: 3 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ext": "js json hbs"
}
33 changes: 33 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "nodejs-foundation-template",
"version": "1.0.0",
"description": "Nodejs + foundation template",
"main": "app.js",
"dependencies": {
"gulp-autoprefixer": "^3.1.0",
"handlebars": "^4.0.5",
"hapi": "^12.1.0",
"hoek": "^3.0.4",
"inert": "^3.2.0",
"vision": "^4.0.1"
},
"devDependencies": {
"gulp": "^3.9.0",
"gulp-autoprefixer": "^3.1.0",
"gulp-load-plugins": "^1.1.0",
"gulp-sass": "^2.1.0",
"rimraf": "^2.4.3",
"run-sequence": "^1.1.0"
},
"scripts": {
"start": "nodemon",
"build": "gulp build"
},
"repository": {
"type": "git",
"url": "[email protected]:ThePFMind/nodejs-foundation-template.git"
},
"author": "ThePFMind <[email protected]>",
"license": "MIT",
"private": true
}
Loading

0 comments on commit 1fb61a0

Please sign in to comment.