├── .gitignore
├── .travis.yml
├── Gruntfile.js
├── LICENSE
├── README.md
├── bower.json
├── client
├── errors
│ ├── 404.html
│ ├── 500.html
│ └── 502.html
├── favicon.ico
├── images
│ └── yeoman.png
├── index.html
├── lb-services.js
├── lbclient
│ ├── .gitignore
│ ├── boot
│ │ └── replication.js
│ ├── build.js
│ ├── code.js
│ ├── datasources.json
│ ├── datasources.local.js
│ ├── lbclient.js
│ ├── model-config.json
│ ├── models
│ │ └── local-user.json
│ └── package.json
├── robots.txt
├── scripts
│ ├── app.js
│ ├── controllers
│ │ ├── home.js
│ │ └── signin.js
│ └── services
│ │ └── services.js
├── styles
│ ├── main.scss
│ ├── mixins
│ │ └── _breakpoints.scss
│ ├── modules
│ │ ├── _buttons.scss
│ │ ├── _defaults.scss
│ │ ├── _figures.scss
│ │ ├── _forms.scss
│ │ ├── _lists.scss
│ │ ├── _misc.scss
│ │ ├── _normalize.scss
│ │ ├── _print.scss
│ │ ├── _quotes.scss
│ │ ├── _tables.scss
│ │ ├── _typography.scss
│ │ ├── _utils.scss
│ │ └── _vars.scss
│ └── partials
│ │ ├── _apps.scss
│ │ ├── _log-forms.scss
│ │ └── _main.scss
└── views
│ ├── about.html
│ ├── home.html
│ └── signin.html
├── common
└── models
│ ├── user.json
│ ├── userCredential.json
│ └── userIdentity.json
├── global-config.js
├── newrelic.js
├── nginx.conf
├── nginx_ssl.conf
├── package.json
└── server
├── boot
├── authentication.js
├── explorer.js
├── passport-init.js
├── rest-api.js
├── sockets.js
└── static.js
├── config.json
├── datasources.json
├── lib
└── utils.js
├── model-config.json
├── providers.json
└── server.js
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by http://gitignore.io
2 |
3 | ### Node ###
4 | lib-cov
5 | *.seed
6 | *.log
7 | *.csv
8 | *.dat
9 | *.out
10 | *.pid
11 | *.gz
12 |
13 | pids
14 | logs
15 | results
16 |
17 | npm-debug.log
18 | node_modules
19 | dist
20 | .tmp
21 |
22 | ### OSX ###
23 | .DS_Store
24 | .AppleDouble
25 | .LSOverride
26 | Icon
27 |
28 |
29 | # Thumbnails
30 | ._*
31 |
32 | # Files that might appear on external disk
33 | .Spotlight-V100
34 | .Trashes
35 |
36 | ### SublimeText ###
37 | # SublimeText project files
38 | *.sublime-workspace
39 |
40 | ### Linux ###
41 | .*
42 | !.gitignore
43 | !.git*
44 | !.travis.yml
45 | *~
46 |
47 |
48 | ### Compass ###
49 | .sass-cache
50 |
51 | ### SASS ###
52 | ### SASS Ignores - "Sassy CSS" http://sass-lang.com/
53 | *.sass-cache
54 |
55 | newrelic_agent.log
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - '0.10'
4 | before_install:
5 | - export DISPLAY=:99.0
6 | - sh -e /etc/init.d/xvfb start
7 | - gem install sass
8 | - gem install compass
9 | before_script:
10 | - npm install -g bower grunt-cli karma
11 | - bower install
12 | script: grunt
13 |
--------------------------------------------------------------------------------
/Gruntfile.js:
--------------------------------------------------------------------------------
1 | // Generated on 2014-07-04 using generator-angular 0.9.2
2 | 'use strict';
3 |
4 | // # Globbing
5 | // for performance reasons we're only matching one level down:
6 | // 'test/spec/{,*/}*.js'
7 | // use this if you want to recursively match all subfolders:
8 | // 'test/spec/**/*.js'
9 | var buildClientBundle = require('./client/lbclient/build');
10 |
11 | module.exports = function (grunt) {
12 |
13 | // Load grunt tasks automatically
14 | require('load-grunt-tasks')(grunt);
15 |
16 | // Time how long tasks take. Can help when optimizing build times
17 | require('time-grunt')(grunt);
18 |
19 | // Define the configuration for all the tasks
20 | grunt.initConfig({
21 |
22 | // Watches files for changes and runs tasks based on the changed files
23 | watch: {
24 | bower: {
25 | files: ['bower.json'],
26 | tasks: ['wiredep']
27 | },
28 | jsWebsite: {
29 | files: ['client/scripts/{,*/}*.js'],
30 | tasks: ['newer:jshint:website'],
31 | options: {
32 | livereload: {
33 | port: 35729,
34 | // key: grunt.file.read('server.key'),
35 | // cert: grunt.file.read('server.pem'),
36 | // ca: grunt.file.read('gd_bundle.crt')
37 | }
38 | }
39 | },
40 | jsTestWebsite: {
41 | files: ['client/test/spec/{,*/}*.js'],
42 | tasks: ['newer:jshint:website', 'karma:website']
43 | },
44 | compassWebsite: {
45 | files: ['client/styles/{,*/}*.{scss,sass}'],
46 | tasks: ['compass:website', 'autoprefixer:website']
47 | },
48 | lbclient: {
49 | files: [
50 | 'client/lbclient/models/*',
51 | 'client/lbclient/app*',
52 | 'client/lbclient/datasources*',
53 | 'client/lbclient/models*',
54 | 'client/lbclient/build.js'
55 | ],
56 | tasks: ['build-lbclient'],
57 | options: {
58 | livereload: {
59 | port: 35729,
60 | // key: grunt.file.read('server.key'),
61 | // cert: grunt.file.read('server.pem'),
62 | // ca: grunt.file.read('gd_bundle.crt')
63 | }
64 | }
65 | },
66 | gruntfile: {
67 | files: ['Gruntfile.js']
68 | },
69 | server: {
70 | files: ['server/{,*/}*.{js,json}', 'common/{,*/}*.{js,json}'],
71 | tasks: [
72 | 'loopback_sdk_angular',
73 | //'docular'
74 | ]
75 | },
76 | livereload: {
77 | options: {
78 | livereload: {
79 | port: 35729,
80 | // key: grunt.file.read('server.key'),
81 | // cert: grunt.file.read('server.pem'),
82 | // ca: grunt.file.read('gd_bundle.crt')
83 | }
84 | },
85 | files: [
86 | 'client/{,*/}*.html',
87 | 'client/.tmp/styles/{,*/}*.css',
88 | 'client/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
89 | 'client/lbclient/browser.bundle.js'
90 | ]
91 | }
92 | },
93 |
94 | // Make sure code styles are up to par and there are no obvious mistakes
95 | jshint: {
96 | options: {
97 | jshintrc: '.jshintrc',
98 | reporter: require('jshint-stylish')
99 | },
100 | website: {
101 | src: [
102 | 'Gruntfile.js',
103 | 'client/scripts/{,*/}*.js'
104 | ]
105 | },
106 | test: {
107 | options: {
108 | jshintrc: 'test/.jshintrc'
109 | },
110 | src: ['test/spec/{,*/}*.js']
111 | }
112 | },
113 |
114 | // Empties folders to start fresh
115 | clean: {
116 | dist: {
117 | files: [{
118 | dot: true,
119 | src: [
120 | '.tmp',
121 | 'client/.tmp',
122 | 'dist',
123 | 'client/lbclient/browser.bundle.js'
124 | ]
125 | }]
126 | },
127 | server: ['client/.tmp']
128 | },
129 |
130 | // Add vendor prefixed styles
131 | autoprefixer: {
132 | options: {
133 | browsers: ['last 1 version']
134 | },
135 | website: {
136 | files: [{
137 | expand: true,
138 | cwd: 'client/.tmp/styles/',
139 | src: '{,*/}*.css',
140 | dest: 'client/.tmp/styles/'
141 | }]
142 | }
143 | },
144 |
145 | // Automatically inject Bower components into the app
146 | wiredep: {
147 | options: {
148 | cwd: '.'
149 | },
150 | website: {
151 | src: ['client/index.html'],
152 | ignorePath: /\.\.\//,
153 | fileTypes: {
154 | html: {
155 | replace: {
156 | js: '',
157 | css: ''
158 | }
159 | }
160 | },
161 | exclude: [
162 | 'bower_components/es5-shim/es5-shim.js',
163 | 'bower_components/json3/lib/json3.js',
164 | 'bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/affix.js',
165 | 'bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/alert.js',
166 | 'bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/button.js',
167 | 'bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/carousel.js',
168 | 'bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/collapse.js',
169 | 'bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/tab.js',
170 | 'bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/transition.js',
171 | 'bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/scrollspy.js',
172 | 'bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/modal.js',
173 | 'bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/tooltip.js',
174 | 'bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/popover.js',
175 | 'bower_components/angular-route/angular-route.js',
176 | 'bower_components/angulartics/src/angulartics-adobe.js',
177 | 'bower_components/angulartics/src/angulartics-chartbeat.js',
178 | 'bower_components/angulartics/src/angulartics-flurry.js',
179 | 'bower_components/angulartics/src/angulartics-ga-cordova.js',
180 | 'bower_components/angulartics/src/angulartics-gtm.js',
181 | 'bower_components/angulartics/src/angulartics-kissmetrics.js',
182 | 'bower_components/angulartics/src/angulartics-mixpanel.js',
183 | 'bower_components/angulartics/src/angulartics-piwik.js',
184 | 'bower_components/angulartics/src/angulartics-scroll.js',
185 | 'bower_components/angulartics/src/angulartics-segmentio.js',
186 | 'bower_components/angulartics/src/angulartics-splunk.js',
187 | 'bower_components/angulartics/src/angulartics-woopra.js',
188 | 'bower_components/angulartics/src/angulartics-cnzz.js',
189 | 'bower_components/angulartics/src/angulartics-marketo.js',
190 | 'bower_components/angulartics/src/angulartics-intercom.js',
191 | 'bower_components/jquery-waypoints/waypoints.js',
192 | 'bower_components/blueimp',
193 | 'bower_components/jquery-file-upload/',
194 | 'bower_components/moment/',
195 | 'bower_components/cryptojslib/',
196 | 'bower_components/imagesloaded/',
197 | 'bower_components/eventEmitter/',
198 | 'bower_components/eventie/',
199 | 'bower_components/angular-carousel/',
200 | 'bower_components/angular-modal-service/'
201 | ],
202 | },
203 | sassWebsite: {
204 | src: ['client/styles/{,*/}*.{scss,sass}'],
205 | ignorePath: /(\.\.\/){1,2}bower_components\//
206 | }
207 | },
208 |
209 | // Compiles Sass to CSS and generates necessary files if requested
210 | compass: {
211 | website: {
212 | options: {
213 | sassDir: 'client/styles',
214 | cssDir: 'client/.tmp/styles',
215 | generatedImagesDir: 'client/.tmp/images/generated',
216 | imagesDir: 'client/images',
217 | javascriptsDir: 'client/scripts',
218 | fontsDir: 'client/fonts',
219 | importPath: 'bower_components',
220 | httpImagesPath: 'images',
221 | httpGeneratedImagesPath: 'client/images/generated',
222 | httpFontsPath: 'fonts',
223 | relativeAssets: false,
224 | assetCacheBuster: false,
225 | raw: 'Sass::Script::Number.precision = 10\n'
226 | }
227 | },
228 | dist: {
229 | options: {
230 | generatedImagesDir: 'client/website/images/generated'
231 | }
232 | },
233 | server: {
234 | options: {
235 | debugInfo: true
236 | }
237 | }
238 | },
239 |
240 | loopback_sdk_angular: {
241 | services: {
242 | options: {
243 | input: 'server/server.js',
244 | output: 'client/lb-services.js',
245 | apiUrl: '/api'
246 | }
247 | }
248 | },
249 | docular: {
250 | groups: [
251 | {
252 | groupTitle: 'LoopBack',
253 | groupId: 'loopback',
254 | sections: [
255 | {
256 | id: 'lbServices',
257 | title: 'LoopBack Services',
258 | scripts: [ 'client/lb-services.js' ]
259 | }
260 | ]
261 | }
262 | ]
263 | },
264 |
265 | // Renames files for browser caching purposes
266 | filerev: {
267 | website: {
268 | src: [
269 | 'dist/scripts/{,*/}*.js',
270 | 'dist/styles/{,*/}*.css',
271 | 'dist/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
272 | 'dist/styles/fonts/*'
273 | ]
274 | }
275 | },
276 |
277 | // Reads HTML for usemin blocks to enable smart builds that automatically
278 | // concat, minify and revision files. Creates configurations in memory so
279 | // additional tasks can operate on them
280 | useminPrepare: {
281 | website: {
282 | options: {
283 | dest: 'dist'
284 | },
285 | src: ['client/index.html'],
286 | }
287 | },
288 |
289 | // Performs rewrites based on filerev and the useminPrepare configuration
290 | usemin: {
291 | 'website-html': {
292 | options: {
293 | assetsDirs: ['dist','dist/images'],
294 | type:'html'
295 | },
296 | files: { src: ['dist/*.html'] }
297 | },
298 | 'website-css': {
299 | options: {
300 | assetsDirs: ['dist','dist/images'],
301 | type:'css'
302 | },
303 | files: { src: ['dist/styles/{,*/}*.css'] }
304 | }
305 | },
306 |
307 | imagemin: {
308 | dist: {
309 | files: [{
310 | expand: true,
311 | cwd: 'client/images',
312 | src: '{,*/}*.{png,jpg,jpeg,gif}',
313 | dest: 'dist/images'
314 | }]
315 | }
316 | },
317 |
318 | svgmin: {
319 | dist: {
320 | files: [{
321 | expand: true,
322 | cwd: 'client/images',
323 | src: '{,*/}*.svg',
324 | dest: 'dist/images'
325 | }]
326 | }
327 | },
328 |
329 | htmlmin: {
330 | dist: {
331 | options: {
332 | collapseWhitespace: true,
333 | conservativeCollapse: true,
334 | collapseBooleanAttributes: true,
335 | removeCommentsFromCDATA: true,
336 | removeOptionalTags: true
337 | },
338 | files: [{
339 | expand: true,
340 | cwd: 'dist',
341 | src: ['*.html', 'views/{,*/}*.html'],
342 | dest: 'dist'
343 | }]
344 | }
345 | },
346 |
347 | ngAnnotate: {
348 | options: {
349 | singleQuotes: true,
350 | },
351 | dist: {
352 | files: [{
353 | expand: true,
354 | cwd: '.tmp/concat/scripts',
355 | src: '*.js',
356 | dest: '.tmp/concat/scripts'
357 | }]
358 | }
359 | },
360 |
361 | i18nextract: {
362 | website: {
363 | src: [ 'client/scripts/**/*.js', 'client/*.html', 'client/views/{,*/}*.html' ],
364 | lang: ['en'],
365 | dest: 'client/locales'
366 | }
367 | },
368 |
369 | // Replace Google CDN references
370 | cdnify: {
371 | dist: {
372 | html: ['dist/*.html']
373 | }
374 | },
375 |
376 | // Copies remaining files to places other tasks can use
377 | copy: {
378 | dist: {
379 | files: [{
380 | expand: true,
381 | dot: true,
382 | cwd: 'client',
383 | dest: 'dist',
384 | src: [
385 | '*.{ico,png,txt}',
386 | '.htaccess',
387 | '*.html',
388 | 'views/{,*/}*.html',
389 | 'images/{,*/}*.{webp}',
390 | 'fonts/*'
391 | ]
392 | }, {
393 | expand: true,
394 | cwd: 'client/.tmp/images',
395 | dest: 'dist/images',
396 | src: ['generated/*']
397 | }, {
398 | expand: true,
399 | cwd: 'client/locales/',
400 | src: '**',
401 | dest: 'dist/locales/'
402 | }]
403 | },
404 | styles: {
405 | expand: true,
406 | cwd: 'client/styles',
407 | dest: 'client/.tmp/styles/',
408 | src: '{,*/}*.css'
409 | }
410 | },
411 |
412 | // Run some tasks in parallel to speed up the build process
413 | concurrent: {
414 | nodemon_dev: {
415 | options: {
416 | logConcurrentOutput: true,
417 | },
418 | tasks: [
419 | //'compass',
420 | 'nodemon:dev',
421 | 'watch'
422 | ]
423 | },
424 | nodemon_prod: {
425 | options: {
426 | logConcurrentOutput: true,
427 | },
428 | tasks: [
429 | 'nodemon:prod',
430 | 'watch'
431 | ]
432 | },
433 | server: [
434 | 'compass:server'
435 | ],
436 | dist: [
437 | 'compass',
438 | 'imagemin',
439 | 'svgmin'
440 | ],
441 | test: [
442 | 'compass'
443 | ]
444 | },
445 |
446 | nodemon: {
447 | dev: {
448 | script: 'server/server.js',
449 | options: {
450 | args: ['development'],
451 | watch: ['server', 'common'],
452 | ignore: ['node_modules/**'],
453 | debug: false,
454 | delayTime: 1,
455 | env: {
456 | NODE_ENV: 'development',
457 | PORT: 50447,
458 | PORT_SSL: 50337
459 | },
460 | cwd: __dirname
461 | }
462 | },
463 | prod: {
464 | script: 'server/server.js',
465 | options: {
466 | args: ['production'],
467 | watch: ['server', 'common'],
468 | ignore: ['node_modules/**'],
469 | debug: false,
470 | delayTime: 1,
471 | env: {
472 | NODE_ENV: 'production',
473 | PORT: 50447,
474 | PORT_SSL: 50337
475 | },
476 | cwd: __dirname
477 | }
478 | }
479 | },
480 |
481 | // Test settings
482 | karma: {
483 | website: {
484 | configFile: 'website/test/karma.conf.js',
485 | singleRun: true
486 | }
487 | }
488 | });
489 |
490 | grunt.registerTask('build-lbclient', 'Build lbclient browser bundle', function() {
491 | var done = this.async();
492 | buildClientBundle(process.env.NODE_ENV || 'development', done);
493 | });
494 |
495 | grunt.registerTask('buildClients', [
496 | 'i18nextract',
497 | 'clean:dist',
498 | 'wiredep',
499 | 'useminPrepare',
500 | 'concurrent:dist',
501 | 'autoprefixer',
502 | 'concat',
503 | 'ngAnnotate',
504 | 'copy:dist',
505 | 'cdnify',
506 | 'cssmin',
507 | 'uglify',
508 | 'filerev',
509 | 'usemin',
510 | 'htmlmin'
511 | ]);
512 |
513 | grunt.registerTask('dev', [
514 | //'loopback_sdk_angular',
515 | //'build-lbclient',
516 | 'wiredep',
517 | 'autoprefixer',
518 | 'concurrent:nodemon_dev'
519 | ]);
520 |
521 | grunt.registerTask('prod', [
522 | //'build-lbclient',
523 | //'docular',
524 | 'concurrent:nodemon_prod'
525 | ]);
526 |
527 | grunt.registerTask('test', [
528 | 'testWebsite'
529 | ]);
530 |
531 | grunt.registerTask('build', [
532 | //'build-lbclient',
533 | 'loopback_sdk_angular',
534 | 'buildClients'
535 | ]);
536 | };
537 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 João Ribeiro
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | bootstrap-loopback-fullstack
2 | ============================
3 |
4 | Project bootstrap for loopback backend project
5 |
6 |
7 | Installation
8 | ============
9 | - Download and extract
10 |
11 | - npm install
12 |
13 | - bower install
14 |
15 |
16 | Config
17 | ======
18 |
19 | - Set PROJECT-NAME in ./package.json and ./bower.js
20 |
21 | - Set PROJECT-NAME and LICENSE-KEY in ./newrelic.js
22 |
23 | - Set MONGODB-SERVER in ./server/datasources.json
24 |
25 | - Set API_URL in ./Gruntfile.js
26 |
27 | - Set api keys in ./server/providers.json
28 |
29 |
30 | Extras
31 | ======
32 |
33 | You can use ./nginx.conf as a starting point for nginx configuration.
34 | Edit all APP_ROOT_FOLDER, SEO4AJAX_API_KEY (some might be repeated, make sure you edit all of them)
35 | Copy ./nginx.conf to /etc/nginx/sites-available/
36 |
37 | Alternatively, if you want ssl configuration do the above steps with nging_ssl.conf and place your certificate files in:
38 |
39 | - /opt/nginx/ssl_certs/server.pem
40 | - /opt/nginx/ssl_certs/server.key
41 | - /opt/nginx/ssl_certs/dhparam.pem
42 | - /opt/nginx/ssl_certs/godaddy_ssl_trusted_certificate.pem
43 |
44 | (this configuration will grant you A+ grade security)
--------------------------------------------------------------------------------
/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "PROJECT-NAME",
3 | "version": "0.0.0",
4 | "dependencies": {
5 | "angular": "latest",
6 | "json3": "latest",
7 | "es5-shim": "latest",
8 | "jquery": "latest",
9 | "bootstrap-sass-official": "latest",
10 | "angular-resource": "latest",
11 | "angular-cookies": "latest",
12 | "angular-sanitize": "latest",
13 | "angular-animate": "latest",
14 | "angular-touch": "latest",
15 | "angular-translate": "latest",
16 | "angular-translate-loader-static-files": "latest",
17 | "angular-translate-storage-local": "latest",
18 | "angular-ui-router": "latest",
19 | "angulartics": "latest",
20 | "fontawesome": "latest",
21 | "socket.io-client": "latest",
22 | "visibilityjs": "latest"
23 | },
24 | "devDependencies": {
25 | "angular-mocks": "latest",
26 | "angular-scenario": "latest"
27 | },
28 | "appPath": "app"
29 | }
30 |
--------------------------------------------------------------------------------
/client/errors/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Page Not Found :(
6 |
141 |
142 |
143 |
144 |
Not found :(
145 |
Sorry, but the page you were trying to view does not exist.
146 |
It looks like this was the result of either:
147 |
148 | - a mistyped address
149 | - an out-of-date link
150 |
151 |
154 |
155 |
156 |
157 |
158 |
--------------------------------------------------------------------------------
/client/errors/500.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Page Not Found :(
6 |
141 |
142 |
143 |
144 |
Not found :(
145 |
Sorry, but the page you were trying to view does not exist.
146 |
It looks like this was the result of either:
147 |
148 | - a mistyped address
149 | - an out-of-date link
150 |
151 |
154 |
155 |
156 |
157 |
158 |
--------------------------------------------------------------------------------
/client/errors/502.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Page Not Found :(
6 |
141 |
142 |
143 |
144 |
Not found :(
145 |
Sorry, but the page you were trying to view does not exist.
146 |
It looks like this was the result of either:
147 |
148 | - a mistyped address
149 | - an out-of-date link
150 |
151 |
154 |
155 |
156 |
157 |
158 |
--------------------------------------------------------------------------------
/client/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JonnyBGod/bootstrap-loopback-fullstack/f1a8bf3ecececf6361e8e90295ea845ab7ffc1b0/client/favicon.ico
--------------------------------------------------------------------------------
/client/images/yeoman.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JonnyBGod/bootstrap-loopback-fullstack/f1a8bf3ecececf6361e8e90295ea845ab7ffc1b0/client/images/yeoman.png
--------------------------------------------------------------------------------
/client/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
23 |
24 |
25 |
26 |
27 |
28 |
38 |
39 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/client/lb-services.js:
--------------------------------------------------------------------------------
1 | (function(window, angular, undefined) {'use strict';
2 |
3 | var urlBase = "API_URL";
4 | var authHeader = 'authorization';
5 |
6 | /**
7 | * @ngdoc overview
8 | * @name lbServices
9 | * @module
10 | * @description
11 | *
12 | * The `lbServices` module provides services for interacting with
13 | * the models exposed by the LoopBack server via the REST API.
14 | *
15 | */
16 | var module = angular.module("lbServices", ['ngResource']);
17 |
18 | /**
19 | * @ngdoc object
20 | * @name lbServices.User
21 | * @header lbServices.User
22 | * @object
23 | *
24 | * @description
25 | *
26 | * A $resource object for interacting with the `User` model.
27 | *
28 | * ## Example
29 | *
30 | * See
31 | * {@link http://docs.angularjs.org/api/ngResource.$resource#example $resource}
32 | * for an example of using this object.
33 | *
34 | */
35 | module.factory(
36 | "User",
37 | ['LoopBackResource', 'LoopBackAuth', '$injector', function(Resource, LoopBackAuth, $injector) {
38 | var R = Resource(
39 | urlBase + "/users/:id",
40 | { 'id': '@id' },
41 | {
42 |
43 | /**
44 | * @ngdoc method
45 | * @name lbServices.User#login
46 | * @methodOf lbServices.User
47 | *
48 | * @description
49 | *
50 | * Login a user with username/email and password
51 | *
52 | * @param {Object=} parameters Request parameters.
53 | *
54 | * - `include` – `{string=}` - Related objects to include in the response. See the description of return value for more details.
55 | * Default value: `user`.
56 | *
57 | * - `rememberMe` - `boolean` - Whether the authentication credentials
58 | * should be remembered in localStorage across app/browser restarts.
59 | * Default: `true`.
60 | *
61 | * @param {Object} postData Request data.
62 | *
63 | * This method expects a subset of model properties as request parameters.
64 | *
65 | * @param {function(Object,Object)=} successCb
66 | * Success callback with two arguments: `value`, `responseHeaders`.
67 | *
68 | * @param {function(Object)=} errorCb Error callback with one argument:
69 | * `httpResponse`.
70 | *
71 | * @returns {Object} An empty reference that will be
72 | * populated with the actual data once the response is returned
73 | * from the server.
74 | *
75 | * The response body contains properties of the AccessToken created on login.
76 | * Depending on the value of `include` parameter, the body may contain additional properties:
77 | *
78 | * - `user` - `{User}` - Data of the currently logged in user. (`include=user`)
79 | *
80 | *
81 | */
82 | "login": {
83 | params: {
84 | include: "user"
85 | },
86 | interceptor: {
87 | response: function(response) {
88 | var accessToken = response.data;
89 | LoopBackAuth.setUser(accessToken.id, accessToken.userId, accessToken.user);
90 | LoopBackAuth.rememberMe = response.config.params.rememberMe !== false;
91 | LoopBackAuth.save();
92 | return response.resource;
93 | }
94 | },
95 | url: urlBase + "/users/login",
96 | method: "POST"
97 | },
98 |
99 | /**
100 | * @ngdoc method
101 | * @name lbServices.User#logout
102 | * @methodOf lbServices.User
103 | *
104 | * @description
105 | *
106 | * Logout a user with access token
107 | *
108 | * @param {Object=} parameters Request parameters.
109 | *
110 | * This method does not accept any parameters.
111 | * Supply an empty object or omit this argument altogether.
112 | *
113 | * @param {Object} postData Request data.
114 | *
115 | * - `access_token` – `{string}` - Do not supply this argument, it is automatically extracted from request headers.
116 | *
117 | * @param {function(Object,Object)=} successCb
118 | * Success callback with two arguments: `value`, `responseHeaders`.
119 | *
120 | * @param {function(Object)=} errorCb Error callback with one argument:
121 | * `httpResponse`.
122 | *
123 | * @returns {Object} An empty reference that will be
124 | * populated with the actual data once the response is returned
125 | * from the server.
126 | *
127 | * This method returns no data.
128 | */
129 | "logout": {
130 | interceptor: {
131 | response: function(response) {
132 | LoopBackAuth.clearUser();
133 | LoopBackAuth.clearStorage();
134 | return response.resource;
135 | }
136 | },
137 | url: urlBase + "/users/logout",
138 | method: "POST"
139 | },
140 |
141 | /**
142 | * @ngdoc method
143 | * @name lbServices.User#confirm
144 | * @methodOf lbServices.User
145 | *
146 | * @description
147 | *
148 | * Confirm a user registration with email verification token
149 | *
150 | * @param {Object=} parameters Request parameters.
151 | *
152 | * - `uid` – `{string}` -
153 | *
154 | * - `token` – `{string}` -
155 | *
156 | * - `redirect` – `{string}` -
157 | *
158 | * @param {function(Object,Object)=} successCb
159 | * Success callback with two arguments: `value`, `responseHeaders`.
160 | *
161 | * @param {function(Object)=} errorCb Error callback with one argument:
162 | * `httpResponse`.
163 | *
164 | * @returns {Object} An empty reference that will be
165 | * populated with the actual data once the response is returned
166 | * from the server.
167 | *
168 | * This method returns no data.
169 | */
170 | "confirm": {
171 | url: urlBase + "/users/confirm",
172 | method: "GET"
173 | },
174 |
175 | /**
176 | * @ngdoc method
177 | * @name lbServices.User#resetPassword
178 | * @methodOf lbServices.User
179 | *
180 | * @description
181 | *
182 | * Reset password for a user with email
183 | *
184 | * @param {Object=} parameters Request parameters.
185 | *
186 | * This method does not accept any parameters.
187 | * Supply an empty object or omit this argument altogether.
188 | *
189 | * @param {Object} postData Request data.
190 | *
191 | * This method expects a subset of model properties as request parameters.
192 | *
193 | * @param {function(Object,Object)=} successCb
194 | * Success callback with two arguments: `value`, `responseHeaders`.
195 | *
196 | * @param {function(Object)=} errorCb Error callback with one argument:
197 | * `httpResponse`.
198 | *
199 | * @returns {Object} An empty reference that will be
200 | * populated with the actual data once the response is returned
201 | * from the server.
202 | *
203 | * This method returns no data.
204 | */
205 | "resetPassword": {
206 | url: urlBase + "/users/reset",
207 | method: "POST"
208 | },
209 |
210 | /**
211 | * @ngdoc method
212 | * @name lbServices.User#prototype$__findById__identities
213 | * @methodOf lbServices.User
214 | *
215 | * @description
216 | *
217 | * Find a related item by id for identities
218 | *
219 | * @param {Object=} parameters Request parameters.
220 | *
221 | * - `id` – `{*}` - User id
222 | *
223 | * - `fk` – `{*}` - Foreign key for identities
224 | *
225 | * @param {function(Object,Object)=} successCb
226 | * Success callback with two arguments: `value`, `responseHeaders`.
227 | *
228 | * @param {function(Object)=} errorCb Error callback with one argument:
229 | * `httpResponse`.
230 | *
231 | * @returns {Object} An empty reference that will be
232 | * populated with the actual data once the response is returned
233 | * from the server.
234 | *
235 | *
236 | * (The remote method definition does not provide any description.
237 | * This usually means the response is a `User` object.)
238 | *
239 | */
240 | "prototype$__findById__identities": {
241 | url: urlBase + "/users/:id/identities/:fk",
242 | method: "GET"
243 | },
244 |
245 | /**
246 | * @ngdoc method
247 | * @name lbServices.User#prototype$__destroyById__identities
248 | * @methodOf lbServices.User
249 | *
250 | * @description
251 | *
252 | * Delete a related item by id for identities
253 | *
254 | * @param {Object=} parameters Request parameters.
255 | *
256 | * - `id` – `{*}` - User id
257 | *
258 | * - `fk` – `{*}` - Foreign key for identities
259 | *
260 | * @param {function(Object,Object)=} successCb
261 | * Success callback with two arguments: `value`, `responseHeaders`.
262 | *
263 | * @param {function(Object)=} errorCb Error callback with one argument:
264 | * `httpResponse`.
265 | *
266 | * @returns {Object} An empty reference that will be
267 | * populated with the actual data once the response is returned
268 | * from the server.
269 | *
270 | * This method returns no data.
271 | */
272 | "prototype$__destroyById__identities": {
273 | url: urlBase + "/users/:id/identities/:fk",
274 | method: "DELETE"
275 | },
276 |
277 | /**
278 | * @ngdoc method
279 | * @name lbServices.User#prototype$__updateById__identities
280 | * @methodOf lbServices.User
281 | *
282 | * @description
283 | *
284 | * Update a related item by id for identities
285 | *
286 | * @param {Object=} parameters Request parameters.
287 | *
288 | * - `id` – `{*}` - User id
289 | *
290 | * - `fk` – `{*}` - Foreign key for identities
291 | *
292 | * @param {Object} postData Request data.
293 | *
294 | * This method expects a subset of model properties as request parameters.
295 | *
296 | * @param {function(Object,Object)=} successCb
297 | * Success callback with two arguments: `value`, `responseHeaders`.
298 | *
299 | * @param {function(Object)=} errorCb Error callback with one argument:
300 | * `httpResponse`.
301 | *
302 | * @returns {Object} An empty reference that will be
303 | * populated with the actual data once the response is returned
304 | * from the server.
305 | *
306 | *
307 | * (The remote method definition does not provide any description.
308 | * This usually means the response is a `User` object.)
309 | *
310 | */
311 | "prototype$__updateById__identities": {
312 | url: urlBase + "/users/:id/identities/:fk",
313 | method: "PUT"
314 | },
315 |
316 | /**
317 | * @ngdoc method
318 | * @name lbServices.User#prototype$__findById__credentials
319 | * @methodOf lbServices.User
320 | *
321 | * @description
322 | *
323 | * Find a related item by id for credentials
324 | *
325 | * @param {Object=} parameters Request parameters.
326 | *
327 | * - `id` – `{*}` - User id
328 | *
329 | * - `fk` – `{*}` - Foreign key for credentials
330 | *
331 | * @param {function(Object,Object)=} successCb
332 | * Success callback with two arguments: `value`, `responseHeaders`.
333 | *
334 | * @param {function(Object)=} errorCb Error callback with one argument:
335 | * `httpResponse`.
336 | *
337 | * @returns {Object} An empty reference that will be
338 | * populated with the actual data once the response is returned
339 | * from the server.
340 | *
341 | *
342 | * (The remote method definition does not provide any description.
343 | * This usually means the response is a `User` object.)
344 | *
345 | */
346 | "prototype$__findById__credentials": {
347 | url: urlBase + "/users/:id/credentials/:fk",
348 | method: "GET"
349 | },
350 |
351 | /**
352 | * @ngdoc method
353 | * @name lbServices.User#prototype$__destroyById__credentials
354 | * @methodOf lbServices.User
355 | *
356 | * @description
357 | *
358 | * Delete a related item by id for credentials
359 | *
360 | * @param {Object=} parameters Request parameters.
361 | *
362 | * - `id` – `{*}` - User id
363 | *
364 | * - `fk` – `{*}` - Foreign key for credentials
365 | *
366 | * @param {function(Object,Object)=} successCb
367 | * Success callback with two arguments: `value`, `responseHeaders`.
368 | *
369 | * @param {function(Object)=} errorCb Error callback with one argument:
370 | * `httpResponse`.
371 | *
372 | * @returns {Object} An empty reference that will be
373 | * populated with the actual data once the response is returned
374 | * from the server.
375 | *
376 | * This method returns no data.
377 | */
378 | "prototype$__destroyById__credentials": {
379 | url: urlBase + "/users/:id/credentials/:fk",
380 | method: "DELETE"
381 | },
382 |
383 | /**
384 | * @ngdoc method
385 | * @name lbServices.User#prototype$__updateById__credentials
386 | * @methodOf lbServices.User
387 | *
388 | * @description
389 | *
390 | * Update a related item by id for credentials
391 | *
392 | * @param {Object=} parameters Request parameters.
393 | *
394 | * - `id` – `{*}` - User id
395 | *
396 | * - `fk` – `{*}` - Foreign key for credentials
397 | *
398 | * @param {Object} postData Request data.
399 | *
400 | * This method expects a subset of model properties as request parameters.
401 | *
402 | * @param {function(Object,Object)=} successCb
403 | * Success callback with two arguments: `value`, `responseHeaders`.
404 | *
405 | * @param {function(Object)=} errorCb Error callback with one argument:
406 | * `httpResponse`.
407 | *
408 | * @returns {Object} An empty reference that will be
409 | * populated with the actual data once the response is returned
410 | * from the server.
411 | *
412 | *
413 | * (The remote method definition does not provide any description.
414 | * This usually means the response is a `User` object.)
415 | *
416 | */
417 | "prototype$__updateById__credentials": {
418 | url: urlBase + "/users/:id/credentials/:fk",
419 | method: "PUT"
420 | },
421 |
422 | /**
423 | * @ngdoc method
424 | * @name lbServices.User#prototype$__findById__accessTokens
425 | * @methodOf lbServices.User
426 | *
427 | * @description
428 | *
429 | * Find a related item by id for accessTokens
430 | *
431 | * @param {Object=} parameters Request parameters.
432 | *
433 | * - `id` – `{*}` - User id
434 | *
435 | * - `fk` – `{*}` - Foreign key for accessTokens
436 | *
437 | * @param {function(Object,Object)=} successCb
438 | * Success callback with two arguments: `value`, `responseHeaders`.
439 | *
440 | * @param {function(Object)=} errorCb Error callback with one argument:
441 | * `httpResponse`.
442 | *
443 | * @returns {Object} An empty reference that will be
444 | * populated with the actual data once the response is returned
445 | * from the server.
446 | *
447 | *
448 | * (The remote method definition does not provide any description.
449 | * This usually means the response is a `User` object.)
450 | *
451 | */
452 | "prototype$__findById__accessTokens": {
453 | url: urlBase + "/users/:id/accessTokens/:fk",
454 | method: "GET"
455 | },
456 |
457 | /**
458 | * @ngdoc method
459 | * @name lbServices.User#prototype$__destroyById__accessTokens
460 | * @methodOf lbServices.User
461 | *
462 | * @description
463 | *
464 | * Delete a related item by id for accessTokens
465 | *
466 | * @param {Object=} parameters Request parameters.
467 | *
468 | * - `id` – `{*}` - User id
469 | *
470 | * - `fk` – `{*}` - Foreign key for accessTokens
471 | *
472 | * @param {function(Object,Object)=} successCb
473 | * Success callback with two arguments: `value`, `responseHeaders`.
474 | *
475 | * @param {function(Object)=} errorCb Error callback with one argument:
476 | * `httpResponse`.
477 | *
478 | * @returns {Object} An empty reference that will be
479 | * populated with the actual data once the response is returned
480 | * from the server.
481 | *
482 | * This method returns no data.
483 | */
484 | "prototype$__destroyById__accessTokens": {
485 | url: urlBase + "/users/:id/accessTokens/:fk",
486 | method: "DELETE"
487 | },
488 |
489 | /**
490 | * @ngdoc method
491 | * @name lbServices.User#prototype$__updateById__accessTokens
492 | * @methodOf lbServices.User
493 | *
494 | * @description
495 | *
496 | * Update a related item by id for accessTokens
497 | *
498 | * @param {Object=} parameters Request parameters.
499 | *
500 | * - `id` – `{*}` - User id
501 | *
502 | * - `fk` – `{*}` - Foreign key for accessTokens
503 | *
504 | * @param {Object} postData Request data.
505 | *
506 | * This method expects a subset of model properties as request parameters.
507 | *
508 | * @param {function(Object,Object)=} successCb
509 | * Success callback with two arguments: `value`, `responseHeaders`.
510 | *
511 | * @param {function(Object)=} errorCb Error callback with one argument:
512 | * `httpResponse`.
513 | *
514 | * @returns {Object} An empty reference that will be
515 | * populated with the actual data once the response is returned
516 | * from the server.
517 | *
518 | *
519 | * (The remote method definition does not provide any description.
520 | * This usually means the response is a `User` object.)
521 | *
522 | */
523 | "prototype$__updateById__accessTokens": {
524 | url: urlBase + "/users/:id/accessTokens/:fk",
525 | method: "PUT"
526 | },
527 |
528 | /**
529 | * @ngdoc method
530 | * @name lbServices.User#prototype$__get__identities
531 | * @methodOf lbServices.User
532 | *
533 | * @description
534 | *
535 | * Queries identities of user.
536 | *
537 | * @param {Object=} parameters Request parameters.
538 | *
539 | * - `id` – `{*}` - User id
540 | *
541 | * - `filter` – `{object=}` -
542 | *
543 | * @param {function(Array.