Skip to content

Commit

Permalink
Merge pull request #25 from jonniespratley/feature/passport
Browse files Browse the repository at this point in the history
Feature/passport
  • Loading branch information
jonniespratley committed Dec 9, 2014
2 parents 7478d44 + 42082a5 commit 3ac2fa5
Show file tree
Hide file tree
Showing 65 changed files with 2,663 additions and 2,101 deletions.
Binary file removed .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ node_modules
.idea
.grunt
.sass-cache
.editorconfig
.project
app/bower_components
coverage/
Expand All @@ -18,3 +17,4 @@ coverage/
atlassian-ide-plugin.xml
docs
dist
.c9
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ before_script:
- 'grunt'
#- sleep 2
#- 'grunt serve'
after_script:
- cat coverage/**/lcov.info | codeclimate
deploy:
provider: heroku
api_key: '6ac65b88-dd6d-421f-9fc7-c9ae18f71cb4'
on:
all_branches: true
addons:
code_climate:
repo_token: 0c38fe0d4c6cc50053304b8cd4859d74624619e2707280ac9287be548e905404
105 changes: 63 additions & 42 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
/* jshint camelcase:false */
// Generated on 2013-12-06 using generator-angular 0.6.0-rc.2
var fs = require('fs');
'use strict';

// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'

/**
* @TODO - Externalize configuration for server and proxy, mongodb
*/
var config = JSON.parse(fs.readFileSync(__dirname + '/config/config.json'));
var cmsRoutes = require(__dirname + '/routes/cms-routes');
var serverEndpoint = 'http://localhost:8181';
var proxyConfig = {
proxy: {
forward: {
'/socket.io/*': serverEndpoint,
'/socket.io': serverEndpoint,
'/api': serverEndpoint
}
}
};

