Skip to content

Commit c4a2952

Browse files
committed
init
0 parents  commit c4a2952

File tree

25,885 files changed

+3661646
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

25,885 files changed

+3661646
-0
lines changed

.bowerrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"directory": "assets/bower_components/"}

.editorconfig

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true

.gitignore

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.idea/*
2+
config/local.js
3+
.tmp
4+
dump.rdb
5+
lib-cov
6+
*.seed
7+
*.log
8+
*.out
9+
*.pid
10+
npm-debug.log
11+
*~
12+
*#
13+
.DS_STORE
14+
.netbeans
15+
nbproject
16+
.idea
17+
.node_history

.jscsrc

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"excludeFiles": ["node_modules/**", "bower_components/**"],
3+
"requireCurlyBraces": [
4+
"if",
5+
"else",
6+
"for",
7+
"while",
8+
"do",
9+
"try",
10+
"catch"
11+
],
12+
"requireOperatorBeforeLineBreak": true,
13+
"requireCamelCaseOrUpperCaseIdentifiers": {"ignoreProperties": true},
14+
"maximumLineLength": {
15+
"value": 9999,
16+
"allowComments": true,
17+
"allowRegex": true
18+
},
19+
"validateQuoteMarks": { "mark": "'", "escape": true },
20+
"disallowMultipleLineStrings": true,
21+
"disallowMixedSpacesAndTabs": true,
22+
"disallowTrailingWhitespace": true,
23+
"disallowSpaceAfterPrefixUnaryOperators": true,
24+
"disallowMultipleVarDecl": null,
25+
"requireSpaceAfterKeywords": [
26+
"if",
27+
"else",
28+
"for",
29+
"while",
30+
"do",
31+
"switch",
32+
"return",
33+
"try",
34+
"catch"
35+
],
36+
"requireSpaceBeforeBinaryOperators": [
37+
"=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=",
38+
"&=", "|=", "^=", "+=",
39+
40+
"+", "-", "*", "/", "%", "<<", ">>", ">>>", "&",
41+
"|", "^", "&&", "||", "===", "==", ">=",
42+
"<=", "<", ">", "!=", "!=="
43+
],
44+
"requireSpaceAfterBinaryOperators": true,
45+
"requireSpacesInConditionalExpression": true,
46+
"requireSpaceBeforeBlockStatements": true,
47+
"disallowSpacesInsideObjectBrackets": "all",
48+
"disallowSpacesInsideArrayBrackets": "all",
49+
"disallowSpacesInsideParentheses": true,
50+
"disallowMultipleLineBreaks": true,
51+
"disallowCommaBeforeLineBreak": null,
52+
"disallowDanglingUnderscores": null,
53+
"disallowEmptyBlocks": null,
54+
"disallowTrailingComma": true,
55+
"requireCapitalizedConstructors": null,
56+
"requireCommaBeforeLineBreak": true,
57+
"requireDotNotation": true,
58+
"requireParenthesesAroundIIFE": true,
59+
"validateIndentation": 2,
60+
"disallowAnonymousFunctions": null,
61+
"requireMultipleVarDecl": null
62+
}

.jshintrc

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"bitwise": true,
3+
"jasmine": true,
4+
"curly": true,
5+
"eqeqeq": true,
6+
"es3": false,
7+
"forin": true,
8+
"freeze": true,
9+
"immed": true,
10+
"indent": 2,
11+
"latedef": "nofunc",
12+
"newcap": true,
13+
"noarg": true,
14+
"noempty": true,
15+
"nonbsp": true,
16+
"nonew": true,
17+
"plusplus": false,
18+
"quotmark": "single",
19+
"undef": true,
20+
"unused": true,
21+
"strict": false,
22+
"maxparams": 100,
23+
"maxdepth": 5,
24+
"maxstatements": 100,
25+
"maxcomplexity": 8,
26+
"maxlen": 9999,
27+
28+
"asi": false,
29+
"boss": false,
30+
"debug": false,
31+
"eqnull": true,
32+
"esnext": false,
33+
"evil": false,
34+
"expr": false,
35+
"funcscope": false,
36+
"globalstrict": false,
37+
"iterator": false,
38+
"lastsemic": false,
39+
"laxbreak": false,
40+
"laxcomma": false,
41+
"loopfunc": true,
42+
"maxerr": false,
43+
"moz": false,
44+
"multistr": false,
45+
"notypeof": false,
46+
"proto": false,
47+
"scripturl": false,
48+
"shadow": false,
49+
"sub": true,
50+
"supernew": false,
51+
"validthis": false,
52+
"noyield": false,
53+
54+
"browser": true,
55+
"node": true,
56+
57+
"globals": {
58+
"angular": false,
59+
"$": false,
60+
"jasmine": false,
61+
"describe": false,
62+
"xdescribe": false,
63+
"before": false,
64+
"beforeEach": false,
65+
"after": false,
66+
"afterEach": false,
67+
"it": false,
68+
"xit": false,
69+
"it": false,
70+
"toastr": false,
71+
"inject": false,
72+
"expect": false,
73+
"spyOn": false,
74+
"sails": true,
75+
"_": true,
76+
"JsonFileService": true,
77+
"LocaleService": true,
78+
"FSService": true
79+
}
80+
}

.sailsrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"generators": {
3+
"modules": {}
4+
}
5+
}

Gruntfile.js

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/**
2+
* Gruntfile
3+
*
4+
* This Node script is executed when you run `grunt` or `sails lift`.
5+
* It's purpose is to load the Grunt tasks in your project's `tasks`
6+
* folder, and allow you to add and remove tasks as you see fit.
7+
* For more information on how this works, check out the `README.md`
8+
* file that was generated in your `tasks` folder.
9+
*
10+
* WARNING:
11+
* Unless you know what you're doing, you shouldn't change this file.
12+
* Check out the `tasks` directory instead.
13+
*/
14+
15+
module.exports = function(grunt) {
16+
17+
// Load the include-all library in order to require all of our grunt
18+
// configurations and task registrations dynamically.
19+
var includeAll;
20+
try {
21+
includeAll = require('include-all');
22+
} catch (e0) {
23+
try {
24+
includeAll = require('sails/node_modules/include-all');
25+
}
26+
catch (e1) {
27+
console.error('Could not find `include-all` module.');
28+
console.error('Skipping grunt tasks...');
29+
console.error('To fix this, please run:');
30+
console.error('npm install include-all --save`');
31+
console.error();
32+
33+
grunt.registerTask('default', []);
34+
return;
35+
}
36+
}
37+
38+
/**
39+
* Loads Grunt configuration modules from the specified
40+
* relative path. These modules should export a function
41+
* that, when run, should either load/configure or register
42+
* a Grunt task.
43+
*/
44+
function loadTasks(relPath) {
45+
return includeAll({
46+
dirname: require('path').resolve(__dirname, relPath),
47+
filter: /(.+)\.js$/
48+
}) || {};
49+
}
50+
51+
/**
52+
* Invokes the function from a Grunt configuration module with
53+
* a single argument - the `grunt` object.
54+
*/
55+
function invokeConfigFn(tasks) {
56+
for (var taskName in tasks) {
57+
if (tasks.hasOwnProperty(taskName)) {
58+
tasks[taskName](grunt);
59+
}
60+
}
61+
}
62+
63+
// Load task functions
64+
var taskConfigurations = loadTasks('./tasks/config'),
65+
registerDefinitions = loadTasks('./tasks/register');
66+
67+
// (ensure that a default task exists)
68+
if (!registerDefinitions.default) {
69+
registerDefinitions.default = function (grunt) { grunt.registerTask('default', []); };
70+
}
71+
72+
// Run task functions to configure Grunt.
73+
invokeConfigFn(taskConfigurations);
74+
invokeConfigFn(registerDefinitions);
75+
76+
};

