Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
youennPennarun committed Oct 5, 2015
1 parent 5550477 commit f3f5010
Show file tree
Hide file tree
Showing 109 changed files with 5,490 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ build/Release
# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
src/public/node_modules
bower_components
src/public/bower_components
# Server config
src/server/data/private/
src/public/dist
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM centos:centos6
# Enable EPEL for Node.js
RUN rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# Install Node.js and npm
RUN yum install -y npm
# Bundle app source
COPY . /src

# Install app dependencies
RUN cd /src; npm install

EXPOSE 3000
CMD ["node", "/src/src/server/app.js"]
41 changes: 41 additions & 0 deletions gulp/clientTasks/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
var dest = './src/public/dist';
var src = './src/public/src';
var gutil = require('gulp-util');

module.exports = {
server: {
settings: {
root: dest,
host: 'localhost',
port: 8080,
livereload: {
port: 35929
}
}
},
sass: {
src: src + '/styles/**/*.{sass,scss,css}',
dest: dest + '/styles',
settings: {
indentedSyntax: false, // Enable .sass syntax?
imagePath: '/images' // Used by the image-url helper
}
},
browserify: {
settings: {
transform: ['babelify', 'reactify']
},
src: src + '/js/index.jsx',
dest: dest + '/js',
outputName: 'index.js',
debug: gutil.env.type === 'dev'
},
html: {
src: src + 'index.html',
dest: dest
},
watch: {
src: src + '**/*.*',
tasks: ['build']
}
};
26 changes: 26 additions & 0 deletions gulp/clientTasks/tasks/browserify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
var gulp = require('gulp');
var gutil = require('gulp-util');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var connect = require('gulp-connect');
var config = require('../config').browserify;

watchify.args.debug = config.debug;
var bundler = watchify(browserify(config.src, watchify.args));
config.settings.transform.forEach(function(t) {
bundler.transform(t);
});

gulp.task('browserify', bundle);
bundler.on('update', bundle);

function bundle() {
return bundler.bundle()
// log errors if they happen
.on('error', gutil.log.bind(gutil, 'Browserify Error'))
.pipe(source(config.outputName))
.pipe(gulp.dest(config.dest))
.pipe(connect.reload());
}
7 changes: 7 additions & 0 deletions gulp/clientTasks/tasks/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var gulp = require('gulp');
var connect = require('gulp-connect');
var config = require('../config').watch;

gulp.task('build', ['browserify', 'styles', 'html'], function() {
gulp.src(config.src).pipe(connect.reload());
});
2 changes: 2 additions & 0 deletions gulp/clientTasks/tasks/defaultClient.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
var gulp = require('gulp');
gulp.task('client', ['build', 'watch', 'server']);
7 changes: 7 additions & 0 deletions gulp/clientTasks/tasks/html.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var gulp = require('gulp');
var config = require('../config').html;

gulp.task('html', function() {
return gulp.src(config.src)
.pipe(gulp.dest(config.dest));
});
7 changes: 7 additions & 0 deletions gulp/clientTasks/tasks/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var gulp = require('gulp');
var connect = require('gulp-connect');
var config = require('../config').server;

gulp.task('server', function() {
connect.server(config.settings);
});
11 changes: 11 additions & 0 deletions gulp/clientTasks/tasks/styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var gulp = require('gulp');
var sass = require('gulp-sass');
var connect = require('gulp-connect');
var config = require('../config.js').sass;

gulp.task('styles', function() {
gulp.src(config.src)
.pipe(sass(config.settings))
.pipe(gulp.dest(config.dest))
.pipe(connect.reload());
});
6 changes: 6 additions & 0 deletions gulp/clientTasks/tasks/watch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
var gulp = require('gulp');
var config = require('../config').watch;

gulp.task('watch', ['build'], function() {
gulp.watch(config.src, config.tasks);
});
Empty file.
5 changes: 5 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
var requireDir = require("require-dir");


requireDir('./gulp/clientTasks', { recurse: true });
requireDir('./gulp/serverTasks', { recurse: true });
47 changes: 47 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "homyPi_webApp",
"version": "0.1.0",
"description": "",
"main": "app.js",
"dependencies": {
"babelify": "^6.3.0",
"bcrypt-nodejs": "0.0.3",
"bluebird": "~2.9.34",
"body-parser": "^1.13.3",
"express": "~4.13.3",
"express-bearer-token": "^2.1.0",
"express-winston": "^0.4.1",
"gulp-sass": "^2.0.4",
"gulp-util": "^3.0.6",
"jwt-simple": "^0.3.1",
"lodash": "^3.10.1",
"mongoose": "^4.1.7",
"q": "^1.4.1",
"qs": "^5.0.0",
"reactify": "^1.1.1",
"request-promise": "^0.4.3",
"require-dir": "^0.3.0",
"socket.io": "^1.3.6",
"socketio-jwt": "^4.3.1",
"spotify-web-api-node": "^2.1.0",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0",
"watchify": "^3.4.0",
"winston": "^1.0.1"
},
"devDependencies": {
"babel": "^5.8.23",
"gulp": "^3.9.0",
"gulp-babel": "^5.2.1",
"gulp-connect": "^2.2.0",
"gulp-develop-server": "^0.4.3",
"gulp-livereload": "^3.8.0",
"gulp-nodemon": "^2.0.4",
"gulp-watch": "^4.3.5"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Youenn PENNARUN",
"license": "BSD-2-Clause"
}
13 changes: 13 additions & 0 deletions src/public/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
Loading

0 comments on commit f3f5010

Please sign in to comment.