var LIVERELOAD_PORT = 35729;
var LIVERELOAD_PORT = 35728;
var SERVER_PORT = 9000;
//var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT});
var mountFolder = function (connect, dir) {
Expand All @@ -30,14 +35,10 @@ module.exports = function (grunt) {
//Connect proxy to route requests to localhost:8181/api
grunt.loadNpmTasks('grunt-connect-proxy');
require('json-proxy').initialize({});
// Load grunt tasks automatically
require('load-grunt-tasks')(grunt);

// Time how long tasks take. Can help when optimizing build times
require('time-grunt')(grunt);

// Define the configuration for all the tasks
grunt.initConfig({
var GruntConfig = {

// Project settings
yeoman: {
Expand All @@ -54,9 +55,10 @@ module.exports = function (grunt) {
tasks: ['newer:coffee:dist']
},
coffeeTest: {
files: ['test/{,**/}*.{coffee,litcoffee,coffee.md}'],
tasks: ['coffee:test', 'newer:coffee:test', 'karma']
files: ['test/spec/{,**/}*.{coffee,litcoffee,coffee.md}'],
tasks: ['coffee:test', 'newer:coffee:test', 'karma:unit']
},

compass: {
files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
tasks: ['compass:server', 'autoprefixer']
Expand All @@ -72,7 +74,11 @@ module.exports = function (grunt) {
options: {
livereload: '<%= connect.options.livereload %>'
},
files: ['<%= yeoman.app %>/{,**/}*.html', '.tmp/styles/{,*/}*.css', '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'],
files: [
'<%= yeoman.app %>/{,**/}*.html',
'.tmp/styles/{,*/}*.css',
'<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
],
tasks: ['ngtemplates']
}
},
Expand All @@ -84,19 +90,16 @@ module.exports = function (grunt) {
// Change this to '0.0.0.0' to access the server from outside.
hostname: '127.0.0.1',
livereload: 35729,
middleware: function (connect, options) {
return [require('json-proxy').initialize(proxyConfig),
mountFolder(connect, '.grunt'),
mountFolder(connect, '.tmp')
];
}
base: ['.tmp', '<%= yeoman.app %>']
},
livereload: {
options: {
open: true,
base: ['.tmp', '<%= yeoman.app %>'],
middleware: function (connect, options) {
return [require('json-proxy').initialize(proxyConfig),
return [
require('json-proxy').initialize(proxyConfig),
mountFolder(connect, '.grunt'),
mountFolder(connect, '.tmp'),
mountFolder(connect, 'app')
];
Expand All @@ -114,7 +117,8 @@ module.exports = function (grunt) {
livereload: false,
base: '<%= yeoman.dist %>',
middleware: function (connect, options) {
return [require('json-proxy').initialize(proxyConfig),
return [
require('json-proxy').initialize(proxyConfig),
mountFolder(connect, 'dist')
];
}
Expand Down Expand Up @@ -261,9 +265,11 @@ module.exports = function (grunt) {
rev: {
dist: {
files: {
src: ['<%= yeoman.dist %>/scripts/{,*/}*.js', '<%= yeoman.dist %>/styles/{,*/}*.css',
src: [
'<%= yeoman.dist %>/scripts/{,*/}*.js', '<%= yeoman.dist %>/styles/{,*/}*.css',
//'<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
'<%= yeoman.dist %>/styles/fonts/*']
'<%= yeoman.dist %>/styles/fonts/*'
]
}
}
},
Expand Down Expand Up @@ -332,7 +338,7 @@ module.exports = function (grunt) {
removeRedundantAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true
*/
*/

},
files: [
Expand Down Expand Up @@ -398,11 +404,13 @@ module.exports = function (grunt) {
dot: true,
cwd: '<%= yeoman.app %>',
dest: '<%= yeoman.dist %>',
src: ['*.{ico,png,txt}', '.htaccess',
src: [
'*.{ico,png,txt}', '.htaccess',
//'bower_components/**/*',
'scripts/libs/*',
'images/{,*/}*.{webp}',
'fonts/*']
'fonts/*'
]
},
{
expand: true,
Expand All @@ -422,17 +430,22 @@ module.exports = function (grunt) {

// Run some tasks in parallel to speed up the build process
concurrent: {
server: ['coffee:dist',
server: [
'coffee:dist',
// 'compass:server',
'ngtemplates', 'copy:styles'],
test: ['coffee',
'ngtemplates', 'copy:styles'
],
test: [
'coffee',
// 'compass',
'copy:styles'],
'copy:styles'
],
dist: [
'coffee',
// 'compass:dist',
'ngtemplates',
'copy:styles', 'svgmin', 'htmlmin']
'copy:styles', 'svgmin', 'htmlmin'
]
},

// By default, your `index.html`'s <!-- Usemin block --> will take care of
Expand Down Expand Up @@ -549,20 +562,19 @@ module.exports = function (grunt) {
}
},

//Protractor webdriver & protractor
protractor_webdriver: {
options: {
// Task-specific options go here.
},
test: {
// Target-specific file lists and/or options go here.
options: {
command: 'webdriver-manager start'
}
}
},
protractor: {
options: {
keepAlive: true, // If false, the grunt process stops when the test fails.
noColor: false, // If true, protractor will not use colors in its output.
args: {
}
args: {}
},
test: {
options: {
Expand All @@ -571,6 +583,8 @@ module.exports = function (grunt) {
}
}
},

//Coveralls code coverage
coveralls: {
options: {
debug: true,
Expand All @@ -590,11 +604,14 @@ module.exports = function (grunt) {
clearRequireCache: false // Optionally clear the require cache before running tests (defaults to false)
},
src: [
'.tmp/routes/*-spec.js'
'test/routes/*-spec.js'
]
}
}
});
};

// Define the configuration for all the tasks
grunt.initConfig(GruntConfig);

grunt.registerTask('serve', function (target) {
if (target === 'dist') {
Expand All @@ -612,16 +629,20 @@ module.exports = function (grunt) {
grunt.registerTask('test', function (target) {
grunt.task.run(['clean:server', 'concurrent:test', 'autoprefixer', 'connect:test']);
if (target === 'e2e') {
return grunt.task.run(['karma']);
return grunt.task.run(['karma', 'protractor_webdriver', 'protractor', 'coveralls']);
} else if (target === 'server') {
return grunt.task.run(['coffee:test', 'mochaTest']);
} else {
return grunt.task.run(['karma:unit', 'coveralls']);
}
});
grunt.registerTask('test:server', 'coffee:test', 'mochaTest');
grunt.registerTask('test:protractor', 'coffee:test', 'protractor')

grunt.registerTask('build-docs', [ 'useminPrepare', 'autoprefixer', 'concat', 'ngmin']);
grunt.registerTask('build', ['clean:dist', 'useminPrepare', 'concurrent:dist', 'autoprefixer', 'concat', 'ngmin', 'copy:dist', /*'cdnify',*/ 'cssmin', 'uglify', 'rev', 'usemin']);
grunt.registerTask('ptor', ['coffee:test', 'protractor_webdriver', 'protractor']);
grunt.registerTask('build-docs', ['useminPrepare', 'autoprefixer', 'concat', 'ngmin']);
grunt.registerTask('build', [
'clean:dist', 'useminPrepare', 'concurrent:dist', 'autoprefixer', 'concat', 'ngmin', 'copy:dist', /*'cdnify',*/
'cssmin', 'uglify', 'rev', 'usemin'
]);

grunt.registerTask('docs', ['coffee', 'ngdocs', 'connect:docs', 'watch:ngdocs']);
grunt.registerTask('default', ['newer:jshint', 'test', 'build']);
Expand Down
39 changes: 24 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ This is a boilerplate CMS built with Angular, Twitter Bootstrap and Node; it is

[![Coverage Status](https://coveralls.io/repos/jonniespratley/angular-cms/badge.png)](https://coveralls.io/r/jonniespratley/angular-cms)


[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)

[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/jonniespratley/angular-cms/trend.png)](https://bitdeli.com/free)

[![Dependency Status](https://david-dm.org/jonniespratley/angular-cms.svg)](https://david-dm.org/jonniespratley/angular-cms)

[![Code Climate](https://codeclimate.com/github/jonniespratley/angular-cms/badges/gpa.svg)](https://codeclimate.com/github/jonniespratley/angular-cms)

[![Test Coverage](https://codeclimate.com/github/jonniespratley/angular-cms/badges/coverage.svg)](https://codeclimate.com/github/jonniespratley/angular-cms)

### Technologies

Expand Down Expand Up @@ -73,13 +77,13 @@ To run the application on your local machine please take the following steps.

To start mongodb execute the following command:

<<<<<<< HEAD
\<\<\<\<\<\<< HEAD

```
$ sh ./bin/db.sh
```
=======
$ sh ./bin/db.sh
>>>>>>> fe4af0e14ef3596c823d4777d672ba00406ddb90

======= $ sh ./bin/db.sh >>>>>>> fe4af0e14ef3596c823d4777d672ba00406ddb90

> **Note:** If errors when executing command remove the `db/mongod.lock` file.
Expand Down Expand Up @@ -138,13 +142,17 @@ $ grunt protractor
---

<<<<<<< HEAD
\<\<\<\<\<\<< HEAD

RESTful Server
--------------

=======
## RESTful Server
The server is a Node.js server that supports dynamic RESTful API calls to resource endpoints. It will automatically create a database if it does not exist and collection(s).
>>>>>>> fe4af0e14ef3596c823d4777d672ba00406ddb90

RESTful Server
--------------

The server is a Node.js server that supports dynamic RESTful API calls to resource endpoints. It will automatically create a database if it does not exist and collection(s). >>>>>>> fe4af0e14ef3596c823d4777d672ba00406ddb90

The server is a Node.js server that supports dynamic RESTful API calls to resource endpoints. It will automatically create a database if it does not exist and collection(s).

Expand Down Expand Up @@ -206,22 +214,23 @@ my-theme/
content.html
```



---

## Plugins
Plugins
-------

Plugins will be installed via `bower`, search and install themes searching by tag `angular-cms`.

### Structure of plugin


---

## API Documentation
API Documentation
-----------------

The API documentation will be in the form of ngDocs style. The files located in the `content` directory are tutorial specs for the different features in this project. Documentation can be generated and viewed by running the following command:

```
\`\`\`

$ grunt docs\`\`\`

Expand Down
Loading

0 comments on commit 3ac2fa5

Please sign in to comment.