README.md

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Hub/Gdrive refactor
2+
3+
a [Sails](http://sailsjs.org) application
4+
5+
For more details, see the README.md in each root folder.
6+
7+
## Get started
8+
9+
Install homebrew. http://brew.sh/
10+
```
11+
brew update
12+
brew install mongodb
13+
```
14+
Create a file called local.js in /config
15+
16+
There is a sample one at /config/local.example
17+
18+
```
19+
npm i -g sails
20+
npm i
21+
bower install
22+
mongod
23+
sails lift
24+
25+
Check terminal to see where your app is running.
26+
```
27+
28+
## What it does
29+
30+
- Modern web standards (done)
31+
- Development mode and prod mode not just prod files (done)
32+
- File generators (done)
33+
- Local database and production database support (done)
34+
- Self contained project (done)
35+
- Bower used for front end dependencies (done)
36+
- AngularJs for the front end (done)
37+
- SailsJs for the back end (done)
38+
- No reliance on any of the Library-sdk code (done)
39+
- No reliance on any other projects that we built (done)
40+
- Grunt and not Make (done)
41+
- Mongo database (done)
42+
- Passport is used to manage oauth (done)
43+
- Its hosted on private github and not behind a vpn model (done)
44+
- JSCS and JShint (done)
45+
- Easier workflow (done)
46+
- Grunt ng-annotate (done)
47+
- Less (done)
48+
- File names in camelCase (done)
49+
- Variables in camelCase (done)
50+
- Clean up the HTML and css (done but could be better)
51+
- grunt check my code (done)
52+
- Unit and integration tests (done)
53+
- Watch task to auto build on changes (done)
54+
- Populate Index.html automatically (done)
55+
56+
## Tasks
57+
58+
- Refresh token
59+
- Use Icon font
60+
- Full test to make sure its the exact same.
61+
- Fully documented (done)
62+
63+
## Full list of what techs we use?
64+
65+
- Mongo, SailsJs, Anguar, Ui-Router, Grunt, Underscore.js
66+
- Passport oauth setup = https://www.youtube.com/watch?v=WXNsNchK74M
67+
- Have a look in the package.json and bower.json file for more.
68+
69+
## Load times comparison
70+
71+
## Lines of code comparison
72+
73+
## Onboarding of a new person comparison
74+
75+
## todo
76+
77+
- Get the image font working.

api/README.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# /api
2+
3+
This is the Sailsjs backend
4+
5+
http://sailsjs.org/
6+
7+
Full docs here
8+
9+
https://github.com/balderdashy/sails-docs
10+
11+
This is a great way to get started
12+
13+
https://www.youtube.com/watch?v=EHIybLmoxfE&list=PLf8i4fc0zJByWVBmMk8uJ0UEhTIGMnmPQ
14+
15+
If you really want to dive deep, watch this first
16+
17+
https://www.youtube.com/watch?v=xlOolpwwGQg&list=PLf8i4fc0zJBzLhOe6FwHpGhBDgqwInJWZ

api/controllers/.gitkeep

Whitespace-only changes.

api/controllers/AuthController.js

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
var passport = require('passport');
2+
3+
/**
4+
* AuthController
5+
*
6+
* @description :: Server-side logic for managing Auths
7+
* @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers
8+
*/
9+
10+
module.exports = {
11+
google: passport.authenticate('google', {scope: [
12+
'https://www.googleapis.com/auth/userinfo.email',
13+
'https://www.googleapis.com/auth/userinfo.profile',
14+
'https://www.googleapis.com/auth/contacts.readonly',
15+
'https://www.googleapis.com/auth/drive',
16+
'https://www.googleapis.com/auth/drive.appdata',
17+
'https://www.googleapis.com/auth/drive.apps.readonly',
18+
'https://www.googleapis.com/auth/drive.file',
19+
'https://www.googleapis.com/auth/drive.metadata',
20+
'https://www.googleapis.com/auth/drive.metadata.readonly',
21+
'https://www.googleapis.com/auth/drive.photos.readonly',
22+
'https://www.googleapis.com/auth/drive.readonly',
23+
'https://www.googleapis.com/auth/drive.scripts'
24+
]
25+
}),
26+
error: function(req, res) {
27+
return res.json({message: 'OH NO!'});
28+
}
29+
};
30+

0 commit comments

Comments
 (0)