Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hateoas #42

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
eb68b03
Creating HATEOAS structure.
Aug 23, 2015
ce0c0b9
Adding some more config.
Aug 24, 2015
256a61d
Added some basic e2e tests for OPTIONS requests.
Aug 31, 2015
70a2d3a
Created HATEOAS loader.
Aug 31, 2015
3dafd9d
Put in some basic content.
Aug 31, 2015
c8ff8b3
Converted a bunch of stuff to es6, added more testing.
Sep 2, 2015
d94f9eb
More es6 conversion.
Sep 3, 2015
9ec6161
Fixed unit tests.
Sep 3, 2015
ee90563
Did some copypasta on the endpoints, and created es6 prototype functi…
Sep 6, 2015
06c7312
Added more functionality to admin account management.
Sep 7, 2015
bb0a977
Filled-out the character api endpoints.
Sep 7, 2015
c688f27
Fleshed-out the auth resource.
Sep 7, 2015
20b53b9
Split unit and api tests. Getting hateoas working.
Sep 9, 2015
ae9da26
Added a cache manifest generator.
Sep 9, 2015
a71f25f
First step of splitting up hateoas configurator.
Sep 11, 2015
f3db93c
More work splitting up the hateoas stuff.
Sep 11, 2015
414c41f
Working on the manifest system.
Sep 13, 2015
2a4aa54
Some work on the manifest scanner. Needs more.
Sep 13, 2015
60ac2c6
Tweaks to scanner.
Sep 14, 2015
4b1a26a
Probably finisshed with the manifest.
Sep 15, 2015
07dccdf
Did some stuff with resolver factories.
Sep 15, 2015
04b27c2
Made scanner use resolver factories for unknown file extensions.
Sep 16, 2015
c7d70bb
Doing some work on the resolver factories.
Sep 16, 2015
3312872
Filling-out resolver factories for jade & scss
Sep 24, 2015
3cdc50d
Added es6 rendering resolvers.
Sep 26, 2015
52f0c20
Starting work on getting tests fixed.
Sep 30, 2015
882b41e
Fixing path scanning and request parsing.
Oct 5, 2015
23ca117
Added more unit tests around prototype extension.
Oct 5, 2015
33e5d39
Sorted out some bullshit logic errors.
Oct 18, 2015
166faa0
Fixing up a bunch of basic errors raised by the tests.
Oct 18, 2015
13e61a6
Adding test-api to testing execution.
Oct 18, 2015
358f781
A whole bunch of refactoring.
Jan 26, 2016
9c185d6
Moving character api under users.
Feb 1, 2016
8a47512
Refactoring more api methods to conform with established standard.
Feb 1, 2016
b4ffcee
Normalising more of the api.
Feb 1, 2016
db14ce7
Modernising some of the api.
Feb 1, 2016
1ddc1d9
Converted a couple more endpoints.
Feb 2, 2016
c80cbb8
Fixed some errors, and converted some more.
Feb 2, 2016
3f5c766
Moving client code out of static resources.
Feb 3, 2016
471e62f
Got the server running again.
Feb 4, 2016
1df45d0
Got api testing running.
Feb 4, 2016
74f6556
Converted some more endpoints I missed. Actually importing all the en…
Feb 10, 2016
e30b097
Fixed a bunch more reference errors.
Feb 10, 2016
dcb95c0
Adding some more functionality to the api-auth-status operation, and …
Feb 11, 2016
f23a1ba
Added some more session validation on data access.
Feb 11, 2016
9e9754a
Fixed-up tests and a few issues raised by them.
Feb 16, 2016
2cb64cb
Removed suit validation and tightened-up login operations.
Feb 17, 2016
85359cd
Stripped-out more suit references and fiddled with neo4j querying.
Feb 17, 2016
ff8b96d
Fixed all the authentication issues.
Feb 18, 2016
b96fbf3
Got one of the user list cases working.
Feb 18, 2016
f350e61
Streamlined test requests with defaults wrapper creation.
Feb 18, 2016
2531902
Added a couple more tests.
Feb 18, 2016
14efd4e
Updating travis config.
Feb 21, 2016
55f7972
Fixing a couple of dependency versions.
Feb 21, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,43 @@
language: node_js

