commit e0f91d6fd55b4371fc6cebe4f4e3875fcc09da9c Author: Felix Bytow Date: Sun May 8 22:08:14 2016 +0200 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3d32f7d --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +# sublime +*.sublime* + +# minified files +*.min.* + +# installed dependencies +node_modules/ +bower_components/ diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..0e6b317 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,35 @@ +'use strict'; + +module.exports = function(grunt) { + grunt.initConfig({ + 'pkg': grunt.file.readJSON('package.json'), + 'copy': { + 'main': { + 'files': [ + { + 'src': 'bower_components/angular/angular.min.js', + 'dest': 'assets/scripts/angular.min.js' + }, + ] + } + }, + 'uglify': { + 'main': { + 'files': { + } + } + }, + 'cssmin': { + 'main': { + 'files': { + } + } + } + }); + + grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-cssmin'); + + grunt.registerTask('default', ['copy', 'uglify', 'cssmin']); +}; diff --git a/README.md b/README.md new file mode 100644 index 0000000..0df19f6 --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +# Interfug16 + +This is the source of the website for the Interfug 2016 event. + +## Installation + +Just clone the repository and install the dependencies +``` +# you need grunt-cli installed on your system +npm install -g grunt-cli + +git clone https://github.com/ChaosChemnitz/interfug16 +cd IntraStart +npm install +bower install +``` + +## Usage + +``` +npm start +``` + +This will run grunt to minify js files and copy 3rd party js files to their +final location. After that the actual server is started. +You may want to set **NODE_ENV** to 'production' when the page is ready for use. + +## LICENSE + +Copyright © 2016, Chaostreff Chemnitz + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/assets/scripts/.empty b/assets/scripts/.empty new file mode 100644 index 0000000..e69de29 diff --git a/bin/server.js b/bin/server.js new file mode 100644 index 0000000..4ad2c14 --- /dev/null +++ b/bin/server.js @@ -0,0 +1,28 @@ +'use strict'; +/* global __dirname */ + +var path = require('path'); +var express = require('express'); +var app = express(); +var config = require('../config'); +var bodyParser = require('body-parser'); + +if (config.environment === 'development') { + app.locals.pretty = true; +} + +app.use(bodyParser.urlencoded({ 'extended': true })); +app.use(bodyParser.json()); +app.use(bodyParser.json({ 'type': 'application/vnd.api+json' })); + +app.use('/assets', express.static(path.join(__dirname, '../assets'))); + +app.set('view engine', 'pug'); +app.set('views', path.join(__dirname, '../views')); + +var routes = require('../routes'); +app.use('/', routes); + +app.listen(config.port, config.host, 5, function() { + console.log('Server listening on [' + config.host + ']:' + config.port + '...'); +}); \ No newline at end of file diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..6f609f9 --- /dev/null +++ b/bower.json @@ -0,0 +1,20 @@ +{ + "name": "interfug16", + "description": "Website for the Interfug 2016 event", + "main": "bin/server.js", + "authors": [ + "Felix Bytow " + ], + "license": "ISC", + "homepage": "https://github.com/ChaosChemnitz/interfug16#readme", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ], + "dependencies": { + "angular": "^1.5.5" + } +} diff --git a/config/development.json b/config/development.json new file mode 100644 index 0000000..156f7af --- /dev/null +++ b/config/development.json @@ -0,0 +1,4 @@ +{ + "host": "localhost", + "port": 8080 +} diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..2bbcb2e --- /dev/null +++ b/config/index.js @@ -0,0 +1,11 @@ +'use strict'; +/* global __dirname */ + +var path = require('path'); +var process = require('process'); +var env = process.env.NODE_ENV || 'development'; + +var config = require(path.join(__dirname, env)); +config.environment = env; + +module.exports = config; diff --git a/config/production.json b/config/production.json new file mode 100644 index 0000000..3964bb3 --- /dev/null +++ b/config/production.json @@ -0,0 +1,4 @@ +{ + "host": "[::]", + "port": 80 +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..9b11756 --- /dev/null +++ b/package.json @@ -0,0 +1,31 @@ +{ + "name": "interfug16", + "version": "0.1.0", + "description": "Website for the Interfug 2016 event", + "main": "bin/server.js", + "scripts": { + "prestart": "grunt", + "start": "node bin/server.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ChaosChemnitz/interfug16.git" + }, + "author": "Felix Bytow ", + "license": "ISC", + "bugs": { + "url": "https://github.com/ChaosChemnitz/interfug16/issues" + }, + "homepage": "https://github.com/ChaosChemnitz/interfug16#readme", + "dependencies": { + "body-parser": "^1.15.1", + "express": "^4.13.4", + "pug": "^2.0.0-alpha6" + }, + "devDependencies": { + "grunt": "^1.0.1", + "grunt-contrib-copy": "^1.0.0", + "grunt-contrib-cssmin": "^1.0.1", + "grunt-contrib-uglify": "^1.0.1" + } +} diff --git a/routes/index.js b/routes/index.js new file mode 100644 index 0000000..219040a --- /dev/null +++ b/routes/index.js @@ -0,0 +1,12 @@ +'use strict'; + +var express = require('express'); +var router = express.Router(); + +router.get('/', function(req, res) { + res.render('index', { + title: 'Interfug16' + }); +}); + +module.exports = router; diff --git a/views/index.pug b/views/index.pug new file mode 100644 index 0000000..d387314 --- /dev/null +++ b/views/index.pug @@ -0,0 +1,8 @@ +doctype html +html + head + meta(charset='utf-8') + meta(http-equiv='content-type', content='text/html; charset=utf-8') + title= title + script(src='assets/scripts/angular.min.js') + body(ng-app='interfug')