forked from ladisays/kanohack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ladi Adenusi andela-ladenusi
committed
Jul 9, 2015
1 parent
2facf91
commit 8212ae9
Showing
20 changed files
with
396 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"directory": "./public/lib" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
web: gulp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module.exports = function(app, config) { | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = function (app, config) { | ||
app.route('/keep-alive').get(function (req, res) { | ||
res.send('I am alive'); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
doctype html | ||
html(lang="en" ng-app='Kanoevents') | ||
head | ||
title Kano Events | ||
include shared/head | ||
body | ||
.wrapper(ng-view) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// defining modules | ||
angular.module('kanoevents.controllers', []); | ||
angular.module('kanoevents.services', []); | ||
|
||
/* loading services */ | ||
require('./services/refs.js'); | ||
|
||
|
||
// loading controller | ||
require('./controllers/mainCtrl.js'); | ||
|
||
window.Kanoevents = angular.module('Kanoevents', [ | ||
'ngRoute', | ||
'ngCookies', | ||
'firebase', | ||
'kanoevents.controllers', | ||
'kanoevents.services' | ||
]); | ||
|
||
kanoevents.config(['$routeProvider','$locationProvider', | ||
function($routeProvider, $locationProvider) { | ||
$locationProvider.html5Mode(true); | ||
$routeProvider | ||
.when('/', { | ||
templateUrl: 'index.html', | ||
controller: 'mainCtrl' | ||
}); | ||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
angular.module('uberhack.controllers') | ||
.controller('mainCtrl', ['Authentication', '$scope', '$rootScope', '$location', | ||
function(Authentication, $scope, $rootScope, $location) { | ||
|
||
} | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
angular.module('kanoevents.services') | ||
.factory('Refs', ['$cookies', '$firebase', | ||
function($cookies, $firebase) { | ||
var rootRef = new Firebase($cookies.rootRef || 'https://kano-events.firebaseio.com'); | ||
|
||
// define every standard ref used application wide | ||
return { | ||
root: rootRef | ||
}; | ||
} | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
meta(name='HandheldFriendly' content='True') | ||
meta(name='MobileOptimized' content='320') | ||
meta(name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no') | ||
|
||
base(href="/") | ||
|
||
// CDN provided | ||
link(href='//fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css') | ||
|
||
//build:css /dist/style.css | ||
link(rel="stylesheet" href="/css/styles.css" type="text/css") | ||
// endbuild | ||
// CDN provided scripts | ||
script(type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js") | ||
script(type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js") | ||
script(type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-route.js") | ||
script(type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-cookies.js") | ||
script(type="text/javascript" src="https://cdn.firebase.com/js/client/2.2.7/firebase.js") | ||
script(type="text/javascript" src="https://cdn.firebase.com/libs/angularfire/1.1.2/angularfire.min.js") | ||
// endcdn | ||
script(type="text/javascript" src="/js/index.js") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
html, body, div, span, applet, object, iframe, | ||
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | ||
a, abbr, acronym, address, big, cite, code, | ||
del, dfn, em, img, ins, kbd, q, s, samp, | ||
small, strike, strong, sub, sup, tt, var, | ||
b, u, i, center, | ||
dl, dt, dd, ol, ul, li, | ||
fieldset, form, label, legend, | ||
table, caption, tbody, tfoot, thead, tr, th, td, | ||
article, aside, canvas, details, embed, | ||
figure, figcaption, footer, header, hgroup, | ||
menu, nav, output, ruby, section, summary, | ||
time, mark, audio, video | ||
margin 0 | ||
padding 0 | ||
border 0 | ||
font-size 100% | ||
font inherit | ||
vertical-align baseline | ||
|
||
article, aside, details, figcaption, figure, | ||
footer, header, hgroup, menu, nav, section | ||
display block | ||
|
||
body | ||
line-height 1 | ||
|
||
ol, ul | ||
list-style none | ||
|
||
blockquote, q | ||
quotes none | ||
|
||
blockquote:before, blockquote:after, | ||
q:before, q:after | ||
content '' | ||
content none | ||
|
||
table | ||
border-collapse collapse | ||
border-spacing 0 | ||
|
||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
var development = { | ||
firebase: { | ||
rootRefUrl: 'https://kano-events.firebaseio.com/', | ||
secretKey: 'T7GOegMcPPxfYDYhWugSrd0JRbDykscjIlMSKVnC' | ||
} | ||
}; | ||
|
||
var test = { | ||
firebase: { | ||
rootRefUrl: 'https://kano-events.firebaseio.com/', | ||
secretKey: 'T7GOegMcPPxfYDYhWugSrd0JRbDykscjIlMSKVnC' | ||
} | ||
}; | ||
|
||
var production = { | ||
firebase: { | ||
rootRefUrl: 'https://kano-events.firebaseio.com/', | ||
secretKey: 'T7GOegMcPPxfYDYhWugSrd0JRbDykscjIlMSKVnC' | ||
} | ||
}; | ||
|
||
var staging = { | ||
firebase: { | ||
rootRefUrl: 'https://kano-events.firebaseio.com/', | ||
secretKey: 'T7GOegMcPPxfYDYhWugSrd0JRbDykscjIlMSKVnC' | ||
} | ||
}; | ||
|
||
var config = { | ||
development: development, | ||
test: test, | ||
production: production, | ||
staging: staging | ||
}; | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
var browserify = require('browserify'), | ||
bower = require('gulp-bower'), | ||
concat = require('gulp-concat'), | ||
gulp = require('gulp'), | ||
gutil = require('gulp-util'), | ||
jade = require('gulp-jade'), | ||
stylus = require('gulp-stylus'), | ||
nodemon = require('gulp-nodemon'), | ||
path = require('path'), | ||
source = require('vinyl-source-stream'); | ||
|
||
var paths = { | ||
public: 'public/**', | ||
jade: 'app/**/*.jade', | ||
styles: 'app/styles/styles.styl', | ||
scripts: 'app/**/*.js', | ||
staticFiles: [ | ||
'!app/**/*.+(styl|css|js|jade)', | ||
'app/**/*.*' | ||
], | ||
clientTests: [], | ||
serverTests: ['test/server/**/*.js'] | ||
}; | ||
|
||
gulp.task('jade', function() { | ||
gulp.src(paths.jade) | ||
.pipe(jade()) | ||
.pipe(gulp.dest('./public/')); | ||
}); | ||
|
||
gulp.task('styles', function () { | ||
gulp | ||
.src(paths.styles) | ||
.pipe(stylus({ | ||
paths: [ path.join(__dirname, 'styles') ] | ||
})) | ||
.pipe(gulp.dest('./public/css')); | ||
}); | ||
|
||
gulp.task('static-files',function(){ | ||
return gulp.src(paths.staticFiles) | ||
.pipe(gulp.dest('public/')); | ||
}); | ||
|
||
gulp.task('nodemon', function () { | ||
nodemon({ script: 'index.js', ext: 'js', ignore: ['public/**','app/**','node_modules/**'] }) | ||
.on('restart', function () { | ||
console.log('>> node restart'); | ||
}); | ||
}); | ||
|
||
gulp.task('scripts', function() { | ||
gulp.src(paths.scripts) | ||
.pipe(concat('index.js')) | ||
.pipe(gulp.dest('./public/js')); | ||
}); | ||
|
||
gulp.task('browserify', function() { | ||
var b = browserify(); | ||
b.add('./app/js/application.js'); | ||
return b.bundle() | ||
.on('success', gutil.log.bind(gutil, 'Browserify Rebundled')) | ||
.on('error', gutil.log.bind(gutil, 'Browserify Error: in browserify gulp task')) | ||
.pipe(source('index.js')) | ||
.pipe(gulp.dest('./public/js')); | ||
}); | ||
|
||
gulp.task('watch', function() { | ||
gulp.watch(paths.jade, ['jade']); | ||
gulp.watch(paths.styles, ['styles']); | ||
gulp.watch(paths.scripts, ['browserify']); | ||
}); | ||
|
||
gulp.task('bower', function() { | ||
// return bower() | ||
// .pipe(gulp.dest('public/lib/')); | ||
}); | ||
|
||
gulp.task('build', ['bower', 'jade', 'styles', 'browserify', 'static-files']); | ||
gulp.task('production', ['nodemon', 'build']); | ||
gulp.task('default', ['nodemon', 'build', 'watch']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
global._ = require('lodash'); | ||
global.t = require('moment'); | ||
|
||
var cookieParser = require('cookie-parser'), | ||
Firebase = require("firebase"), | ||
env = process.env.NODE_ENV || 'development', | ||
config = require('./config/config')[env], | ||
routes = require('./api/routes'), | ||
express = require('express'), | ||
bodyParser = require('body-parser'), | ||
app = express(); | ||
|
||
(function run(appdir, rootRefUrl) { | ||
app.use(cookieParser()); | ||
|
||
app.dir = appdir; | ||
|
||
// things to do on each request | ||
app.use(function (req, res, next) { | ||
// log each request in development environment | ||
if(env !== 'production') console.log(t().format('HH:MM'), req.method, req.url, req.socket.bytesRead); | ||
// tell the client what firebase to use | ||
res.cookie('rootRef', rootRefUrl); | ||
|
||
next(); | ||
}); | ||
|
||
// static files | ||
app.use(express.static(app.dir + '/public')); | ||
|
||
// Standard error handling | ||
app.use(function(err, req, res, next){ | ||
console.error(err.stack); | ||
res.status(500).send('Something broke!'); | ||
}); | ||
|
||
// to support JSON-encoded bodies | ||
app.use(bodyParser.json()); | ||
|
||
// to support URL-encoded bodies | ||
app.use(bodyParser.urlencoded({ | ||
extended: true | ||
})); | ||
|
||
routes(app, config); | ||
|
||
var server = app.listen(process.env.PORT || 8888, function() { | ||
console.log('Listening on port %d', server.address().port); | ||
}); | ||
|
||
})(process.cwd(), config.firebase.rootRefUrl); | ||
|
||
module.exports = app; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"name": "Kanoevents", | ||
"version": "0.0.1", | ||
"description": "An app that allows one to create an event and returns live commentary", | ||
"main": "index.js", | ||
"engines": { | ||
"node": "0.10.31", | ||
"npm": "1.4.23" | ||
}, | ||
"scripts": { | ||
"start": "node index.js" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "" | ||
}, | ||
"author": "Ladi Adenusi", | ||
"license": "Proprietary", | ||
"homepage": "http://kano-events.herokuapp.com", | ||
"dependencies": { | ||
"body-parser": "^1.9.0", | ||
"browserify": "^5.12.0", | ||
"connect-livereload": "^0.4.0", | ||
"cookie-parser": "^1.3.3", | ||
"express": "^4.9.5", | ||
"firebase": "2.2.0", | ||
"gulp": "^3.8.7", | ||
"gulp-bower": "0.0.7", | ||
"gulp-concat": "^2.4.1", | ||
"gulp-exit": "^0.0.2", | ||
"gulp-jade": "^0.7.0", | ||
"gulp-nodemon": "^1.0.4", | ||
"gulp-stylus": "^2.0.1", | ||
"gulp-util": "^3.0.1", | ||
"jade": "^1.6.0", | ||
"lodash": "^2.4.1", | ||
"moment": "^2.8.2", | ||
"vinyl-source-stream": "^1.1.0" | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!DOCTYPE html><html lang="en" ng-app="Kanoevents"><head><title>Kano Events</title><meta name="HandheldFriendly" content="True"><meta name="MobileOptimized" content="320"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><base href="/"><!-- CDN provided--><link href="//fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css"><!--build:css /dist/style.css--><link rel="stylesheet" href="/css/styles.css" type="text/css"><!-- endbuild--><!-- CDN provided scripts--><script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script><script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script><script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-route.js"></script><script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-cookies.js"></script><script type="text/javascript" src="https://cdn.firebase.com/js/client/2.2.7/firebase.js"></script><script type="text/javascript" src="https://cdn.firebase.com/libs/angularfire/1.1.2/angularfire.min.js"></script><!-- endcdn--><script type="text/javascript" src="/js/index.js"></script></head><body><div ng-view class="wrapper"></div></body></html> |
Oops, something went wrong.