node_js:
- "0.10"
- '5.6'

jdk:
- oraclejdk7 # Needed for neo4j

env:
global:
- NEO4J_VERSION="2.1.7"
- CXX=g++-4.8

addons:
apt:

sources:
- ubuntu-toolchain-r-test

packages:
- g++-4.8

before_install:
- wget dist.neo4j.org/neo4j-community-$NEO4J_VERSION-unix.tar.gz
- tar -xzf neo4j-community-$NEO4J_VERSION-unix.tar.gz
- echo org.neo4j.server.database.location=src/test/dump > neo4j-community-$NEO4J_VERSION/conf/neo4j-server.properties
- neo4j-community-$NEO4J_VERSION/bin/neo4j start
- npm install -g npm@latest

after_install:
- npm config set tag-version-prefix "" --global
- npm config set tag-version-prefix ""

before_script:
- gulp manifest
- npm version `git describe --tags` --no-git-tag
- cat package.json | grep version

script:
- gulp build
- gulp test
- gulp docs

after_success:
Expand Down
11 changes: 9 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
/* globals require, module */
'use strict';

/* globals require, module */
var traceur = require('traceur');

require('traceur-source-maps').install(traceur);
traceur.require.makeDefault(function (filePath) {
return !~filePath.indexOf('node_modules');
});

var gulp = require('gulp');
var protractor = require('gulp-protractor');
Expand All @@ -13,7 +19,8 @@ gulp.task('libs', [ 'lib-copy' ]);
gulp.task('styles', [], require('./src/scripts/styles'));
gulp.task('manifest', [ 'code', 'styles' ], require('./src/scripts/manifest'));
gulp.task('selenium-update', protractor['webdriver_update']);
gulp.task('test', [ 'test-unit', 'test-e2e' ]);
gulp.task('test', [ 'test-unit', 'test-api', 'test-e2e' ]);
gulp.task('test-unit', require('./src/scripts/test-unit'));
gulp.task('test-api', require('./src/scripts/test-api'));
gulp.task('test-e2e', [ 'selenium-update' ], require('./src/scripts/test-e2e'));
gulp.task('docs', require('./src/scripts/docs'));
15 changes: 8 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
/* globals require, process, JSON, console */

var traceur = require('traceur');

require('traceur-source-maps').install(traceur);
traceur.require.makeDefault(function (filePath) {
return !~filePath.indexOf('node_modules');
});

var config = require('./src/server/config');

console.log('process.env: ' + JSON.stringify(process.env, null));
console.log('config: ' + JSON.stringify(config, null));

// Load up all the rest endpoints.
require('./src/server/rest');

// start the server.
require('./src/server/express').listen(config.port, function() {
console.log('Starting application on port ' + config.port);

}).on('error', function(error) {
require('./src/server/server').start().catch(function(error) {
console.error(error.stack);

});
20 changes: 15 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,46 +31,56 @@
"angular-ui-router": "~0.2.13",
"angulartics": "^0.17.2",
"bootstrap-sass": "^3.3.1",
"chai": "^3.2.0",
"es6-module-loader": "^0.17.6",
"gulp": "^3.8.11",
"gulp-angular-protractor": "0.0.2",
"gulp-apidoc": "^0.1.4",
"gulp-cache-manifest": "0.0.1",
"gulp-clean": "^0.3.1",
"gulp-concat": "^2.5.2",
"gulp-less": "^3.0.5",
"gulp-minify-css": "^1.1.0",
"gulp-mocha": "^2.1.0",
"gulp-nodemon": "^1.0.4",
"gulp-protractor": "^1.0.0",
"gulp-rename": "^1.2.0",
"gulp-sass": "^1.2.4",
"gulp-sourcemaps": "^1.5.2",
"gulp-uglify": "^1.2.0",
"gulp-util": "^3.0.5",
"lunr": "^0.5.9",
"mocha-traceur": "^2.1.0",
"moment": "^2.9.0",
"ngstorage": "^0.3.4",
"phantomjs": "^1.9.17",
"protractor": "^2.1.0",
"request-promise": "^0.4.3",
"requirejs": "^2.1.18",
"requirejs-text": "^2.0.12",
"sinon": "^1.15.3",
"sockit-angular": "aetheric/sockit-angular",
"sockit-express": "aetheric/sockit-express",
"stream-reduce": "~1.0.3",
"through2": "^0.6.5",
"traceur": "0.0.91",
"vinyl-sourcemaps-apply": "^0.1.4"
},
"dependencies": {
"body-parser": "^1.13.2",
"cypher-query": "0.0.12",
"errorhandler": "^1.3.6",
"express": "^4.11.0",
"express-hateoas": "0.1.x",
"express-session": "^1.11.3",
"helmet": "^0.9.1",
"jade": "^1.11.0",
"neo4j": "^2.0.0-RC1",
"promise": "^7.0.1",
"neo4j-simple": "^0.7.12",
"node-sass": "^3.3.3",
"session-file-store": "0.0.14",
"suit": "^0.4.0",
"underscore": "^1.8.3"
"traceur": "0.0.102",
"traceur-runner": "^2.0.1",
"traceur-source-maps": "^1.0.6",
"underscore": "^1.8.3",
"http-constants": "1.1.x"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
38 changes: 38 additions & 0 deletions src/client/docs/api_data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
define({ "api": [
{
"type": "get",
"url": "/api/auth",
"title": "Checks that the authentication for the current user is valid.",
"name": "GetUser",
"group": "Authentication",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "<p>String</p> ",
"optional": false,
"field": "email",
"description": "<p>The email of the user.</p> "
}
]
}
},
"success": {
"fields": {
"Success 200": [
{
"group": "Success 200",
"type": "<p>Object</p> ",
"optional": false,
"field": "user",
"description": "<p>The user record currently in the session.</p> "
}
]
}
},
"version": "0.0.0",
"filename": "src/server/api/auth/auth-check.js",
"groupTitle": "Authentication"
}
] });
38 changes: 38 additions & 0 deletions src/client/docs/api_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[
{
"type": "get",
"url": "/api/auth",
"title": "Checks that the authentication for the current user is valid.",
"name": "GetUser",
"group": "Authentication",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "<p>String</p> ",
"optional": false,
"field": "email",
"description": "<p>The email of the user.</p> "
}
]
}
},
"success": {
"fields": {
"Success 200": [
{
"group": "Success 200",
"type": "<p>Object</p> ",
"optional": false,
"field": "user",
"description": "<p>The user record currently in the session.</p> "
}
]
}
},
"version": "0.0.0",
"filename": "src/server/api/auth/auth-check.js",
"groupTitle": "Authentication"
}
]
13 changes: 13 additions & 0 deletions src/client/docs/api_project.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
define({
"name": "animus",
"version": "0.0.1",
"description": "A management utility for the NZ Crucible LARP.",
"sampleUrl": false,
"apidoc": "0.2.0",
"generator": {
"name": "apidoc",
"time": "2015-07-08T22:09:25.946Z",
"url": "http://apidocjs.com",
"version": "0.13.1"
}
});
13 changes: 13 additions & 0 deletions src/client/docs/api_project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "animus",
"version": "0.0.1",
"description": "A management utility for the NZ Crucible LARP.",
"sampleUrl": false,
"apidoc": "0.2.0",
"generator": {
"name": "apidoc",
"time": "2015-07-08T22:09:25.946Z",
"url": "http://apidocjs.com",
"version": "0.13.1"
}
}
Loading