├── .babelrc ├── ERD.png ├── .dockerignore ├── assets ├── images │ ├── bugs.png │ ├── reset.png │ ├── details.png │ ├── favicon.ico │ ├── favicon.png │ ├── filter.png │ ├── main-bg.jpg │ ├── reopen.png │ ├── resolve.png │ ├── calendar.png │ ├── downarrow.png │ ├── logo_large.png │ ├── logo_small.png │ ├── right_tick.png │ ├── arrow-right.png │ ├── login-report.png │ ├── user_default.png │ ├── error-reported.png │ └── under_construction.png ├── scripts │ ├── index.js │ └── js │ │ └── main.js ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 └── styles │ ├── modules │ ├── misc.scss │ ├── message.scss │ ├── menu.scss │ └── dropdown.scss │ ├── bootstrap │ ├── bootstrap │ │ ├── mixins │ │ │ ├── _center-block.scss │ │ │ ├── _opacity.scss │ │ │ ├── _size.scss │ │ │ ├── _text-overflow.scss │ │ │ ├── _labels.scss │ │ │ ├── _resize.scss │ │ │ ├── _progress-bar.scss │ │ │ ├── _text-emphasis.scss │ │ │ ├── _reset-filter.scss │ │ │ ├── _nav-divider.scss │ │ │ ├── _background-variant.scss │ │ │ ├── _alerts.scss │ │ │ ├── _tab-focus.scss │ │ │ ├── _nav-vertical-align.scss │ │ │ ├── _reset-text.scss │ │ │ ├── _border-radius.scss │ │ │ ├── _pagination.scss │ │ │ ├── _responsive-visibility.scss │ │ │ ├── _panels.scss │ │ │ ├── _hide-text.scss │ │ │ ├── _clearfix.scss │ │ │ ├── _list-group.scss │ │ │ ├── _table-row.scss │ │ │ ├── _image.scss │ │ │ ├── _buttons.scss │ │ │ ├── _grid-framework.scss │ │ │ ├── _forms.scss │ │ │ ├── _grid.scss │ │ │ └── _gradients.scss │ │ ├── _wells.scss │ │ ├── _responsive-embed.scss │ │ ├── _breadcrumbs.scss │ │ ├── _close.scss │ │ ├── _component-animations.scss │ │ ├── _utilities.scss │ │ ├── _thumbnails.scss │ │ ├── _pager.scss │ │ ├── _mixins.scss │ │ ├── _media.scss │ │ ├── _jumbotron.scss │ │ ├── _labels.scss │ │ ├── _badges.scss │ │ ├── _code.scss │ │ ├── _grid.scss │ │ ├── _alerts.scss │ │ ├── _progress-bars.scss │ │ ├── _pagination.scss │ │ ├── _print.scss │ │ ├── _tooltip.scss │ │ ├── _list-group.scss │ │ ├── _scaffolding.scss │ │ ├── _popovers.scss │ │ ├── _modals.scss │ │ ├── _buttons.scss │ │ ├── _input-groups.scss │ │ ├── _responsive-utilities.scss │ │ ├── _tables.scss │ │ └── _dropdowns.scss │ ├── _bootstrap-sprockets.scss │ ├── _bootstrap-compass.scss │ ├── _bootstrap-mincer.scss │ └── _bootstrap.scss │ └── index.scss ├── app ├── controllers │ ├── .DS_Store │ ├── core │ │ ├── fallback.js │ │ └── static.js │ ├── dashboard │ │ ├── alias.js │ │ └── dashboard.js │ ├── auth │ │ ├── logout.js │ │ ├── login.js │ │ └── signup.js │ ├── users │ │ └── manageUsers.js │ ├── user_setting │ │ └── setting.js │ └── user_profile │ │ └── profiles.js ├── templates │ ├── errors │ │ ├── internal.hbs │ │ └── not-found.hbs │ ├── helpers │ │ ├── addOne.js │ │ └── if_eq.js │ ├── partials │ │ ├── form_security.hbs │ │ ├── leftbar.hbs │ │ ├── header.hbs │ │ └── flash.hbs │ ├── auth │ │ ├── successSignup.hbs │ │ ├── login.hbs │ │ └── signup.hbs │ ├── homepage.hbs │ ├── layouts │ │ └── default.hbs │ ├── settings │ │ └── setting.hbs │ ├── dashboard │ │ ├── dashboard.hbs │ │ └── alias.hbs │ ├── users │ │ └── manageUsers.hbs │ └── user_profile │ │ └── profiles.hbs └── routes │ ├── users.js │ ├── dashboard.js │ ├── errorReport.js │ ├── profiles.js │ ├── auth.js │ └── core.js ├── tasks ├── dotenv.js ├── forever.js ├── clean.js ├── lint.js ├── revision.js ├── watch.js ├── nodemon.js ├── assets.js └── webpack.js ├── db ├── init │ ├── insert.sql │ └── init.sql └── models │ ├── crash_Steps.js │ ├── crash_Error.js │ ├── user_Crash_Steps.js │ ├── index.js │ └── error_Reports.js ├── Dockerfile ├── .env ├── index.js ├── server.js ├── gulpfile.js ├── .eslintrc ├── lib ├── auth.js ├── context.js ├── flash.js └── mysql.js ├── .gitignore ├── config ├── meta.js ├── assets.js ├── config.js └── manifest.js ├── docker-compose.yml ├── License ├── package.json └── README.md /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets" : ["es2015", "react"] 3 | } 4 | -------------------------------------------------------------------------------- /ERD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/ERD.png -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env 3 | npm-debug.log 4 | db/data/* 5 | db/init/* 6 | -------------------------------------------------------------------------------- /assets/images/bugs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/assets/images/bugs.png -------------------------------------------------------------------------------- /assets/images/reset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/assets/images/reset.png -------------------------------------------------------------------------------- /app/controllers/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/app/controllers/.DS_Store -------------------------------------------------------------------------------- /assets/images/details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/assets/images/details.png -------------------------------------------------------------------------------- /assets/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/assets/images/favicon.ico -------------------------------------------------------------------------------- /assets/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/assets/images/favicon.png -------------------------------------------------------------------------------- /assets/images/filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/assets/images/filter.png -------------------------------------------------------------------------------- /assets/images/main-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/assets/images/main-bg.jpg -------------------------------------------------------------------------------- /assets/images/reopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/assets/images/reopen.png -------------------------------------------------------------------------------- /assets/images/resolve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/assets/images/resolve.png -------------------------------------------------------------------------------- /assets/images/calendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/assets/images/calendar.png -------------------------------------------------------------------------------- /assets/images/downarrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/assets/images/downarrow.png -------------------------------------------------------------------------------- /assets/images/logo_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/assets/images/logo_large.png -------------------------------------------------------------------------------- /assets/images/logo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/assets/images/logo_small.png -------------------------------------------------------------------------------- /assets/images/right_tick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/assets/images/right_tick.png -------------------------------------------------------------------------------- /assets/scripts/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | require('./js/bootstrap-datetimepicker.js'); 3 | require('./js/main.js'); 4 | -------------------------------------------------------------------------------- /app/templates/errors/internal.hbs: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |

Internal error!

5 | 6 |
7 | -------------------------------------------------------------------------------- /app/templates/helpers/addOne.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function(value) { 4 | return value + 1; 5 | }; 6 | -------------------------------------------------------------------------------- /assets/images/arrow-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/assets/images/arrow-right.png -------------------------------------------------------------------------------- /assets/images/login-report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/assets/images/login-report.png -------------------------------------------------------------------------------- /assets/images/user_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/assets/images/user_default.png -------------------------------------------------------------------------------- /app/templates/partials/form_security.hbs: -------------------------------------------------------------------------------- 1 | {{#if crumb}} 2 | 3 | {{/if}} 4 | -------------------------------------------------------------------------------- /assets/images/error-reported.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/assets/images/error-reported.png -------------------------------------------------------------------------------- /assets/images/under_construction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/assets/images/under_construction.png -------------------------------------------------------------------------------- /assets/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/assets/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /assets/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/assets/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /assets/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/assets/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /assets/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SystangoTechnologies/Crashlyzer/HEAD/assets/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /assets/styles/modules/misc.scss: -------------------------------------------------------------------------------- 1 | .text-logo{ 2 | font-size: 1.5em; 3 | margin-bottom: 3rem; 4 | text-transform: uppercase; 5 | font-weight: 400; 6 | } 7 | -------------------------------------------------------------------------------- /tasks/dotenv.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Gulp = require('gulp'); 4 | const dotenv = require('dotenv'); 5 | 6 | Gulp.task('dotenv', function() { 7 | dotenv.config(); 8 | }); 9 | -------------------------------------------------------------------------------- /db/init/insert.sql: -------------------------------------------------------------------------------- 1 | USE crashreporter; 2 | #Insert following dummy data for initial usage 3 | INSERT INTO Web_App_Users VALUES (10000,'cGFzc3dvcmQ=','admin','admin@example.com','2000-01-01',NULL); 4 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_center-block.scss: -------------------------------------------------------------------------------- 1 | // Center-align a block level element 2 | 3 | @mixin center-block() { 4 | display: block; 5 | margin-left: auto; 6 | margin-right: auto; 7 | } 8 | -------------------------------------------------------------------------------- /tasks/forever.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Gulp = require('gulp'); 4 | var forever = require('forever-monitor'); 5 | 6 | Gulp.task('forever', (cb) => { 7 | new forever.Monitor('server.js').start(); 8 | }); -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:alpine 2 | 3 | WORKDIR /src 4 | 5 | COPY package*.json ./ 6 | 7 | RUN npm install --only=production 8 | 9 | # Bundle app source 10 | COPY . . 11 | 12 | EXPOSE 8000 13 | 14 | CMD [ "npm", "start" ] -------------------------------------------------------------------------------- /app/controllers/core/fallback.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | exports.notfound = { 3 | description: 'Fallback page for 404 error', 4 | handler: function(request, reply) { 5 | reply.view('errors/not-found').code(404); 6 | } 7 | }; -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_opacity.scss: -------------------------------------------------------------------------------- 1 | // Opacity 2 | 3 | @mixin opacity($opacity) { 4 | opacity: $opacity; 5 | // IE8 filter 6 | $opacity-ie: ($opacity * 100); 7 | filter: alpha(opacity=$opacity-ie); 8 | } 9 | -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | NODE_ENV=production 2 | WEB_PORT=8000 3 | DB_HOST=127.0.0.1 4 | DB_USER=myuser 5 | DB_PASSWORD=mysql 6 | DB_NAME=crashreporter 7 | DB_PORT=3306 8 | COOKIE_SECRET=j4wpkSGLH#guPgNmSmB6cJ-w@8pTVGzq 9 | YAR_COOKIE_SECRET=MBUnCq5G&g$y^G4j!z+?5SVqJ?bpCSPK -------------------------------------------------------------------------------- /app/templates/errors/not-found.hbs: -------------------------------------------------------------------------------- 1 |
2 |
3 |

not found

4 |

5 | {{canonicalURL}} does not exist. time to go outside. 6 |

7 |
8 |
9 | 10 | 11 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_size.scss: -------------------------------------------------------------------------------- 1 | // Sizing shortcuts 2 | 3 | @mixin size($width, $height) { 4 | width: $width; 5 | height: $height; 6 | } 7 | 8 | @mixin square($size) { 9 | @include size($size, $size); 10 | } 11 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/_bootstrap-sprockets.scss: -------------------------------------------------------------------------------- 1 | @function twbs-font-path($path) { 2 | @return font-path($path); 3 | } 4 | 5 | @function twbs-image-path($path) { 6 | @return image-path($path); 7 | } 8 | 9 | $bootstrap-sass-asset-helper: true; 10 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_text-overflow.scss: -------------------------------------------------------------------------------- 1 | // Text overflow 2 | // Requires inline-block or block for proper styling 3 | 4 | @mixin text-overflow() { 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | white-space: nowrap; 8 | } 9 | -------------------------------------------------------------------------------- /app/controllers/dashboard/alias.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | exports.showAlias = { 3 | description: 'Returns the dashboard', 4 | handler: function(request, reply) { 5 | reply.view('dashboard/alias'); 6 | }, 7 | tags: ['api'] //swagger documentation 8 | }; -------------------------------------------------------------------------------- /assets/styles/bootstrap/_bootstrap-compass.scss: -------------------------------------------------------------------------------- 1 | @function twbs-font-path($path) { 2 | @return font-url($path, true); 3 | } 4 | 5 | @function twbs-image-path($path) { 6 | @return image-url($path, true); 7 | } 8 | 9 | $bootstrap-sass-asset-helper: true; 10 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_labels.scss: -------------------------------------------------------------------------------- 1 | // Labels 2 | 3 | @mixin label-variant($color) { 4 | background-color: $color; 5 | 6 | &[href] { 7 | &:hover, 8 | &:focus { 9 | background-color: darken($color, 10%); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_resize.scss: -------------------------------------------------------------------------------- 1 | // Resize anything 2 | 3 | @mixin resizable($direction) { 4 | resize: $direction; // Options: horizontal, vertical, both 5 | overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` 6 | } 7 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Glue = require('glue'); 4 | const Manifest = require('./config/manifest'); 5 | 6 | const composeOptions = { 7 | relativeTo: __dirname 8 | }; 9 | 10 | module.exports = Glue.compose.bind(Glue, Manifest.get('/'), composeOptions); 11 | -------------------------------------------------------------------------------- /tasks/clean.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Gulp = require('gulp'); 4 | const Del = require('del'); 5 | 6 | Gulp.task('clean', function() { 7 | 8 | Del('.build').then(function(paths) { 9 | console.log('Deleted files/folders:\n', paths); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_progress-bar.scss: -------------------------------------------------------------------------------- 1 | // Progress bars 2 | 3 | @mixin progress-bar-variant($color) { 4 | background-color: $color; 5 | 6 | // Deprecated parent class requirement as of v3.2.0 7 | .progress-striped & { 8 | @include gradient-striped; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /app/templates/partials/leftbar.hbs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_text-emphasis.scss: -------------------------------------------------------------------------------- 1 | // Typography 2 | 3 | // [converter] $parent hack 4 | @mixin text-emphasis-variant($parent, $color) { 5 | #{$parent} { 6 | color: $color; 7 | } 8 | a#{$parent}:hover, 9 | a#{$parent}:focus { 10 | color: darken($color, 10%); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_reset-filter.scss: -------------------------------------------------------------------------------- 1 | // Reset filters for IE 2 | // 3 | // When you need to remove a gradient background, do not forget to use this to reset 4 | // the IE filter for IE9 and below. 5 | 6 | @mixin reset-filter() { 7 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 8 | } 9 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_nav-divider.scss: -------------------------------------------------------------------------------- 1 | // Horizontal dividers 2 | // 3 | // Dividers (basically an hr) within dropdowns and nav lists 4 | 5 | @mixin nav-divider($color: #e5e5e5) { 6 | height: 1px; 7 | margin: (($line-height-computed / 2) - 1) 0; 8 | overflow: hidden; 9 | background-color: $color; 10 | } 11 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_background-variant.scss: -------------------------------------------------------------------------------- 1 | // Contextual backgrounds 2 | 3 | // [converter] $parent hack 4 | @mixin bg-variant($parent, $color) { 5 | #{$parent} { 6 | background-color: $color; 7 | } 8 | a#{$parent}:hover, 9 | a#{$parent}:focus { 10 | background-color: darken($color, 10%); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tasks/lint.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Gulp = require('gulp'); 4 | const Eslint = require('gulp-eslint'); 5 | const Paths = require('../config/assets'); 6 | 7 | Gulp.task('lint', function() { 8 | return Gulp.src(Paths.get('/lint')) 9 | .pipe(Eslint()) 10 | .pipe(Eslint.format()) 11 | .pipe(Eslint.failAfterError()); 12 | }); 13 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_alerts.scss: -------------------------------------------------------------------------------- 1 | // Alerts 2 | 3 | @mixin alert-variant($background, $border, $text-color) { 4 | background-color: $background; 5 | border-color: $border; 6 | color: $text-color; 7 | 8 | hr { 9 | border-top-color: darken($border, 5%); 10 | } 11 | .alert-link { 12 | color: darken($text-color, 10%); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/templates/auth/successSignup.hbs: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |

Thanks for Signing Up.

5 |

Your request has been successfully sent to the administrator. You will be able to use the application once admin approves your request.

6 |
7 |
8 | -------------------------------------------------------------------------------- /tasks/revision.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Gulp = require('gulp'); 4 | var RevAll = require('gulp-rev-all'); 5 | 6 | var revAll = new RevAll(); 7 | 8 | Gulp.task('rev', ['styles'], function() { 9 | return Gulp.src(['.build/css/index.css']) 10 | .pipe(revAll.revision()) 11 | .pipe(Gulp.dest('.build')) 12 | .pipe(revAll.manifestFile()) 13 | .pipe(Gulp.dest('.build')); 14 | }); 15 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_tab-focus.scss: -------------------------------------------------------------------------------- 1 | // WebKit-style focus 2 | 3 | @mixin tab-focus() { 4 | // WebKit-specific. Other browsers will keep their default outline style. 5 | // (Initially tried to also force default via `outline: initial`, 6 | // but that seems to erroneously remove the outline in Firefox altogether.) 7 | outline: 5px auto -webkit-focus-ring-color; 8 | outline-offset: -2px; 9 | } 10 | -------------------------------------------------------------------------------- /app/controllers/dashboard/dashboard.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | exports.showDashboard = { 3 | description: 'Returns the dashboard', 4 | auth: { 5 | mode: 'try', 6 | strategy: 'standard' 7 | }, 8 | handler: function(request, reply) { 9 | if (request.auth.isAuthenticated) { 10 | reply.view('dashboard/dashboard'); 11 | } 12 | }, 13 | tags: ['api'] //swagger documentation 14 | }; -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Composer = require('./index'); 4 | const Hoek = require('hoek'); 5 | 6 | Composer(function(err, server) { 7 | Hoek.assert(!err, err); 8 | server.start(function() { 9 | // Log to the console the host and port info 10 | server.connections.forEach(function(connection) { 11 | console.log('Server started at: ' + connection.info.uri); 12 | }); 13 | 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /tasks/watch.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Gulp = require('gulp'); 4 | const Paths = require('../config/assets'); 5 | 6 | Gulp.task('watch', ['dev-build'], function() { 7 | Gulp.watch(Paths.get('/fonts'), ['fonts']); 8 | Gulp.watch(Paths.get('/styles'), ['styles']); 9 | Gulp.watch(Paths.get('/misc'), ['misc']); 10 | Gulp.watch(Paths.get('/images'), ['images']); 11 | // Js watch is done with webpack for performance 12 | }); 13 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_nav-vertical-align.scss: -------------------------------------------------------------------------------- 1 | // Navbar vertical align 2 | // 3 | // Vertically center elements in the navbar. 4 | // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin. 5 | 6 | @mixin navbar-vertical-align($element-height) { 7 | margin-top: (($navbar-height - $element-height) / 2); 8 | margin-bottom: (($navbar-height - $element-height) / 2); 9 | } 10 | -------------------------------------------------------------------------------- /app/controllers/auth/logout.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | module.exports = { 3 | auth: { 4 | strategy: 'standard' 5 | }, 6 | plugins: { 7 | crumb: { 8 | key: 'crumb', 9 | source: 'payload', 10 | restful: true 11 | } 12 | }, 13 | handler: function(request, reply) { 14 | request.cookieAuth.clear(); 15 | request.yar.flash('success', 'Logged out successfully'); 16 | return reply.redirect('/login'); 17 | } 18 | }; -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Gulp = require('gulp'); 4 | const RequireDir = require('require-dir'); 5 | RequireDir('./tasks'); // Load tasks 6 | 7 | 8 | // Build task definitions 9 | Gulp.task('dev-build', ['fonts', 'images', 'misc', 'styles', 'webpack:dev-build', 'lint']); 10 | Gulp.task('dev', ['dotenv','dev-build', 'watch', 'nodemon']); 11 | 12 | Gulp.task('prod-build', ['fonts','images', 'misc', 'styles', 'webpack:build']); 13 | Gulp.task('prod', ['prod-build', 'forever']); 14 | 15 | Gulp.task('default', ['prod']); -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | env: 2 | browser: true 3 | commonjs: true 4 | es6: true 5 | node: true 6 | jquery: true 7 | extends: 'eslint:recommended' 8 | parserOptions: 9 | ecmaFeatures: 10 | experimentalObjectRestSpread: true 11 | jsx: true 12 | sourceType: module 13 | plugins: 14 | - react 15 | rules: 16 | linebreak-style: 17 | - error 18 | - unix 19 | quotes: 20 | - error 21 | - single 22 | semi: 23 | - error 24 | - always 25 | curly: error 26 | eqeqeq: error 27 | no-empty: warn 28 | no-console: off 29 | no-unused-vars: off 30 | -------------------------------------------------------------------------------- /app/templates/helpers/if_eq.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function(a, operator, b, opts) { 4 | var bool = false; 5 | switch (operator) { 6 | case '===': 7 | bool = a === b; 8 | break; 9 | case '>': 10 | bool = a > b; 11 | break; 12 | case '<': 13 | bool = a < b; 14 | break; 15 | default: 16 | throw 'Unknown operator ' + operator; 17 | } 18 | if (bool) { 19 | return opts.fn(this); 20 | } else { 21 | return opts.inverse(this); 22 | } 23 | }; -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_reset-text.scss: -------------------------------------------------------------------------------- 1 | @mixin reset-text() { 2 | font-family: $font-family-base; 3 | // We deliberately do NOT reset font-size. 4 | font-style: normal; 5 | font-weight: normal; 6 | letter-spacing: normal; 7 | line-break: auto; 8 | line-height: $line-height-base; 9 | text-align: left; // Fallback for where `start` is not supported 10 | text-align: start; 11 | text-decoration: none; 12 | text-shadow: none; 13 | text-transform: none; 14 | white-space: normal; 15 | word-break: normal; 16 | word-spacing: normal; 17 | word-wrap: normal; 18 | } 19 | -------------------------------------------------------------------------------- /app/controllers/core/static.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | exports.css = { 3 | directory: { 4 | path: '.build/css' 5 | } 6 | }; 7 | exports.img = { 8 | directory: { 9 | path: '.build/images' 10 | } 11 | }; 12 | exports.js = { 13 | directory: { 14 | path: '.build/js' 15 | } 16 | }; 17 | exports.fonts = { 18 | directory: { 19 | path: '.build/fonts' 20 | } 21 | }; 22 | exports.favicon = { 23 | file: '.build/favicon.ico' 24 | }; 25 | exports.heartbeat = { 26 | auth: false, 27 | handler: function(request, reply) { 28 | reply('OK'); 29 | } 30 | }; -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_border-radius.scss: -------------------------------------------------------------------------------- 1 | // Single side border-radius 2 | 3 | @mixin border-top-radius($radius) { 4 | border-top-right-radius: $radius; 5 | border-top-left-radius: $radius; 6 | } 7 | @mixin border-right-radius($radius) { 8 | border-bottom-right-radius: $radius; 9 | border-top-right-radius: $radius; 10 | } 11 | @mixin border-bottom-radius($radius) { 12 | border-bottom-right-radius: $radius; 13 | border-bottom-left-radius: $radius; 14 | } 15 | @mixin border-left-radius($radius) { 16 | border-bottom-left-radius: $radius; 17 | border-top-left-radius: $radius; 18 | } 19 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_pagination.scss: -------------------------------------------------------------------------------- 1 | // Pagination 2 | 3 | @mixin pagination-size($padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) { 4 | > li { 5 | > a, 6 | > span { 7 | padding: $padding-vertical $padding-horizontal; 8 | font-size: $font-size; 9 | line-height: $line-height; 10 | } 11 | &:first-child { 12 | > a, 13 | > span { 14 | @include border-left-radius($border-radius); 15 | } 16 | } 17 | &:last-child { 18 | > a, 19 | > span { 20 | @include border-right-radius($border-radius); 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_responsive-visibility.scss: -------------------------------------------------------------------------------- 1 | // Responsive utilities 2 | 3 | // 4 | // More easily include all the states for responsive-utilities.less. 5 | // [converter] $parent hack 6 | @mixin responsive-visibility($parent) { 7 | #{$parent} { 8 | display: block !important; 9 | } 10 | table#{$parent} { display: table !important; } 11 | tr#{$parent} { display: table-row !important; } 12 | th#{$parent}, 13 | td#{$parent} { display: table-cell !important; } 14 | } 15 | 16 | // [converter] $parent hack 17 | @mixin responsive-invisibility($parent) { 18 | #{$parent} { 19 | display: none !important; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_panels.scss: -------------------------------------------------------------------------------- 1 | // Panels 2 | 3 | @mixin panel-variant($border, $heading-text-color, $heading-bg-color, $heading-border) { 4 | border-color: $border; 5 | 6 | & > .panel-heading { 7 | color: $heading-text-color; 8 | background-color: $heading-bg-color; 9 | border-color: $heading-border; 10 | 11 | + .panel-collapse > .panel-body { 12 | border-top-color: $border; 13 | } 14 | .badge { 15 | color: $heading-bg-color; 16 | background-color: $heading-text-color; 17 | } 18 | } 19 | & > .panel-footer { 20 | + .panel-collapse > .panel-body { 21 | border-bottom-color: $border; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/_wells.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Wells 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .well { 8 | min-height: 20px; 9 | padding: 19px; 10 | margin-bottom: 20px; 11 | background-color: $well-bg; 12 | border: 1px solid $well-border; 13 | border-radius: $border-radius-base; 14 | @include box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 15 | blockquote { 16 | border-color: #ddd; 17 | border-color: rgba(0,0,0,.15); 18 | } 19 | } 20 | 21 | // Sizes 22 | .well-lg { 23 | padding: 24px; 24 | border-radius: $border-radius-large; 25 | } 26 | .well-sm { 27 | padding: 9px; 28 | border-radius: $border-radius-small; 29 | } 30 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_hide-text.scss: -------------------------------------------------------------------------------- 1 | // CSS image replacement 2 | // 3 | // Heads up! v3 launched with only `.hide-text()`, but per our pattern for 4 | // mixins being reused as classes with the same name, this doesn't hold up. As 5 | // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. 6 | // 7 | // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 8 | 9 | // Deprecated as of v3.0.1 (has been removed in v4) 10 | @mixin hide-text() { 11 | font: 0/0 a; 12 | color: transparent; 13 | text-shadow: none; 14 | background-color: transparent; 15 | border: 0; 16 | } 17 | 18 | // New mixin to use as of v3.0.1 19 | @mixin text-hide() { 20 | @include hide-text; 21 | } 22 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/_responsive-embed.scss: -------------------------------------------------------------------------------- 1 | // Embeds responsive 2 | // 3 | // Credit: Nicolas Gallagher and SUIT CSS. 4 | 5 | .embed-responsive { 6 | position: relative; 7 | display: block; 8 | height: 0; 9 | padding: 0; 10 | overflow: hidden; 11 | 12 | .embed-responsive-item, 13 | iframe, 14 | embed, 15 | object, 16 | video { 17 | position: absolute; 18 | top: 0; 19 | left: 0; 20 | bottom: 0; 21 | height: 100%; 22 | width: 100%; 23 | border: 0; 24 | } 25 | } 26 | 27 | // Modifier class for 16:9 aspect ratio 28 | .embed-responsive-16by9 { 29 | padding-bottom: 56.25%; 30 | } 31 | 32 | // Modifier class for 4:3 aspect ratio 33 | .embed-responsive-4by3 { 34 | padding-bottom: 75%; 35 | } 36 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_clearfix.scss: -------------------------------------------------------------------------------- 1 | // Clearfix 2 | // 3 | // For modern browsers 4 | // 1. The space content is one way to avoid an Opera bug when the 5 | // contenteditable attribute is included anywhere else in the document. 6 | // Otherwise it causes space to appear at the top and bottom of elements 7 | // that are clearfixed. 8 | // 2. The use of `table` rather than `block` is only necessary if using 9 | // `:before` to contain the top-margins of child elements. 10 | // 11 | // Source: http://nicolasgallagher.com/micro-clearfix-hack/ 12 | 13 | @mixin clearfix() { 14 | &:before, 15 | &:after { 16 | content: " "; // 1 17 | display: table; // 2 18 | } 19 | &:after { 20 | clear: both; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tasks/nodemon.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const Gulp = require('gulp'); 3 | const Nodemon = require('gulp-nodemon'); 4 | 5 | Gulp.task('nodemon', function() { 6 | 7 | const nodeArgs = []; 8 | const env = process.env.NODE_ENV; 9 | if (process.env.DEBUGGER) { 10 | nodeArgs.push('--inspect'); 11 | } 12 | Nodemon({ 13 | script: 'server.js', 14 | ext: 'hbs js', 15 | ignore: [ 16 | 'assets/', 17 | 'node_modules/', 18 | '.build/', 19 | 'test/' 20 | ], 21 | nodeArgs: nodeArgs 22 | }) 23 | .on('restart', function(files) { 24 | console.log('change detected:', files); 25 | }); 26 | }); 27 | -------------------------------------------------------------------------------- /app/routes/users.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.register = function(plugin, options, next) { 4 | 5 | const Controllers = { 6 | users: { 7 | users: require('../controllers/users/manageUsers'), 8 | } 9 | }; 10 | 11 | plugin.route([ 12 | 13 | // Users Routes 14 | { 15 | method: 'GET', 16 | path: '/users', 17 | config: Controllers.users.users.showUsers 18 | }, 19 | { 20 | method: 'GET', 21 | path: '/users/action/{email}/{currentStatus}', 22 | config: Controllers.users.users.changeUserStatus 23 | } 24 | ]); 25 | 26 | next(); 27 | }; 28 | 29 | exports.register.attributes = { 30 | name: 'user_routes', 31 | version: require('../../package.json').version 32 | }; 33 | -------------------------------------------------------------------------------- /lib/auth.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.register = function(server, options, next) { 4 | 5 | server.auth.strategy('standard', 'cookie', { 6 | password: options.cookieSecret, // cookie secret 7 | cookie: options.cookieName, // Cookie name 8 | isSecure: false, // required for non-https applications 9 | clearInvalid: true, 10 | ttl: 24 * 60 * 60 * 1000, // Set session to 1 day 11 | redirectTo: '/', 12 | redirectOnTry: false, 13 | }); 14 | 15 | // Blacklist all routes. 16 | server.auth.default({ 17 | strategy: 'standard' 18 | }); 19 | 20 | return next(); 21 | }; 22 | 23 | exports.register.attributes = { 24 | name: 'auth', 25 | dependencies: ['context', 'hapi-auth-cookie'] 26 | }; 27 | -------------------------------------------------------------------------------- /db/models/crash_Steps.js: -------------------------------------------------------------------------------- 1 | const Sequelize = require('sequelize'); 2 | 3 | /** * Request Schema */ 4 | module.exports = function(sequelize, DataTypes) { 5 | const crashSteps = sequelize.define('Crash_Steps', { 6 | step_id: { 7 | type: Sequelize.INTEGER, 8 | primaryKey: true, 9 | autoIncrement: true, 10 | allowNull: false 11 | }, 12 | method: { 13 | type: Sequelize.TEXT, 14 | allowNull: false 15 | }, 16 | class: { 17 | type: Sequelize.STRING, 18 | allowNull: false 19 | } 20 | }, { 21 | timestamps: true, 22 | }); 23 | 24 | crashSteps.sync({ force: false }).then(() => { 25 | // Table created 26 | return true; 27 | }); 28 | return crashSteps; 29 | }; -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/_breadcrumbs.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: $breadcrumb-padding-vertical $breadcrumb-padding-horizontal; 8 | margin-bottom: $line-height-computed; 9 | list-style: none; 10 | background-color: $breadcrumb-bg; 11 | border-radius: $border-radius-base; 12 | 13 | > li { 14 | display: inline-block; 15 | 16 | + li:before { 17 | // [converter] Workaround for https://github.com/sass/libsass/issues/1115 18 | $nbsp: "\00a0"; 19 | content: "#{$breadcrumb-separator}#{$nbsp}"; // Unicode space added since inline-block means non-collapsing white-space 20 | padding: 0 5px; 21 | color: $breadcrumb-color; 22 | } 23 | } 24 | 25 | > .active { 26 | color: $breadcrumb-active-color; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_list-group.scss: -------------------------------------------------------------------------------- 1 | // List Groups 2 | 3 | @mixin list-group-item-variant($state, $background, $color) { 4 | .list-group-item-#{$state} { 5 | color: $color; 6 | background-color: $background; 7 | 8 | // [converter] extracted a&, button& to a.list-group-item-#{$state}, button.list-group-item-#{$state} 9 | } 10 | 11 | a.list-group-item-#{$state}, 12 | button.list-group-item-#{$state} { 13 | color: $color; 14 | 15 | .list-group-item-heading { 16 | color: inherit; 17 | } 18 | 19 | &:hover, 20 | &:focus { 21 | color: $color; 22 | background-color: darken($background, 5%); 23 | } 24 | &.active, 25 | &.active:hover, 26 | &.active:focus { 27 | color: #fff; 28 | background-color: $color; 29 | border-color: $color; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/routes/dashboard.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.register = function(plugin, options, next) { 4 | 5 | const Controllers = { 6 | dashboard: { 7 | dashboard: require('../controllers/dashboard/dashboard'), 8 | alias: require('../controllers/dashboard/alias') 9 | } 10 | }; 11 | 12 | plugin.route([ 13 | 14 | // Dashboard Routes 15 | { 16 | method: 'GET', 17 | path: '/dashboard', 18 | config: Controllers.dashboard.dashboard.showDashboard 19 | }, { 20 | method: 'GET', 21 | path: '/alias', 22 | config: Controllers.dashboard.alias.showAlias 23 | } 24 | ]); 25 | 26 | next(); 27 | }; 28 | 29 | exports.register.attributes = { 30 | name: 'dashboard_routes', 31 | version: require('../../package.json').version 32 | }; -------------------------------------------------------------------------------- /assets/styles/bootstrap/_bootstrap-mincer.scss: -------------------------------------------------------------------------------- 1 | // Mincer asset helper functions 2 | // 3 | // This must be imported into a .css.ejs.scss file. 4 | // Then, <% %>-interpolations will be parsed as strings by Sass, and evaluated by EJS after Sass compilation. 5 | 6 | 7 | @function twbs-font-path($path) { 8 | // do something like following 9 | // from "path/to/font.ext#suffix" to "<%- asset_path(path/to/font.ext)) + #suffix %>" 10 | // from "path/to/font.ext?#suffix" to "<%- asset_path(path/to/font.ext)) + ?#suffix %>" 11 | // or from "path/to/font.ext" just "<%- asset_path(path/to/font.ext)) %>" 12 | @return "<%- asset_path("#{$path}".replace(/[#?].*$/, '')) + "#{$path}".replace(/(^[^#?]*)([#?]?.*$)/, '$2') %>"; 13 | } 14 | 15 | @function twbs-image-path($file) { 16 | @return "<%- asset_path("#{$file}") %>"; 17 | } 18 | 19 | $bootstrap-sass-asset-helper: true; 20 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_table-row.scss: -------------------------------------------------------------------------------- 1 | // Tables 2 | 3 | @mixin table-row-variant($state, $background) { 4 | // Exact selectors below required to override `.table-striped` and prevent 5 | // inheritance to nested tables. 6 | .table > thead > tr, 7 | .table > tbody > tr, 8 | .table > tfoot > tr { 9 | > td.#{$state}, 10 | > th.#{$state}, 11 | &.#{$state} > td, 12 | &.#{$state} > th { 13 | background-color: $background; 14 | } 15 | } 16 | 17 | // Hover states for `.table-hover` 18 | // Note: this is not available for cells or rows within `thead` or `tfoot`. 19 | .table-hover > tbody > tr { 20 | > td.#{$state}:hover, 21 | > th.#{$state}:hover, 22 | &.#{$state}:hover > td, 23 | &:hover > .#{$state}, 24 | &.#{$state}:hover > th { 25 | background-color: darken($background, 5%); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/context.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Hoek = require('hoek'); 4 | 5 | exports.register = function(plugin, options, next) { 6 | 7 | plugin.ext('onPreResponse', function(request, reply) { 8 | var internals = { 9 | devEnv: (process.env.NODE_ENV === 'development'), 10 | meta: options.meta, 11 | credentials: request.auth.isAuthenticated ? request.auth.credentials : null 12 | }; 13 | 14 | var response = request.response; 15 | if (response.variety && response.variety === 'view') { 16 | response.source.context = Hoek.merge(internals, request.response.source.context); 17 | 18 | } 19 | return reply.continue(); 20 | }); 21 | 22 | next(); 23 | }; 24 | 25 | 26 | exports.register.attributes = { 27 | name: 'context', 28 | version: require('../package.json').version 29 | }; 30 | -------------------------------------------------------------------------------- /db/models/crash_Error.js: -------------------------------------------------------------------------------- 1 | const Sequelize = require('sequelize'); 2 | 3 | /** * Request Schema */ 4 | module.exports = function(sequelize, DataTypes) { 5 | const crashError = sequelize.define('Crash_Error', { 6 | error_id: { 7 | type: Sequelize.INTEGER, 8 | primaryKey: true, 9 | autoIncrement: true, 10 | allowNull: false 11 | }, 12 | error_msg: { 13 | type: Sequelize.TEXT, 14 | allowNull: false 15 | }, 16 | error_stacktrace: { 17 | type: Sequelize.STRING, 18 | allowNull: false 19 | } 20 | }, { 21 | timestamps: true, 22 | freezeTableName: true 23 | 24 | }); 25 | 26 | crashError.sync({ force: false }).then(() => { 27 | // Table created 28 | return true; 29 | }); 30 | return crashError; 31 | }; -------------------------------------------------------------------------------- /lib/flash.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // This plugin should be loaded after vision 4 | 5 | const Hoek = require('hoek'); 6 | 7 | exports.register = function(plugin, options, next) { 8 | 9 | // To Do : Raise an eror if yar plugin is already loaded 10 | // To Do : Raise an error if vision is not loaded 11 | 12 | plugin.ext('onPreResponse', function(request, reply) { 13 | 14 | if (request.yar && request.yar.flash && request.response.variety === 'view') { 15 | 16 | var flash = request.yar.flash(); 17 | request.response.source.context = Hoek.applyToDefaults({ 18 | flash: flash 19 | }, request.response.source.context); 20 | } 21 | return reply.continue(); 22 | }); 23 | 24 | next(); 25 | }; 26 | 27 | exports.register.attributes = { 28 | name: 'flash', 29 | dependencies: ['vision'] 30 | }; 31 | -------------------------------------------------------------------------------- /app/templates/homepage.hbs: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |

Jolly

5 |

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod 6 | tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, 7 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo 8 | consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse 9 | cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non 10 | proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

11 | Get Started 12 |
13 |
14 |
15 |
16 | 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 18 | .grunt 19 | 20 | # node-waf configuration 21 | .lock-wscript 22 | 23 | # Compiled binary addons (http://nodejs.org/api/addons.html) 24 | build/Release 25 | 26 | # Dependency directory 27 | node_modules 28 | node_modules/ 29 | 30 | # Optional npm cache directory 31 | .npm 32 | 33 | # Optional REPL history 34 | .node_repl_history 35 | 36 | 37 | # Sublime Project Files 38 | *.sublime-project 39 | *.sublime-workspace 40 | 41 | # Project specific ignore 42 | ./log/hhh.log 43 | .build 44 | 45 | # Datastore file 46 | /app/.DS_Store 47 | .DS_Store 48 | 49 | # DB 50 | db/data/* 51 | -------------------------------------------------------------------------------- /app/templates/auth/login.hbs: -------------------------------------------------------------------------------- 1 |
2 |
3 | Don't have an account? 4 | Sign Up 5 |
6 |
7 | 10 |
11 | {{> flash}} 12 |
13 |

Log In

14 |

Please enter your details below

15 |
16 | 17 | 18 | 19 | 20 |
21 | Forgot password? 22 |
23 | 24 |
25 | 26 | {{> form_security}} 27 |
28 |
29 |
30 | 31 | 32 | -------------------------------------------------------------------------------- /config/meta.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Confidence = require('confidence'); 4 | const Pkg = require('../package.json'); 5 | 6 | // Confidence criteria 7 | let internals = { 8 | criteria: { 9 | env: process.env.NODE_ENV 10 | } 11 | }; 12 | 13 | // Confidence document object 14 | 15 | internals.config = { 16 | $meta: 'App metadata configuration file', 17 | title: { 18 | $filter: 'env', 19 | test: 'Crash-Reporter-Test', 20 | production: 'Crash-Reporter', 21 | $default: Pkg.name 22 | }, 23 | keywords: { 24 | $filter: 'env', 25 | test: 'Test', 26 | production: 'Hapi boileplate', 27 | $default: Pkg.keywords 28 | } 29 | }; 30 | 31 | internals.store = new Confidence.Store(internals.config); 32 | 33 | exports.get = function(key) { 34 | return internals.store.get(key, internals.criteria); 35 | }; 36 | 37 | exports.meta = function(key) { 38 | return internals.store.meta(key, internals.criteria); 39 | }; -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/_close.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: ($font-size-base * 1.5); 9 | font-weight: $close-font-weight; 10 | line-height: 1; 11 | color: $close-color; 12 | text-shadow: $close-text-shadow; 13 | @include opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: $close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | @include opacity(.5); 21 | } 22 | 23 | // [converter] extracted button& to button.close 24 | } 25 | 26 | // Additional properties for button version 27 | // iOS requires the button element instead of an anchor tag. 28 | // If you want the anchor version, it requires `href="#"`. 29 | // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile 30 | button.close { 31 | padding: 0; 32 | cursor: pointer; 33 | background: transparent; 34 | border: 0; 35 | -webkit-appearance: none; 36 | } 37 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/_component-animations.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | @include transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | 21 | &.in { display: block; } 22 | // [converter] extracted tr&.in to tr.collapse.in 23 | // [converter] extracted tbody&.in to tbody.collapse.in 24 | } 25 | 26 | tr.collapse.in { display: table-row; } 27 | 28 | tbody.collapse.in { display: table-row-group; } 29 | 30 | .collapsing { 31 | position: relative; 32 | height: 0; 33 | overflow: hidden; 34 | @include transition-property(height, visibility); 35 | @include transition-duration(.35s); 36 | @include transition-timing-function(ease); 37 | } 38 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/_utilities.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes 3 | // -------------------------------------------------- 4 | 5 | 6 | // Floats 7 | // ------------------------- 8 | 9 | .clearfix { 10 | @include clearfix; 11 | } 12 | .center-block { 13 | @include center-block; 14 | } 15 | .pull-right { 16 | float: right !important; 17 | } 18 | .pull-left { 19 | float: left !important; 20 | } 21 | 22 | 23 | // Toggling content 24 | // ------------------------- 25 | 26 | // Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1 27 | .hide { 28 | display: none !important; 29 | } 30 | .show { 31 | display: block !important; 32 | } 33 | .invisible { 34 | visibility: hidden; 35 | } 36 | .text-hide { 37 | @include text-hide; 38 | } 39 | 40 | 41 | // Hide from screenreaders and browsers 42 | // 43 | // Credit: HTML5 Boilerplate 44 | 45 | .hidden { 46 | display: none !important; 47 | } 48 | 49 | 50 | // For Affix plugin 51 | // ------------------------- 52 | 53 | .affix { 54 | position: fixed; 55 | } 56 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/_thumbnails.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Thumbnails 3 | // -------------------------------------------------- 4 | 5 | 6 | // Mixin and adjust the regular image class 7 | .thumbnail { 8 | display: block; 9 | padding: $thumbnail-padding; 10 | margin-bottom: $line-height-computed; 11 | line-height: $line-height-base; 12 | background-color: $thumbnail-bg; 13 | border: 1px solid $thumbnail-border; 14 | border-radius: $thumbnail-border-radius; 15 | @include transition(border .2s ease-in-out); 16 | 17 | > img, 18 | a > img { 19 | @include img-responsive; 20 | margin-left: auto; 21 | margin-right: auto; 22 | } 23 | 24 | // [converter] extracted a&:hover, a&:focus, a&.active to a.thumbnail:hover, a.thumbnail:focus, a.thumbnail.active 25 | 26 | // Image captions 27 | .caption { 28 | padding: $thumbnail-caption-padding; 29 | color: $thumbnail-caption-color; 30 | } 31 | } 32 | 33 | // Add a hover state for linked versions only 34 | a.thumbnail:hover, 35 | a.thumbnail:focus, 36 | a.thumbnail.active { 37 | border-color: $link-color; 38 | } 39 | -------------------------------------------------------------------------------- /config/assets.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Confidence = require('confidence'); 4 | 5 | // Confidence criteria 6 | 7 | let internals = { 8 | criteria: { 9 | env: process.env.NODE_ENV 10 | } 11 | }; 12 | 13 | // Confidence document 14 | 15 | internals.paths = { 16 | fonts: ['./assets/fonts/*'], 17 | styles: ['./assets/styles/**/*'], 18 | images: ['./assets/images/**/*'], 19 | misc: ['./assets/misc/*'], 20 | scripts: { 21 | main: ['./assets/scripts/**/*'], 22 | vendor: ['./assets/scripts/vendor/*.js'] 23 | }, 24 | lint: [ 25 | './assets/scripts/**/*.js', 26 | './app/**/*.js', 27 | './lib/**/*.js', 28 | './config/**/*.js', 29 | './test/**/*.js', 30 | './tasks/**/*.js', 31 | '*.js' 32 | ] 33 | }; 34 | 35 | internals.store = new Confidence.Store(internals.paths); 36 | 37 | exports.get = function(key) { 38 | return internals.store.get(key, internals.criteria); 39 | }; 40 | exports.meta = function(key) { 41 | return internals.store.meta(key, internals.criteria); 42 | }; 43 | -------------------------------------------------------------------------------- /lib/mysql.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const mysql = require('mysql'); 3 | exports.register = function(plugin, options, next) { 4 | var pool = mysql.createPool({ 5 | connectionLimit: options.connectionLimit, 6 | host: options.host, 7 | user: options.user, 8 | password: options.password, 9 | port: options.port, 10 | database: options.database 11 | }); 12 | console.log("********************************"); 13 | console.log(options); 14 | console.log("********************************"); 15 | exports.getConnection = function(callback) { 16 | pool.getConnection(function(err, connection) { 17 | callback(err, connection); 18 | }); 19 | }; 20 | pool.on('connection', function(connection) { 21 | console.log('Connected with threadId: ', connection.threadId); 22 | }); 23 | pool.on('enqueue', function() { 24 | console.log('Waiting for available connection slot'); 25 | }); 26 | next(); 27 | }; 28 | exports.register.attributes = { 29 | name: 'mysql', 30 | version: require('../package.json').version 31 | }; -------------------------------------------------------------------------------- /app/templates/partials/header.hbs: -------------------------------------------------------------------------------- 1 |
2 | 23 |
24 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/_pager.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Pager pagination 3 | // -------------------------------------------------- 4 | 5 | 6 | .pager { 7 | padding-left: 0; 8 | margin: $line-height-computed 0; 9 | list-style: none; 10 | text-align: center; 11 | @include clearfix; 12 | li { 13 | display: inline; 14 | > a, 15 | > span { 16 | display: inline-block; 17 | padding: 5px 14px; 18 | background-color: $pager-bg; 19 | border: 1px solid $pager-border; 20 | border-radius: $pager-border-radius; 21 | } 22 | 23 | > a:hover, 24 | > a:focus { 25 | text-decoration: none; 26 | background-color: $pager-hover-bg; 27 | } 28 | } 29 | 30 | .next { 31 | > a, 32 | > span { 33 | float: right; 34 | } 35 | } 36 | 37 | .previous { 38 | > a, 39 | > span { 40 | float: left; 41 | } 42 | } 43 | 44 | .disabled { 45 | > a, 46 | > a:hover, 47 | > a:focus, 48 | > span { 49 | color: $pager-disabled-color; 50 | background-color: $pager-bg; 51 | cursor: $cursor-disabled; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /tasks/assets.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Gulp = require('gulp'); 4 | const Sass = require('gulp-sass'); 5 | const Autoprefixer = require('gulp-autoprefixer'); 6 | const Paths = require('../config/assets'); 7 | 8 | 9 | var gutil = require('gulp-util'); 10 | 11 | 12 | 13 | // Build styles 14 | 15 | Gulp.task('styles', function() { 16 | Gulp.src('./assets/styles/index.scss') 17 | .pipe(Sass().on('error', Sass.logError)) 18 | .pipe(Autoprefixer({ 19 | browsers: ['last 2 versions'], 20 | cascade: false 21 | })) 22 | .pipe(Gulp.dest('.build/css')); 23 | }); 24 | 25 | 26 | // Build fonts 27 | 28 | Gulp.task('fonts', function() { 29 | return Gulp.src(Paths.get('/fonts')) 30 | .pipe(Gulp.dest('.build/fonts')); 31 | }); 32 | 33 | 34 | // Build images 35 | 36 | Gulp.task('images', function() { 37 | return Gulp.src(Paths.get('/images')) 38 | .pipe(Gulp.dest('.build/images')); 39 | }); 40 | 41 | 42 | // Build misc 43 | 44 | Gulp.task('misc', function() { 45 | return Gulp.src(Paths.get('/misc')) 46 | .pipe(Gulp.dest('.build/misc')); 47 | }); 48 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2.1' 2 | services: 3 | db: 4 | container_name: db 5 | image: mysql:5.7 6 | ports: 7 | - "3306:3306" 8 | environment: 9 | - MYSQL_ROOT_PASSWORD=${DB_PASSWORD} 10 | - MYSQL_DATABASE=mysqldb 11 | - MYSQL_USER=${DB_USER} 12 | - MYSQL_PASSWORD=${DB_PASSWORD} 13 | volumes: 14 | - ./db/data:/var/lib/mysql 15 | - ./db/init:/docker-entrypoint-initdb.d/:ro 16 | healthcheck: 17 | test: "/etc/init.d/mysql status" 18 | interval: 1s 19 | retries: 120 20 | 21 | web: 22 | build: . 23 | links: 24 | - db 25 | container_name: crash-reporter-app 26 | restart: always 27 | ports: 28 | - "8000:8000" 29 | environment: 30 | - NODE_ENV=production 31 | - WEB_PORT=${WEB_PORT} 32 | - DB_HOST=db 33 | - DB_USER=${DB_USER} 34 | - DB_PASSWORD=${DB_PASSWORD} 35 | - DB_NAME=${DB_NAME} 36 | - DB_PORT=${DB_PORT} 37 | - COOKIE_SECRET=${COOKIE_SECRET} 38 | - YAR_COOKIE_SECRET=${YAR_COOKIE_SECRET} 39 | depends_on: 40 | db: 41 | condition: service_healthy -------------------------------------------------------------------------------- /License: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018-19 Systango Technologies 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. -------------------------------------------------------------------------------- /app/templates/partials/flash.hbs: -------------------------------------------------------------------------------- 1 | {{!-- Display flash messages --}} 2 | {{!-- TODO : Code DRY --}} 3 | {{#if flash.success}} 4 |
5 | {{!--
Errors
--}} 6 | 11 |
12 | {{/if}} 13 | {{#if flash.error}} 14 |
15 | {{!--
Errors
--}} 16 | 21 |
22 | {{/if}} 23 | {{#if flash.warning}} 24 |
25 | {{!--
Errors
--}} 26 | 31 |
32 | {{/if}} 33 | {{#if flash.info}} 34 |
35 | {{!--
Errors
--}} 36 | 41 |
42 | {{/if}} 43 | -------------------------------------------------------------------------------- /db/models/user_Crash_Steps.js: -------------------------------------------------------------------------------- 1 | const Sequelize = require('sequelize'); 2 | 3 | 4 | /** * Request Schema */ 5 | module.exports = function(sequelize, DataTypes) { 6 | const userCrashSteps = sequelize.define('User_Crash_Steps', { 7 | report_id: { 8 | type: Sequelize.INTEGER, 9 | allowNull: false 10 | }, 11 | step_id: { 12 | type: Sequelize.INTEGER, 13 | allowNull: false 14 | }, 15 | actionOn: { 16 | type: Sequelize.TEXT, 17 | }, 18 | date: { 19 | type: Sequelize.DATE, 20 | defaultValue: DataTypes.allowNull, 21 | allowNull: true 22 | }, 23 | id: { 24 | type: Sequelize.INTEGER, 25 | primaryKey: true, 26 | autoIncrement: true, 27 | allowNull: false 28 | }, 29 | description: { 30 | type: Sequelize.TEXT 31 | } 32 | }, { 33 | timestamps: true 34 | }); 35 | 36 | userCrashSteps.sync({ force: false }).then(() => { 37 | // Table created 38 | return true; 39 | }); 40 | return userCrashSteps; 41 | }; -------------------------------------------------------------------------------- /app/routes/errorReport.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | exports.register = function(plugin, options, next) { 3 | const Controllers = { 4 | erroreport: { 5 | errorReported: require('../controllers/erroreport/errorReported') 6 | } 7 | }; 8 | plugin.route([{ 9 | method: 'GET', 10 | path: '/crash', 11 | config: Controllers.erroreport.errorReported.showCrashReport 12 | }, { 13 | method: 'GET', 14 | path: '/report/status/{reportId}/{currentStatus}', 15 | config: Controllers.erroreport.errorReported.changeErrorStatus 16 | }, { 17 | method: 'GET', 18 | path: '/report_filter', 19 | config: Controllers.erroreport.errorReported.filter 20 | }, { 21 | method: 'GET', 22 | path: '/generateCrash', 23 | config: Controllers.erroreport.errorReported.insertIntoCrash 24 | }, { 25 | method: 'POST', 26 | path: '/report', 27 | config: Controllers.erroreport.errorReported.report 28 | }]); 29 | next(); 30 | }; 31 | exports.register.attributes = { 32 | name: 'errorReport_routes', 33 | version: require('../../package.json').version 34 | }; 35 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/_mixins.scss: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------------------------------- 3 | 4 | // Utilities 5 | @import "mixins/hide-text"; 6 | @import "mixins/opacity"; 7 | @import "mixins/image"; 8 | @import "mixins/labels"; 9 | @import "mixins/reset-filter"; 10 | @import "mixins/resize"; 11 | @import "mixins/responsive-visibility"; 12 | @import "mixins/size"; 13 | @import "mixins/tab-focus"; 14 | @import "mixins/reset-text"; 15 | @import "mixins/text-emphasis"; 16 | @import "mixins/text-overflow"; 17 | @import "mixins/vendor-prefixes"; 18 | 19 | // Components 20 | @import "mixins/alerts"; 21 | @import "mixins/buttons"; 22 | @import "mixins/panels"; 23 | @import "mixins/pagination"; 24 | @import "mixins/list-group"; 25 | @import "mixins/nav-divider"; 26 | @import "mixins/forms"; 27 | @import "mixins/progress-bar"; 28 | @import "mixins/table-row"; 29 | 30 | // Skins 31 | @import "mixins/background-variant"; 32 | @import "mixins/border-radius"; 33 | @import "mixins/gradients"; 34 | 35 | // Layout 36 | @import "mixins/clearfix"; 37 | @import "mixins/center-block"; 38 | @import "mixins/nav-vertical-align"; 39 | @import "mixins/grid-framework"; 40 | @import "mixins/grid"; 41 | -------------------------------------------------------------------------------- /app/templates/layouts/default.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{meta.title}} 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | {{{ content }}} 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /assets/styles/index.scss: -------------------------------------------------------------------------------- 1 | @import 'bootstrap/_bootstrap'; 2 | @import 'views/login'; 3 | @import 'dashboard/dashboard'; 4 | @import 'datepicker/bootstrap-datetimepicker.min'; 5 | 6 | 7 | /* Style the tab */ 8 | 9 | div.tab { 10 | overflow: hidden; 11 | border: 1px solid #ccc; 12 | background-color: #f1f1f1; 13 | } 14 | 15 | 16 | /* Style the buttons inside the tab */ 17 | 18 | div.tab button { 19 | background-color: inherit; 20 | float: left; 21 | border: none; 22 | outline: none; 23 | cursor: pointer; 24 | padding: 14px 16px; 25 | transition: 0.3s; 26 | } 27 | 28 | 29 | /* Change background color of buttons on hover */ 30 | 31 | div.tab button:hover { 32 | background-color: #ddd; 33 | } 34 | 35 | 36 | /* Create an active/current tablink class */ 37 | 38 | div.tab button.active { 39 | background-color: #ccc; 40 | } 41 | 42 | 43 | /* Style the tab content */ 44 | 45 | .tabcontent { 46 | display: none; 47 | padding: 6px 12px; 48 | border: 1px solid #ccc; 49 | border-top: none; 50 | } 51 | 52 | div.tab button.active { 53 | background-color: #1f6440; 54 | } 55 | 56 | 57 | -------------------------------------------------------------------------------- /assets/styles/modules/message.scss: -------------------------------------------------------------------------------- 1 | .message { 2 | position: relative; 3 | min-height: 1em; 4 | margin: 1em 0; 5 | background: rgba($color__foreground, .05); 6 | padding: .9rem 1.5rem; 7 | line-height: 1.4285em; 8 | color: rgba(0, 0, 0, .87); 9 | border-radius: $borderRadius--base; 10 | box-shadow: 0 0 0 1px rgba($color__foreground, 0.3) inset, 0 0 0 0 transparent; 11 | } 12 | .message li { 13 | list-style: none 14 | } 15 | .message--error { 16 | color: $color__error; 17 | box-shadow: 0 0 0 1px rgba($color__error, 0.3) inset, 0 0 0 0 transparent; 18 | background: rgba($color__error, .05); 19 | } 20 | .message--warning { 21 | color: $color__warning; 22 | box-shadow: 0 0 0 1px rgba($color__warning, 0.3) inset, 0 0 0 0 transparent; 23 | background: rgba($color__warning, .05); 24 | } 25 | .message--success { 26 | color: $color__success; 27 | box-shadow: 0 0 0 1px rgba($color__success, 0.3) inset, 0 0 0 0 transparent; 28 | background: rgba($color__success, .05); 29 | } 30 | .message-header { 31 | display: block; 32 | font-weight: 700; 33 | margin: -.14285rem 0 3px -.18285rem; 34 | } 35 | .message ul, 36 | .message ul li:last-child { 37 | margin-bottom: 0; 38 | } 39 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/_media.scss: -------------------------------------------------------------------------------- 1 | .media { 2 | // Proper spacing between instances of .media 3 | margin-top: 15px; 4 | 5 | &:first-child { 6 | margin-top: 0; 7 | } 8 | } 9 | 10 | .media, 11 | .media-body { 12 | zoom: 1; 13 | overflow: hidden; 14 | } 15 | 16 | .media-body { 17 | width: 10000px; 18 | } 19 | 20 | .media-object { 21 | display: block; 22 | 23 | // Fix collapse in webkit from max-width: 100% and display: table-cell. 24 | &.img-thumbnail { 25 | max-width: none; 26 | } 27 | } 28 | 29 | .media-right, 30 | .media > .pull-right { 31 | padding-left: 10px; 32 | } 33 | 34 | .media-left, 35 | .media > .pull-left { 36 | padding-right: 10px; 37 | } 38 | 39 | .media-left, 40 | .media-right, 41 | .media-body { 42 | display: table-cell; 43 | vertical-align: top; 44 | } 45 | 46 | .media-middle { 47 | vertical-align: middle; 48 | } 49 | 50 | .media-bottom { 51 | vertical-align: bottom; 52 | } 53 | 54 | // Reset margins on headings for tighter default spacing 55 | .media-heading { 56 | margin-top: 0; 57 | margin-bottom: 5px; 58 | } 59 | 60 | // Media list variation 61 | // 62 | // Undo default ul/ol styles 63 | .media-list { 64 | padding-left: 0; 65 | list-style: none; 66 | } 67 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_image.scss: -------------------------------------------------------------------------------- 1 | // Image Mixins 2 | // - Responsive image 3 | // - Retina image 4 | 5 | 6 | // Responsive image 7 | // 8 | // Keep images from scaling beyond the width of their parents. 9 | @mixin img-responsive($display: block) { 10 | display: $display; 11 | max-width: 100%; // Part 1: Set a maximum relative to the parent 12 | height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching 13 | } 14 | 15 | 16 | // Retina image 17 | // 18 | // Short retina mixin for setting background-image and -size. Note that the 19 | // spelling of `min--moz-device-pixel-ratio` is intentional. 20 | @mixin img-retina($file-1x, $file-2x, $width-1x, $height-1x) { 21 | background-image: url(if($bootstrap-sass-asset-helper, twbs-image-path("#{$file-1x}"), "#{$file-1x}")); 22 | 23 | @media 24 | only screen and (-webkit-min-device-pixel-ratio: 2), 25 | only screen and ( min--moz-device-pixel-ratio: 2), 26 | only screen and ( -o-min-device-pixel-ratio: 2/1), 27 | only screen and ( min-device-pixel-ratio: 2), 28 | only screen and ( min-resolution: 192dpi), 29 | only screen and ( min-resolution: 2dppx) { 30 | background-image: url(if($bootstrap-sass-asset-helper, twbs-image-path("#{$file-2x}"), "#{$file-2x}")); 31 | background-size: $width-1x $height-1x; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /db/models/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const fs = require("fs"); 4 | const path = require("path"); 5 | const Sequelize = require("sequelize"); 6 | const config = require("../../config/config").get('/mysql'); 7 | 8 | const sequelize = new Sequelize(config.database, config.user, config.password, { 9 | host: config.host, 10 | port: config.port, 11 | dialect: 'mysql', 12 | define: { 13 | underscored: true 14 | }, 15 | pool: { 16 | max: 5, 17 | min: 0, 18 | idle: 10000 19 | } 20 | }) 21 | 22 | const db = {}; 23 | 24 | fs 25 | .readdirSync(__dirname) 26 | .filter(function(file) { 27 | return (file.indexOf(".") !== 0) && (file !== "index.js"); 28 | }) 29 | .forEach(function(file) { 30 | var model = sequelize["import"](path.join(__dirname, file)); 31 | db[model.name] = model; 32 | }); 33 | 34 | Object.keys(db).forEach(function(modelName) { 35 | if ("associate" in db[modelName]) { 36 | db[modelName].associate(db); 37 | } 38 | }); 39 | 40 | db.sequelize = sequelize; 41 | db.Sequelize = Sequelize; 42 | 43 | 44 | db.Error_Reports.hasMany(db.User_Crash_Steps , {as: 'user_crash_reports'}); 45 | db.User_Crash_Steps.belongsTo(db.Error_Reports) 46 | 47 | db.Crash_Steps.hasMany(db.User_Crash_Steps); 48 | db.User_Crash_Steps.belongsTo(db.User_Crash_Steps, {as: 'crash_steps'}) 49 | 50 | module.exports = db; -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/_jumbotron.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Jumbotron 3 | // -------------------------------------------------- 4 | 5 | 6 | .jumbotron { 7 | padding-top: $jumbotron-padding; 8 | padding-bottom: $jumbotron-padding; 9 | margin-bottom: $jumbotron-padding; 10 | color: $jumbotron-color; 11 | background-color: $jumbotron-bg; 12 | 13 | h1, 14 | .h1 { 15 | color: $jumbotron-heading-color; 16 | } 17 | 18 | p { 19 | margin-bottom: ($jumbotron-padding / 2); 20 | font-size: $jumbotron-font-size; 21 | font-weight: 200; 22 | } 23 | 24 | > hr { 25 | border-top-color: darken($jumbotron-bg, 10%); 26 | } 27 | 28 | .container &, 29 | .container-fluid & { 30 | border-radius: $border-radius-large; // Only round corners at higher resolutions if contained in a container 31 | padding-left: ($grid-gutter-width / 2); 32 | padding-right: ($grid-gutter-width / 2); 33 | } 34 | 35 | .container { 36 | max-width: 100%; 37 | } 38 | 39 | @media screen and (min-width: $screen-sm-min) { 40 | padding-top: ($jumbotron-padding * 1.6); 41 | padding-bottom: ($jumbotron-padding * 1.6); 42 | 43 | .container &, 44 | .container-fluid & { 45 | padding-left: ($jumbotron-padding * 2); 46 | padding-right: ($jumbotron-padding * 2); 47 | } 48 | 49 | h1, 50 | .h1 { 51 | font-size: $jumbotron-heading-font-size; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/templates/auth/signup.hbs: -------------------------------------------------------------------------------- 1 |
2 |
3 | Don't have an account? 4 | Log In 5 |
6 |
7 | 10 |
11 | {{> flash}} 12 |
13 |

Sign Up

14 |
15 |
16 | 17 | 18 |
19 |
20 | 21 | 22 |
23 |
24 | 25 | 26 |
27 | 28 |
29 | 30 | 31 |
32 |
33 | 34 | {{> form_security}} 35 |
36 |
37 |
38 | 39 | -------------------------------------------------------------------------------- /app/routes/profiles.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.register = function(plugin, options, next) { 4 | 5 | const Controllers = { 6 | user_profiles: { 7 | user_profile: require('../controllers/user_profile/profiles'), 8 | user_setting: require('../controllers/user_setting/setting') 9 | } 10 | }; 11 | 12 | plugin.route([ 13 | 14 | // Profile Routes 15 | { 16 | method: 'GET', 17 | path: '/profiles', 18 | config: Controllers.user_profiles.user_profile.showProfiles 19 | }, 20 | 21 | { 22 | method: 'POST', 23 | path: '/profile/{email}', 24 | config: Controllers.user_profiles.user_profile.editProfiles 25 | }, 26 | 27 | { 28 | method: 'GET', 29 | path: '/setting', 30 | config: Controllers.user_profiles.user_setting.showSetting 31 | }, 32 | 33 | { 34 | method: 'POST', 35 | path: '/password', 36 | config: Controllers.user_profiles.user_setting.changePassword 37 | }, 38 | { 39 | method: 'POST', 40 | path: '/deleteprofile', 41 | config: Controllers.user_profiles.user_profile.deleteProfile 42 | } 43 | ]); 44 | 45 | next(); 46 | }; 47 | 48 | exports.register.attributes = { 49 | name: 'profiles_routes', 50 | version: require('../../package.json').version 51 | }; 52 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/_labels.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .2em .6em .3em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: $label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // [converter] extracted a& to a.label 18 | 19 | // Empty labels collapse automatically (not available in IE8) 20 | &:empty { 21 | display: none; 22 | } 23 | 24 | // Quick fix for labels in buttons 25 | .btn & { 26 | position: relative; 27 | top: -1px; 28 | } 29 | } 30 | 31 | // Add hover effects, but only for links 32 | a.label { 33 | &:hover, 34 | &:focus { 35 | color: $label-link-hover-color; 36 | text-decoration: none; 37 | cursor: pointer; 38 | } 39 | } 40 | 41 | // Colors 42 | // Contextual variations (linked labels get darker on :hover) 43 | 44 | .label-default { 45 | @include label-variant($label-default-bg); 46 | } 47 | 48 | .label-primary { 49 | @include label-variant($label-primary-bg); 50 | } 51 | 52 | .label-success { 53 | @include label-variant($label-success-bg); 54 | } 55 | 56 | .label-info { 57 | @include label-variant($label-info-bg); 58 | } 59 | 60 | .label-warning { 61 | @include label-variant($label-warning-bg); 62 | } 63 | 64 | .label-danger { 65 | @include label-variant($label-danger-bg); 66 | } 67 | -------------------------------------------------------------------------------- /app/routes/auth.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.register = function(plugin, options, next) { 4 | 5 | const Controllers = { 6 | auth: { 7 | login: require('../controllers/auth/login'), 8 | signup: require('../controllers/auth/signup'), 9 | logout: require('../controllers/auth/logout') 10 | } 11 | }; 12 | 13 | plugin.route([ 14 | // Auth Routes 15 | { 16 | method: 'GET', 17 | path: '/', 18 | config: Controllers.auth.login.showForm 19 | }, { 20 | method: 'POST', 21 | path: '/', 22 | config: Controllers.auth.login.postForm 23 | }, { 24 | method: 'GET', 25 | path: '/login', 26 | config: Controllers.auth.login.showForm 27 | }, { 28 | method: 'POST', 29 | path: '/login', 30 | config: Controllers.auth.login.postForm 31 | }, { 32 | method: 'GET', 33 | path: '/signup', 34 | config: Controllers.auth.signup.showForm 35 | }, { 36 | method: 'POST', 37 | path: '/signup', 38 | config: Controllers.auth.signup.postForm 39 | }, { 40 | method: '*', 41 | path: '/logout', 42 | config: Controllers.auth.logout 43 | } 44 | ]); 45 | 46 | next(); 47 | }; 48 | 49 | exports.register.attributes = { 50 | name: 'auth_routes', 51 | version: require('../../package.json').version 52 | }; -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/_badges.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: $font-size-small; 12 | font-weight: $badge-font-weight; 13 | color: $badge-color; 14 | line-height: $badge-line-height; 15 | vertical-align: middle; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: $badge-bg; 19 | border-radius: $badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | 26 | // Quick fix for badges in buttons 27 | .btn & { 28 | position: relative; 29 | top: -1px; 30 | } 31 | 32 | .btn-xs &, 33 | .btn-group-xs > .btn & { 34 | top: 0; 35 | padding: 1px 5px; 36 | } 37 | 38 | // [converter] extracted a& to a.badge 39 | 40 | // Account for badges in navs 41 | .list-group-item.active > &, 42 | .nav-pills > .active > a > & { 43 | color: $badge-active-color; 44 | background-color: $badge-active-bg; 45 | } 46 | 47 | .list-group-item > & { 48 | float: right; 49 | } 50 | 51 | .list-group-item > & + & { 52 | margin-right: 5px; 53 | } 54 | 55 | .nav-pills > li > a > & { 56 | margin-left: 3px; 57 | } 58 | } 59 | 60 | // Hover state, but only for links 61 | a.badge { 62 | &:hover, 63 | &:focus { 64 | color: $badge-link-hover-color; 65 | text-decoration: none; 66 | cursor: pointer; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /db/models/error_Reports.js: -------------------------------------------------------------------------------- 1 | const Sequelize = require('sequelize'); 2 | 3 | /** * Request Schema */ 4 | module.exports = function(sequelize, DataTypes) { 5 | const errorReports = sequelize.define('Error_Reports', { 6 | id: { 7 | type: Sequelize.INTEGER, 8 | primaryKey: true, 9 | autoIncrement: true, 10 | allowNull: false 11 | }, 12 | user_id: { 13 | type: Sequelize.INTEGER, 14 | allowNull: true 15 | }, 16 | os_version: { 17 | type: Sequelize.STRING, 18 | allowNull: true 19 | }, 20 | release_version: { 21 | type: Sequelize.STRING, 22 | allowNull: true 23 | }, 24 | platform: { 25 | type: Sequelize.TEXT 26 | }, 27 | model: { 28 | type: Sequelize.TEXT 29 | }, 30 | error_id: { 31 | type: Sequelize.INTEGER, 32 | allowNull: true 33 | }, 34 | manufacturer: { 35 | type: Sequelize.STRING 36 | }, 37 | date: { 38 | type: Sequelize.DATE 39 | }, 40 | error_type: { 41 | type: Sequelize.STRING 42 | }, 43 | status:{ 44 | type: Sequelize.INTEGER, 45 | defaultValue: 1 46 | } 47 | }, { 48 | timestamps: true, 49 | }); 50 | 51 | errorReports.sync({ force: false }).then(() => { 52 | // Table created 53 | return true; 54 | }); 55 | return errorReports; 56 | }; -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/_code.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Code (inline and block) 3 | // -------------------------------------------------- 4 | 5 | 6 | // Inline and block code styles 7 | code, 8 | kbd, 9 | pre, 10 | samp { 11 | font-family: $font-family-monospace; 12 | } 13 | 14 | // Inline code 15 | code { 16 | padding: 2px 4px; 17 | font-size: 90%; 18 | color: $code-color; 19 | background-color: $code-bg; 20 | border-radius: $border-radius-base; 21 | } 22 | 23 | // User input typically entered via keyboard 24 | kbd { 25 | padding: 2px 4px; 26 | font-size: 90%; 27 | color: $kbd-color; 28 | background-color: $kbd-bg; 29 | border-radius: $border-radius-small; 30 | box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); 31 | 32 | kbd { 33 | padding: 0; 34 | font-size: 100%; 35 | font-weight: bold; 36 | box-shadow: none; 37 | } 38 | } 39 | 40 | // Blocks of code 41 | pre { 42 | display: block; 43 | padding: (($line-height-computed - 1) / 2); 44 | margin: 0 0 ($line-height-computed / 2); 45 | font-size: ($font-size-base - 1); // 14px to 13px 46 | line-height: $line-height-base; 47 | word-break: break-all; 48 | word-wrap: break-word; 49 | color: $pre-color; 50 | background-color: $pre-bg; 51 | border: 1px solid $pre-border-color; 52 | border-radius: $border-radius-base; 53 | 54 | // Account for some code outputs that place code tags in pre tags 55 | code { 56 | padding: 0; 57 | font-size: inherit; 58 | color: inherit; 59 | white-space: pre-wrap; 60 | background-color: transparent; 61 | border-radius: 0; 62 | } 63 | } 64 | 65 | // Enable scrollable blocks of code 66 | .pre-scrollable { 67 | max-height: $pre-scrollable-max-height; 68 | overflow-y: scroll; 69 | } 70 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/_bootstrap.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.7 (http://getbootstrap.com) 3 | * Copyright 2011-2016 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | // Core variables and mixins 8 | @import "bootstrap/variables"; 9 | @import "bootstrap/mixins"; 10 | 11 | // Reset and dependencies 12 | @import "bootstrap/normalize"; 13 | @import "bootstrap/print"; 14 | @import "bootstrap/glyphicons"; 15 | 16 | // Core CSS 17 | @import "bootstrap/scaffolding"; 18 | @import "bootstrap/type"; 19 | @import "bootstrap/code"; 20 | @import "bootstrap/grid"; 21 | @import "bootstrap/tables"; 22 | @import "bootstrap/forms"; 23 | @import "bootstrap/buttons"; 24 | 25 | // Components 26 | @import "bootstrap/component-animations"; 27 | @import "bootstrap/dropdowns"; 28 | @import "bootstrap/button-groups"; 29 | @import "bootstrap/input-groups"; 30 | @import "bootstrap/navs"; 31 | @import "bootstrap/navbar"; 32 | @import "bootstrap/breadcrumbs"; 33 | @import "bootstrap/pagination"; 34 | @import "bootstrap/pager"; 35 | @import "bootstrap/labels"; 36 | @import "bootstrap/badges"; 37 | @import "bootstrap/jumbotron"; 38 | @import "bootstrap/thumbnails"; 39 | @import "bootstrap/alerts"; 40 | @import "bootstrap/progress-bars"; 41 | @import "bootstrap/media"; 42 | @import "bootstrap/list-group"; 43 | @import "bootstrap/panels"; 44 | @import "bootstrap/responsive-embed"; 45 | @import "bootstrap/wells"; 46 | @import "bootstrap/close"; 47 | 48 | // Components w/ JavaScript 49 | @import "bootstrap/modals"; 50 | @import "bootstrap/tooltip"; 51 | @import "bootstrap/popovers"; 52 | @import "bootstrap/carousel"; 53 | 54 | // Utility classes 55 | @import "bootstrap/utilities"; 56 | @import "bootstrap/responsive-utilities"; 57 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_buttons.scss: -------------------------------------------------------------------------------- 1 | // Button variants 2 | // 3 | // Easily pump out default styles, as well as :hover, :focus, :active, 4 | // and disabled options for all buttons 5 | 6 | @mixin button-variant($color, $background, $border) { 7 | color: $color; 8 | background-color: $background; 9 | border-color: $border; 10 | 11 | &:focus, 12 | &.focus { 13 | color: $color; 14 | background-color: darken($background, 10%); 15 | border-color: darken($border, 25%); 16 | } 17 | &:hover { 18 | color: $color; 19 | background-color: darken($background, 10%); 20 | border-color: darken($border, 12%); 21 | } 22 | &:active, 23 | &.active, 24 | .open > &.dropdown-toggle { 25 | color: $color; 26 | background-color: darken($background, 10%); 27 | border-color: darken($border, 12%); 28 | 29 | &:hover, 30 | &:focus, 31 | &.focus { 32 | color: $color; 33 | background-color: darken($background, 17%); 34 | border-color: darken($border, 25%); 35 | } 36 | } 37 | &:active, 38 | &.active, 39 | .open > &.dropdown-toggle { 40 | background-image: none; 41 | } 42 | &.disabled, 43 | &[disabled], 44 | fieldset[disabled] & { 45 | &:hover, 46 | &:focus, 47 | &.focus { 48 | background-color: $background; 49 | border-color: $border; 50 | } 51 | } 52 | 53 | .badge { 54 | color: $background; 55 | background-color: $color; 56 | } 57 | } 58 | 59 | // Button sizes 60 | @mixin button-size($padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) { 61 | padding: $padding-vertical $padding-horizontal; 62 | font-size: $font-size; 63 | line-height: $line-height; 64 | border-radius: $border-radius; 65 | } 66 | -------------------------------------------------------------------------------- /app/templates/settings/setting.hbs: -------------------------------------------------------------------------------- 1 | {{> header}} 2 | {{> leftbar}} 3 | 4 |
5 |
6 |
7 | {{> flash}} 8 | 38 |
39 |
40 |
-------------------------------------------------------------------------------- /app/templates/dashboard/dashboard.hbs: -------------------------------------------------------------------------------- 1 |
2 | {{> header}} 3 | {{> leftbar}} 4 | 5 | 6 | 7 | 8 | 9 |
10 |
11 |
12 |
13 | 15 |
16 |
17 | 19 |
20 |
21 | 22 |
23 |
24 |
25 |
26 |
27 |
28 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 |
S.NoDescriptionBatch No.Amount
1abcd12345100.00
43 |
44 |
45 |
46 |
47 |
48 | 49 | 50 |
-------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/_grid.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Grid system 3 | // -------------------------------------------------- 4 | 5 | 6 | // Container widths 7 | // 8 | // Set the container width, and override it for fixed navbars in media queries. 9 | 10 | .container { 11 | @include container-fixed; 12 | 13 | @media (min-width: $screen-sm-min) { 14 | width: $container-sm; 15 | } 16 | @media (min-width: $screen-md-min) { 17 | width: $container-md; 18 | } 19 | @media (min-width: $screen-lg-min) { 20 | width: $container-lg; 21 | } 22 | } 23 | 24 | 25 | // Fluid container 26 | // 27 | // Utilizes the mixin meant for fixed width containers, but without any defined 28 | // width for fluid, full width layouts. 29 | 30 | .container-fluid { 31 | @include container-fixed; 32 | } 33 | 34 | 35 | // Row 36 | // 37 | // Rows contain and clear the floats of your columns. 38 | 39 | .row { 40 | @include make-row; 41 | } 42 | 43 | 44 | // Columns 45 | // 46 | // Common styles for small and large grid columns 47 | 48 | @include make-grid-columns; 49 | 50 | 51 | // Extra small grid 52 | // 53 | // Columns, offsets, pushes, and pulls for extra small devices like 54 | // smartphones. 55 | 56 | @include make-grid(xs); 57 | 58 | 59 | // Small grid 60 | // 61 | // Columns, offsets, pushes, and pulls for the small device range, from phones 62 | // to tablets. 63 | 64 | @media (min-width: $screen-sm-min) { 65 | @include make-grid(sm); 66 | } 67 | 68 | 69 | // Medium grid 70 | // 71 | // Columns, offsets, pushes, and pulls for the desktop device range. 72 | 73 | @media (min-width: $screen-md-min) { 74 | @include make-grid(md); 75 | } 76 | 77 | 78 | // Large grid 79 | // 80 | // Columns, offsets, pushes, and pulls for the large desktop device range. 81 | 82 | @media (min-width: $screen-lg-min) { 83 | @include make-grid(lg); 84 | } 85 | -------------------------------------------------------------------------------- /db/init/init.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE crashreporter; 2 | GRANT ALL PRIVILEGES ON crashreporter.* TO 'myuser'@'%' IDENTIFIED BY 'mysql'; 3 | GRANT ALL PRIVILEGES ON crashreporter.* TO 'myuser'@'localhost' IDENTIFIED BY 'mysql'; 4 | USE crashreporter; 5 | 6 | CREATE TABLE Web_App_Users ( 7 | user_id INT NOT NULL, 8 | password varchar(255) NOT NULL, 9 | name varchar(255) NOT NULL, 10 | email varchar(255) NOT NULL, 11 | dob varchar(12) DEFAULT NULL, 12 | image_url varchar(255) DEFAULT NULL, 13 | PRIMARY KEY (user_id) 14 | ); 15 | 16 | CREATE TABLE Crash_Error 17 | (error_id INTEGER NOT NULL auto_increment, 18 | error_msg TEXT NOT NULL, 19 | error_stacktrace VARCHAR(255) NOT NULL, 20 | created_at DATETIME NOT NULL, 21 | updated_at DATETIME NOT NULL, 22 | PRIMARY KEY (error_id)) ENGINE=InnoDB; 23 | 24 | CREATE TABLE Crash_Steps 25 | (step_id INTEGER NOT NULL auto_increment , 26 | method TEXT NOT NULL, 27 | class VARCHAR(255) NOT NULL, 28 | created_at DATETIME NOT NULL, 29 | updated_at DATETIME NOT NULL, 30 | PRIMARY KEY (step_id)) ENGINE=InnoDB; 31 | 32 | CREATE TABLE Error_Reports 33 | (id INTEGER NOT NULL auto_increment , 34 | user_id INTEGER, 35 | os_version VARCHAR(255), 36 | release_version VARCHAR(255), 37 | platform TEXT, 38 | model TEXT, 39 | error_id INTEGER, 40 | manufacturer VARCHAR(255), 41 | date DATETIME, 42 | error_type VARCHAR(255), 43 | status INTEGER DEFAULT 0, 44 | created_at DATETIME NOT NULL, 45 | updated_at DATETIME NOT NULL, 46 | PRIMARY KEY (id)) ENGINE=InnoDB; 47 | 48 | CREATE TABLE User_Crash_Steps 49 | (report_id INTEGER NOT NULL, 50 | step_id INTEGER NOT NULL, 51 | actionOn TEXT, 52 | date DATETIME, 53 | id INTEGER NOT NULL auto_increment , 54 | description TEXT, 55 | created_at DATETIME NOT NULL, 56 | updated_at DATETIME NOT NULL, 57 | PRIMARY KEY (id)) ENGINE=InnoDB; -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/_alerts.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Alerts 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // ------------------------- 8 | 9 | .alert { 10 | padding: $alert-padding; 11 | margin-bottom: $line-height-computed; 12 | border: 1px solid transparent; 13 | border-radius: $alert-border-radius; 14 | 15 | // Headings for larger alerts 16 | h4 { 17 | margin-top: 0; 18 | // Specified for the h4 to prevent conflicts of changing $headings-color 19 | color: inherit; 20 | } 21 | 22 | // Provide class for links that match alerts 23 | .alert-link { 24 | font-weight: $alert-link-font-weight; 25 | } 26 | 27 | // Improve alignment and spacing of inner content 28 | > p, 29 | > ul { 30 | margin-bottom: 0; 31 | } 32 | 33 | > p + p { 34 | margin-top: 5px; 35 | } 36 | } 37 | 38 | // Dismissible alerts 39 | // 40 | // Expand the right padding and account for the close button's positioning. 41 | 42 | .alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0. 43 | .alert-dismissible { 44 | padding-right: ($alert-padding + 20); 45 | 46 | // Adjust close link position 47 | .close { 48 | position: relative; 49 | top: -2px; 50 | right: -21px; 51 | color: inherit; 52 | } 53 | } 54 | 55 | // Alternate styles 56 | // 57 | // Generate contextual modifier classes for colorizing the alert. 58 | 59 | .alert-success { 60 | @include alert-variant($alert-success-bg, $alert-success-border, $alert-success-text); 61 | } 62 | 63 | .alert-info { 64 | @include alert-variant($alert-info-bg, $alert-info-border, $alert-info-text); 65 | } 66 | 67 | .alert-warning { 68 | @include alert-variant($alert-warning-bg, $alert-warning-border, $alert-warning-text); 69 | } 70 | 71 | .alert-danger { 72 | @include alert-variant($alert-danger-bg, $alert-danger-border, $alert-danger-text); 73 | } 74 | -------------------------------------------------------------------------------- /app/routes/core.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.register = function(plugin, options, next) { 4 | 5 | var Controllers = { 6 | core: { 7 | fallback: require('../controllers/core/fallback'), 8 | static: require('../controllers/core/static') 9 | } 10 | }; 11 | 12 | plugin.route([ 13 | 14 | // Static Routes 15 | { 16 | method: 'GET', 17 | path: '/css/{path*}', 18 | config: { 19 | auth: false 20 | }, 21 | handler: Controllers.core.static.css 22 | }, { 23 | method: 'GET', 24 | path: '/images/{path*}', 25 | config: { 26 | auth: false 27 | }, 28 | handler: Controllers.core.static.img 29 | }, { 30 | method: 'GET', 31 | path: '/js/{path*}', 32 | config: { 33 | auth: false 34 | }, 35 | handler: Controllers.core.static.js 36 | }, { 37 | method: 'GET', 38 | path: '/fonts/{path*}', 39 | config: { 40 | auth: false 41 | }, 42 | handler: Controllers.core.static.fonts 43 | }, { 44 | method: 'GET', 45 | path: '/favicon.ico', 46 | config: { 47 | auth: false 48 | }, 49 | handler: Controllers.core.static.favicon 50 | }, { 51 | method: 'GET', 52 | path: '/heartbeat', 53 | config: Controllers.core.static.heartbeat 54 | }, { 55 | method: '*', 56 | path: '/{p*}', 57 | config: Controllers.core.fallback.notfound 58 | } 59 | 60 | ]); 61 | 62 | next(); 63 | }; 64 | 65 | exports.register.attributes = { 66 | name: 'core_routes', 67 | version: require('../../package.json').version 68 | }; -------------------------------------------------------------------------------- /app/templates/dashboard/alias.hbs: -------------------------------------------------------------------------------- 1 | {{> header}} 2 | {{> leftbar}} 3 | 4 |
5 |
6 |
7 | 8 |
9 |
10 |
11 | 12 | -------------------------------------------------------------------------------- /app/templates/users/manageUsers.hbs: -------------------------------------------------------------------------------- 1 | {{> header}} 2 | {{> leftbar}} 3 | 4 |
5 |
6 | 7 |
8 |
9 |
10 |
11 | {{> flash}} 12 | {{#if jsonarr.length}} 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | {{#each jsonarr}} 23 | 24 | 25 | 26 | 27 | 28 | {{#if_eq status '===' 'Approved'}} 29 | 30 | {{else}} 31 | 32 | {{/if_eq}} 33 | 34 | {{/each}} 35 | 36 | 37 |
S NoUser IdEmailNameAction
{{addOne @key}}{{user_id}}{{email}}{{name}}
38 | {{/if}} 39 |
40 |
41 |
42 |
43 |
44 | -------------------------------------------------------------------------------- /assets/scripts/js/main.js: -------------------------------------------------------------------------------- 1 | if (window.location.pathname === '/' ) { 2 | $( 'body' ).addClass( 'login-bg' ); 3 | } 4 | if (window.location.pathname === '/login' ) { 5 | $( 'body' ).addClass( 'login-bg' ); 6 | } 7 | if (window.location.pathname === '/signup' ) { 8 | $( 'body' ).addClass( 'login-bg' ); 9 | } 10 | if (window.location.pathname === '/dashboard' ) { 11 | $( 'body' ).removeClass( 'login-bg' ); 12 | } 13 | 14 | $('.user_profile_detail .edit_user').click(function(){ 15 | $('.edit_user').addClass('disabled'); 16 | $('.after_edit').hide(); 17 | $('.user_profile_detail .details input[type=\'text\']').show(); 18 | $('.user_profile_detail .details input[type=\'submit\'].action_btn').show(); 19 | $('.user_profile_detail .details .col-md-2.pad-lft-none').addClass('pad-top-6'); 20 | $('.calendar_icon img').show(); 21 | }); 22 | 23 | $('.user_profile_detail .action_btn').click(function(){ 24 | $('.edit_user').removeClass('disabled'); 25 | $('.after_edit').show(); 26 | $('.user_profile_detail .details input[type=\'text\']').hide(); 27 | $('.user_profile_detail .details input[type=\'submit\'].action_btn').hide(); 28 | $('.user_profile_detail .details .col-md-2.pad-lft-none').removeClass('pad-top-6'); 29 | $('.calendar_icon img').hide(); 30 | }); 31 | 32 | $('.form_date').datetimepicker({ 33 | language: 'fr', 34 | weekStart: 1, 35 | todayBtn: 1, 36 | autoclose: 1, 37 | todayHighlight: 1, 38 | startView: 2, 39 | minView: 2, 40 | forceParse: 0 41 | }); 42 | 43 | 44 | $('.message.message--success').fadeIn().delay(3000).fadeOut(); 45 | $('.message.message--error').fadeIn().delay(3000).fadeOut(); 46 | 47 | 48 | $('.profile_msg .message.message--success').css('display','inline-block').delay(3000).fadeOut(); 49 | $('.profile_msg .message.message--error').css('display','inline-block').delay(3000).fadeOut(); 50 | 51 | 52 | $('.input_calendar').click(function(){ 53 | $('.datetimepicker-dropdown-bottom-right').show(); 54 | $('.datetimepicker-dropdown-bottom-right').css('left', '425.5px'); 55 | $('.datetimepicker-dropdown-bottom-right').css('top', '288px'); 56 | }); 57 | 58 | $( window ).resize(function() { 59 | var side = $('#sidebar-wrapper').height() - 190; 60 | $('.block_scroll').height(side); 61 | }); 62 | 63 | var side = $('#sidebar-wrapper').height() - 190; 64 | $('.block_scroll').height(side); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "crash-reporter", 3 | "version": "2.0.0", 4 | "description": "Crash Reporter Application", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "gulp prod", 8 | "dev": "NODE_ENV=development gulp dev" 9 | }, 10 | "keywords": [ 11 | "HapiJS" 12 | ], 13 | "author": "systango", 14 | "homepage": "", 15 | "dependencies": { 16 | "apn": "^2.1.4", 17 | "babel-core": "^6.7.7", 18 | "babel-loader": "^6.2.4", 19 | "babel-preset-es2015": "^6.6.0", 20 | "babel-preset-react": "^6.5.0", 21 | "bootstrap": "^3.3.7", 22 | "confidence": "^3.0.1", 23 | "crumb": "^6.0.0", 24 | "dotenv": "^2.0.0", 25 | "forever-monitor": "^1.7.1", 26 | "fs": "0.0.1-security", 27 | "glob": "^7.0.6", 28 | "glue": "^4.0.0", 29 | "good": "^7.1.0", 30 | "good-console": "^6.2.0", 31 | "good-file": "^6.0.1", 32 | "good-http": "^6.1.1", 33 | "good-squeeze": "^5.0.1", 34 | "gulp": "^3.9.1", 35 | "gulp-autoprefixer": "^3.1.0", 36 | "gulp-eslint": "^3.0.1", 37 | "gulp-nodemon": "^2.0.6", 38 | "gulp-rev-all": "^0.8.24", 39 | "gulp-sass": "^4.0.1", 40 | "gulp-util": "^3.0.7", 41 | "handlebars": "^4.0.5", 42 | "hapi": "^15.0.3", 43 | "hapi-auth-cookie": "^6.1.1", 44 | "hapi-auth-jwt2": "^7.2.4", 45 | "hapi-context-credentials": "^2.0.0", 46 | "hapi-mysql-routes-plugin": "^1.1.0", 47 | "hapi-swagger": "^7.10.0", 48 | "hoek": "^4.0.2", 49 | "inert": "^4.0.2", 50 | "joi": "^9.2.0", 51 | "jquery": "^3.1.0", 52 | "latest-version": "^4.0.0", 53 | "moment": "^2.22.2", 54 | "moment-timezone": "^0.5.13", 55 | "mysql": "^2.12.0", 56 | "mysql2": "^1.6.1", 57 | "node-gcm": "^0.14.4", 58 | "node-schedule": "^1.3.0", 59 | "nodemailer": "^4.0.0", 60 | "nodemailer-smtp-transport": "^2.7.4", 61 | "promise": "^8.0.1", 62 | "request": "^2.87.0", 63 | "require-dir": "^0.3.0", 64 | "sequelize": "^4.38.0", 65 | "sys": "0.0.1", 66 | "vision": "^4.0.1", 67 | "visionary": "^6.0.2", 68 | "webpack": "^1.12.14", 69 | "xml2js": "^0.4.17", 70 | "yar": "^8.0.0" 71 | }, 72 | "devDependencies": { 73 | "d3": "^4.2.2", 74 | "del": "^2.2.0", 75 | "eslint-plugin-react": "^6.2.0", 76 | "ify-loader": "^1.0.3", 77 | "react": "^15.0.1", 78 | "react-dom": "^15.0.1" 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/_progress-bars.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Progress bars 3 | // -------------------------------------------------- 4 | 5 | 6 | // Bar animations 7 | // ------------------------- 8 | 9 | // WebKit 10 | @-webkit-keyframes progress-bar-stripes { 11 | from { background-position: 40px 0; } 12 | to { background-position: 0 0; } 13 | } 14 | 15 | // Spec and IE10+ 16 | @keyframes progress-bar-stripes { 17 | from { background-position: 40px 0; } 18 | to { background-position: 0 0; } 19 | } 20 | 21 | 22 | // Bar itself 23 | // ------------------------- 24 | 25 | // Outer container 26 | .progress { 27 | overflow: hidden; 28 | height: $line-height-computed; 29 | margin-bottom: $line-height-computed; 30 | background-color: $progress-bg; 31 | border-radius: $progress-border-radius; 32 | @include box-shadow(inset 0 1px 2px rgba(0,0,0,.1)); 33 | } 34 | 35 | // Bar of progress 36 | .progress-bar { 37 | float: left; 38 | width: 0%; 39 | height: 100%; 40 | font-size: $font-size-small; 41 | line-height: $line-height-computed; 42 | color: $progress-bar-color; 43 | text-align: center; 44 | background-color: $progress-bar-bg; 45 | @include box-shadow(inset 0 -1px 0 rgba(0,0,0,.15)); 46 | @include transition(width .6s ease); 47 | } 48 | 49 | // Striped bars 50 | // 51 | // `.progress-striped .progress-bar` is deprecated as of v3.2.0 in favor of the 52 | // `.progress-bar-striped` class, which you just add to an existing 53 | // `.progress-bar`. 54 | .progress-striped .progress-bar, 55 | .progress-bar-striped { 56 | @include gradient-striped; 57 | background-size: 40px 40px; 58 | } 59 | 60 | // Call animation for the active one 61 | // 62 | // `.progress.active .progress-bar` is deprecated as of v3.2.0 in favor of the 63 | // `.progress-bar.active` approach. 64 | .progress.active .progress-bar, 65 | .progress-bar.active { 66 | @include animation(progress-bar-stripes 2s linear infinite); 67 | } 68 | 69 | 70 | // Variations 71 | // ------------------------- 72 | 73 | .progress-bar-success { 74 | @include progress-bar-variant($progress-bar-success-bg); 75 | } 76 | 77 | .progress-bar-info { 78 | @include progress-bar-variant($progress-bar-info-bg); 79 | } 80 | 81 | .progress-bar-warning { 82 | @include progress-bar-variant($progress-bar-warning-bg); 83 | } 84 | 85 | .progress-bar-danger { 86 | @include progress-bar-variant($progress-bar-danger-bg); 87 | } 88 | -------------------------------------------------------------------------------- /config/config.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const Confidence = require('confidence'); 3 | // Confidence criteria 4 | let internals = { 5 | criteria: { 6 | env: process.env.NODE_ENV 7 | } 8 | }; 9 | // Confidence document object 10 | internals.config = { 11 | $meta: 'App configuration file', 12 | port: { 13 | web: { 14 | $filter: 'env', 15 | production: process.env.WEB_PORT, 16 | $default: 8000 17 | } 18 | }, 19 | baseUrl: { 20 | $filter: 'env', 21 | $meta: 'values should not end in "/"', 22 | production: 'https://example.com', 23 | $default: 'http://127.0.0.1:8000' 24 | }, 25 | mysql: { 26 | $filter: 'env', 27 | production: { 28 | host: process.env.DB_HOST || 'localhost', 29 | user: process.env.DB_USER || 'myuser', 30 | password: process.env.DB_PASSWORD || 'mysql', 31 | database: process.env.DB_NAME || 'crashreporter', 32 | port: process.env.DB_PORT|| 3306, 33 | connectionLimit: process.env.DB_CONNECTION_LIMIT || 10 34 | }, 35 | $default: { 36 | host: 'localhost', 37 | user: 'root', 38 | password: 'root', 39 | database: 'report', 40 | port: 3306, 41 | connectionLimit: 10, 42 | options: {} 43 | } 44 | }, 45 | authCookie: { 46 | cookieSecret: process.env.COOKIE_SECRET, 47 | cookieName: 'Basic-auth' 48 | }, 49 | yarCookie: { 50 | storeBlank: false, 51 | cookieOptions: { 52 | password: process.env.YAR_COOKIE_SECRET, 53 | isSecure: false 54 | } 55 | }, 56 | good: { 57 | ops: { 58 | interval: 1000 59 | }, 60 | reporters: { 61 | myConsoleReporter: [{ 62 | module: 'good-squeeze', 63 | name: 'Squeeze', 64 | args: [{ 65 | log: '*', 66 | response: '*' 67 | }] 68 | }, { 69 | module: 'good-console' 70 | }, 'stdout'] 71 | } 72 | } 73 | }; 74 | internals.store = new Confidence.Store(internals.config); 75 | exports.get = function(key) { 76 | return internals.store.get(key, internals.criteria); 77 | }; 78 | exports.meta = function(key) { 79 | return internals.store.meta(key, internals.criteria); 80 | }; 81 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/_pagination.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Pagination (multiple pages) 3 | // -------------------------------------------------- 4 | .pagination { 5 | display: inline-block; 6 | padding-left: 0; 7 | margin: $line-height-computed 0; 8 | border-radius: $border-radius-base; 9 | 10 | > li { 11 | display: inline; // Remove list-style and block-level defaults 12 | > a, 13 | > span { 14 | position: relative; 15 | float: left; // Collapse white-space 16 | padding: $padding-base-vertical $padding-base-horizontal; 17 | line-height: $line-height-base; 18 | text-decoration: none; 19 | color: $pagination-color; 20 | background-color: $pagination-bg; 21 | border: 1px solid $pagination-border; 22 | margin-left: -1px; 23 | } 24 | &:first-child { 25 | > a, 26 | > span { 27 | margin-left: 0; 28 | @include border-left-radius($border-radius-base); 29 | } 30 | } 31 | &:last-child { 32 | > a, 33 | > span { 34 | @include border-right-radius($border-radius-base); 35 | } 36 | } 37 | } 38 | 39 | > li > a, 40 | > li > span { 41 | &:hover, 42 | &:focus { 43 | z-index: 2; 44 | color: $pagination-hover-color; 45 | background-color: $pagination-hover-bg; 46 | border-color: $pagination-hover-border; 47 | } 48 | } 49 | 50 | > .active > a, 51 | > .active > span { 52 | &, 53 | &:hover, 54 | &:focus { 55 | z-index: 3; 56 | color: $pagination-active-color; 57 | background-color: $pagination-active-bg; 58 | border-color: $pagination-active-border; 59 | cursor: default; 60 | } 61 | } 62 | 63 | > .disabled { 64 | > span, 65 | > span:hover, 66 | > span:focus, 67 | > a, 68 | > a:hover, 69 | > a:focus { 70 | color: $pagination-disabled-color; 71 | background-color: $pagination-disabled-bg; 72 | border-color: $pagination-disabled-border; 73 | cursor: $cursor-disabled; 74 | } 75 | } 76 | } 77 | 78 | // Sizing 79 | // -------------------------------------------------- 80 | 81 | // Large 82 | .pagination-lg { 83 | @include pagination-size($padding-large-vertical, $padding-large-horizontal, $font-size-large, $line-height-large, $border-radius-large); 84 | } 85 | 86 | // Small 87 | .pagination-sm { 88 | @include pagination-size($padding-small-vertical, $padding-small-horizontal, $font-size-small, $line-height-small, $border-radius-small); 89 | } 90 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/_print.scss: -------------------------------------------------------------------------------- 1 | /*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ 2 | 3 | // ========================================================================== 4 | // Print styles. 5 | // Inlined to avoid the additional HTTP request: h5bp.com/r 6 | // ========================================================================== 7 | 8 | @media print { 9 | *, 10 | *:before, 11 | *:after { 12 | background: transparent !important; 13 | color: #000 !important; // Black prints faster: h5bp.com/s 14 | box-shadow: none !important; 15 | text-shadow: none !important; 16 | } 17 | 18 | a, 19 | a:visited { 20 | text-decoration: underline; 21 | } 22 | 23 | a[href]:after { 24 | content: " (" attr(href) ")"; 25 | } 26 | 27 | abbr[title]:after { 28 | content: " (" attr(title) ")"; 29 | } 30 | 31 | // Don't show links that are fragment identifiers, 32 | // or use the `javascript:` pseudo protocol 33 | a[href^="#"]:after, 34 | a[href^="javascript:"]:after { 35 | content: ""; 36 | } 37 | 38 | pre, 39 | blockquote { 40 | border: 1px solid #999; 41 | page-break-inside: avoid; 42 | } 43 | 44 | thead { 45 | display: table-header-group; // h5bp.com/t 46 | } 47 | 48 | tr, 49 | img { 50 | page-break-inside: avoid; 51 | } 52 | 53 | img { 54 | max-width: 100% !important; 55 | } 56 | 57 | p, 58 | h2, 59 | h3 { 60 | orphans: 3; 61 | widows: 3; 62 | } 63 | 64 | h2, 65 | h3 { 66 | page-break-after: avoid; 67 | } 68 | 69 | // Bootstrap specific changes start 70 | 71 | // Bootstrap components 72 | .navbar { 73 | display: none; 74 | } 75 | .btn, 76 | .dropup > .btn { 77 | > .caret { 78 | border-top-color: #000 !important; 79 | } 80 | } 81 | .label { 82 | border: 1px solid #000; 83 | } 84 | 85 | .table { 86 | border-collapse: collapse !important; 87 | 88 | td, 89 | th { 90 | background-color: #fff !important; 91 | } 92 | } 93 | .table-bordered { 94 | th, 95 | td { 96 | border: 1px solid #ddd !important; 97 | } 98 | } 99 | 100 | // Bootstrap specific changes end 101 | } 102 | -------------------------------------------------------------------------------- /assets/styles/modules/menu.scss: -------------------------------------------------------------------------------- 1 | // Menu 2 | $menu__border: 0; 3 | $menuItem__background: transparent; 4 | $menu__height: $eleHeight--base; 5 | $menuItem__padding: 0 30px; 6 | $menuItem__transition: opacity .1s ease; 7 | $menu__color: $color__foreground--light; 8 | $menu__color-hover: $color__foreground--dark; 9 | $menu__color-active: $color__foreground--darker; 10 | $menu__borderColor: $color__foreground--lightest; 11 | $menu__borderColor-hover: $color__foreground--lighter; 12 | // $menu__font-size: $text-sm; 13 | 14 | /* Default Menu 15 | ––––––––––––––––––––––––––––––––––––––––––––––––––*/ 16 | 17 | .menu { 18 | display: block; 19 | border: $menu__border; 20 | margin: 0 0 $spacing--base 0 21 | } 22 | .menu-item { 23 | line-height: $eleHeight--base; 24 | position: relative; 25 | display: inline-block; 26 | height: $eleHeight--base; 27 | padding: $menuItem__padding; 28 | user-select: none; 29 | transition: $menuItem__transition; 30 | text-decoration: none; 31 | color: $menu__color; 32 | background: $menuItem__background; 33 | -webkit-tap-highlight-color: transparent; 34 | margin: 0; 35 | } 36 | .menu-item:hover, 37 | .menu-item:focus { 38 | color: $menu__color-hover; 39 | } 40 | .menu-item.active, 41 | .menu-item.active:hover, 42 | .menu-item.active:focus { 43 | font-weight: normal; 44 | color: $menu__color-active; 45 | } 46 | 47 | /* Pointing Menu 48 | ––––––––––––––––––––––––––––––––––––––––––––––––––*/ 49 | 50 | .menu.menu--pointing .menu-item { 51 | border-bottom: solid 2px transparent; 52 | } 53 | .menu.menu--pointing .menu-item.active { 54 | border-bottom: solid 2px $menu__color-active; 55 | } 56 | .menu.menu--pointing-right .menu-item { 57 | border-right: solid 1px transparent; 58 | } 59 | .menu.menu--pointing-right .menu-item.active { 60 | border-right: solid 2px $menu__color-active; 61 | } 62 | 63 | /* Vertical Menu 64 | ––––––––––––––––––––––––––––––––––––––––––––––––––*/ 65 | 66 | .menu.menu--vertical .menu-item { 67 | display: block; 68 | } 69 | 70 | /* Bordered Menu 71 | ––––––––––––––––––––––––––––––––––––––––––––––––––*/ 72 | 73 | .menu.menu--borderBottom { 74 | border-bottom: solid 1px $menu__borderColor; 75 | } 76 | .menu.menu--borderRight { 77 | border-right: solid 1px $menu__borderColor; 78 | } 79 | 80 | /* Wide Menu 81 | ––––––––––––––––––––––––––––––––––––––––––––––––––*/ 82 | 83 | .menu.menu--wide .menu-item { 84 | height: $menu__height+8; 85 | line-height: $menu__height+8; 86 | padding: $menuItem__padding; 87 | } 88 | 89 | /* Menu Sizing 90 | ––––––––––––––––––––––––––––––––––––––––––––––––––*/ 91 | .menu--width-noraml{ 92 | width: 18rem; 93 | } 94 | 95 | 96 | -------------------------------------------------------------------------------- /tasks/webpack.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const Gulp = require('gulp'); 3 | const Gutil = require('gulp-util'); 4 | const Webpack = require('webpack'); 5 | 6 | var webpackConfig = { 7 | entry: { 8 | vendor: ['jquery','bootstrap'], 9 | app: './assets/scripts/index.js' 10 | }, 11 | output: { 12 | path: '.build/js/', 13 | filename: 'bundle.js' 14 | }, 15 | cache: true, 16 | debug: false, 17 | devtool: 'cheap-module-source-map', 18 | module: { 19 | loaders: [{ 20 | test: /\.jsx?$/, 21 | loader: 'babel', 22 | query: { compact: false }, 23 | exclude: /(node_modules|bower_components)/ 24 | }] 25 | }, 26 | plugins: [ 27 | new Webpack.optimize.CommonsChunkPlugin({ 28 | name: 'vendor', 29 | filename: 'vendor.js', 30 | minChunks: 2 31 | }), 32 | new Webpack.ProvidePlugin({ 33 | $: 'jquery', 34 | jQuery: 'jquery', 35 | 'window.jQuery': 'jquery', 36 | 'root.jQuery': 'jquery' 37 | }) 38 | ] 39 | }; 40 | 41 | // Webpack production build 42 | Gulp.task('webpack:build', function() { 43 | 44 | var prodConfig = Object.create(webpackConfig); 45 | 46 | prodConfig.plugins = prodConfig.plugins.concat( 47 | new Webpack.DefinePlugin({ 48 | 'process.env': { 49 | // This has effect on the react and other lib size 50 | 'NODE_ENV': JSON.stringify('production') 51 | } 52 | }), 53 | new Webpack.optimize.DedupePlugin(), 54 | new Webpack.optimize.UglifyJsPlugin({ 55 | compress: { 56 | warnings: false 57 | } 58 | }) 59 | ); 60 | 61 | Webpack(prodConfig, function(err, stats) { 62 | 63 | if (err) { 64 | throw new Gutil.PluginError('webpack', err); 65 | } 66 | Gutil.log('[webpack]', stats.toString({ 67 | colors: true 68 | })); 69 | }); 70 | }); 71 | 72 | 73 | // Set dev config for webpack 74 | var devConfig = Object.create(webpackConfig); 75 | devConfig.devtool = 'sourcemap'; 76 | devConfig.debug = true; 77 | 78 | // Create a single instance of the compiler to allow caching 79 | var devCompiler = Webpack(devConfig); 80 | 81 | Gulp.task('webpack:dev-build', function() { 82 | 83 | devCompiler.watch({}, function(err, stats) { 84 | if (err) { 85 | throw new Gutil.PluginError('webpack', err); 86 | } 87 | Gutil.log('[webpack:build-dev]', stats.toString({ 88 | colors: true, 89 | chunks: false 90 | })); 91 | }); 92 | }); 93 | 94 | -------------------------------------------------------------------------------- /app/controllers/users/manageUsers.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const mysql = require('../../../lib/mysql'); 3 | exports.showUsers = { 4 | description: 'Returns the Users', 5 | handler: function(request, reply) { 6 | getUsers(request, reply); 7 | }, 8 | tags: ['api'] //swagger documentation 9 | }; 10 | 11 | function getUsers(request, reply) { 12 | mysql.getConnection(function(err, connection) { 13 | if (err) { 14 | connection.release(); 15 | request.yar.flash('error', 'An internal server error occurred'); 16 | return reply.redirect('/users'); 17 | } 18 | connection.query('SELECT user_id,email,name,if(is_approved=1,"Approved","Disapproved") as status from Web_App_Users where role="USER"', function(err, rows) { 19 | if (err) { 20 | request.yar.flash('error', 'An internal server error occurred'); 21 | return reply.redirect('/users'); 22 | } 23 | if (rows.length) { 24 | reply.view('users/manageUsers', { 25 | jsonarr: rows 26 | }); 27 | } else { 28 | request.yar.flash('error', 'No records found'); 29 | reply.view('users/manageUsers', { 30 | jsonarr: rows 31 | }); 32 | } 33 | }); 34 | connection.release(); 35 | }); 36 | } 37 | exports.changeUserStatus = { 38 | description: 'Change the User Approvel', 39 | handler: function(request, reply) { 40 | var email = request.params.email; 41 | var status = request.params.currentStatus; 42 | var newStatus = 1; 43 | var newstat = 'Activated'; 44 | if (status === 'Approved') { 45 | newStatus = 0; 46 | newstat = 'De-activated'; 47 | } 48 | mysql.getConnection(function(err, connection) { 49 | if (err) { 50 | connection.release(); 51 | request.yar.flash('error', 'An internal server error occurred'); 52 | return reply.redirect('/users'); 53 | } 54 | connection.query('update Web_App_Users set is_approved=? where email=?', [newStatus, email], function(err, rows) { 55 | if (err) { 56 | request.yar.flash('error', 'An internal server error occurred'); 57 | return reply.redirect('/users'); 58 | } 59 | request.yar.flash('success', 'User account ' + ' has been ' + newstat); 60 | reply.redirect('/users'); 61 | }); 62 | connection.release(); 63 | }); 64 | }, 65 | tags: ['api'] //swagger documentation 66 | }; -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_grid-framework.scss: -------------------------------------------------------------------------------- 1 | // Framework grid generation 2 | // 3 | // Used only by Bootstrap to generate the correct number of grid classes given 4 | // any value of `$grid-columns`. 5 | 6 | // [converter] This is defined recursively in LESS, but Sass supports real loops 7 | @mixin make-grid-columns($i: 1, $list: ".col-xs-#{$i}, .col-sm-#{$i}, .col-md-#{$i}, .col-lg-#{$i}") { 8 | @for $i from (1 + 1) through $grid-columns { 9 | $list: "#{$list}, .col-xs-#{$i}, .col-sm-#{$i}, .col-md-#{$i}, .col-lg-#{$i}"; 10 | } 11 | #{$list} { 12 | position: relative; 13 | // Prevent columns from collapsing when empty 14 | min-height: 1px; 15 | // Inner gutter via padding 16 | padding-left: ceil(($grid-gutter-width / 2)); 17 | padding-right: floor(($grid-gutter-width / 2)); 18 | } 19 | } 20 | 21 | 22 | // [converter] This is defined recursively in LESS, but Sass supports real loops 23 | @mixin float-grid-columns($class, $i: 1, $list: ".col-#{$class}-#{$i}") { 24 | @for $i from (1 + 1) through $grid-columns { 25 | $list: "#{$list}, .col-#{$class}-#{$i}"; 26 | } 27 | #{$list} { 28 | float: left; 29 | } 30 | } 31 | 32 | 33 | @mixin calc-grid-column($index, $class, $type) { 34 | @if ($type == width) and ($index > 0) { 35 | .col-#{$class}-#{$index} { 36 | width: percentage(($index / $grid-columns)); 37 | } 38 | } 39 | @if ($type == push) and ($index > 0) { 40 | .col-#{$class}-push-#{$index} { 41 | left: percentage(($index / $grid-columns)); 42 | } 43 | } 44 | @if ($type == push) and ($index == 0) { 45 | .col-#{$class}-push-0 { 46 | left: auto; 47 | } 48 | } 49 | @if ($type == pull) and ($index > 0) { 50 | .col-#{$class}-pull-#{$index} { 51 | right: percentage(($index / $grid-columns)); 52 | } 53 | } 54 | @if ($type == pull) and ($index == 0) { 55 | .col-#{$class}-pull-0 { 56 | right: auto; 57 | } 58 | } 59 | @if ($type == offset) { 60 | .col-#{$class}-offset-#{$index} { 61 | margin-left: percentage(($index / $grid-columns)); 62 | } 63 | } 64 | } 65 | 66 | // [converter] This is defined recursively in LESS, but Sass supports real loops 67 | @mixin loop-grid-columns($columns, $class, $type) { 68 | @for $i from 0 through $columns { 69 | @include calc-grid-column($i, $class, $type); 70 | } 71 | } 72 | 73 | 74 | // Create grid for specific class 75 | @mixin make-grid($class) { 76 | @include float-grid-columns($class); 77 | @include loop-grid-columns($grid-columns, $class, width); 78 | @include loop-grid-columns($grid-columns, $class, pull); 79 | @include loop-grid-columns($grid-columns, $class, push); 80 | @include loop-grid-columns($grid-columns, $class, offset); 81 | } 82 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_forms.scss: -------------------------------------------------------------------------------- 1 | // Form validation states 2 | // 3 | // Used in forms.less to generate the form validation CSS for warnings, errors, 4 | // and successes. 5 | 6 | @mixin form-control-validation($text-color: #555, $border-color: #ccc, $background-color: #f5f5f5) { 7 | // Color the label and help text 8 | .help-block, 9 | .control-label, 10 | .radio, 11 | .checkbox, 12 | .radio-inline, 13 | .checkbox-inline, 14 | &.radio label, 15 | &.checkbox label, 16 | &.radio-inline label, 17 | &.checkbox-inline label { 18 | color: $text-color; 19 | } 20 | // Set the border and box shadow on specific inputs to match 21 | .form-control { 22 | border-color: $border-color; 23 | @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work 24 | &:focus { 25 | border-color: darken($border-color, 10%); 26 | $shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten($border-color, 20%); 27 | @include box-shadow($shadow); 28 | } 29 | } 30 | // Set validation states also for addons 31 | .input-group-addon { 32 | color: $text-color; 33 | border-color: $border-color; 34 | background-color: $background-color; 35 | } 36 | // Optional feedback icon 37 | .form-control-feedback { 38 | color: $text-color; 39 | } 40 | } 41 | 42 | 43 | // Form control focus state 44 | // 45 | // Generate a customized focus state and for any input with the specified color, 46 | // which defaults to the `$input-border-focus` variable. 47 | // 48 | // We highly encourage you to not customize the default value, but instead use 49 | // this to tweak colors on an as-needed basis. This aesthetic change is based on 50 | // WebKit's default styles, but applicable to a wider range of browsers. Its 51 | // usability and accessibility should be taken into account with any change. 52 | // 53 | // Example usage: change the default blue border and shadow to white for better 54 | // contrast against a dark gray background. 55 | @mixin form-control-focus($color: $input-border-focus) { 56 | $color-rgba: rgba(red($color), green($color), blue($color), .6); 57 | &:focus { 58 | border-color: $color; 59 | outline: 0; 60 | @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px $color-rgba); 61 | } 62 | } 63 | 64 | // Form control sizing 65 | // 66 | // Relative text size, padding, and border-radii changes for form controls. For 67 | // horizontal sizing, wrap controls in the predefined grid classes. ` 11 |
Edit Delete User 12 |
13 | {{> form_security}} 14 | 15 |
16 |
17 |
Email:
18 |
{{user.email}}
19 |
20 | 21 |
Name:
22 |
23 | {{user.name}} 24 |
25 |
26 | 27 | 28 |
DOB:
29 |
30 | {{user.dob}} 31 |
32 | 33 | 34 |
35 |
36 | 37 |
38 | 39 |
40 |
41 |
42 | {{> form_security}} 43 |
44 |
45 | 46 | 47 | 48 |
49 | {{> flash}} 50 |
51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/_tooltip.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Tooltips 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .tooltip { 8 | position: absolute; 9 | z-index: $zindex-tooltip; 10 | display: block; 11 | // Our parent element can be arbitrary since tooltips are by default inserted as a sibling of their target element. 12 | // So reset our font and text properties to avoid inheriting weird values. 13 | @include reset-text; 14 | font-size: $font-size-small; 15 | 16 | @include opacity(0); 17 | 18 | &.in { @include opacity($tooltip-opacity); } 19 | &.top { margin-top: -3px; padding: $tooltip-arrow-width 0; } 20 | &.right { margin-left: 3px; padding: 0 $tooltip-arrow-width; } 21 | &.bottom { margin-top: 3px; padding: $tooltip-arrow-width 0; } 22 | &.left { margin-left: -3px; padding: 0 $tooltip-arrow-width; } 23 | } 24 | 25 | // Wrapper for the tooltip content 26 | .tooltip-inner { 27 | max-width: $tooltip-max-width; 28 | padding: 3px 8px; 29 | color: $tooltip-color; 30 | text-align: center; 31 | background-color: $tooltip-bg; 32 | border-radius: $border-radius-base; 33 | } 34 | 35 | // Arrows 36 | .tooltip-arrow { 37 | position: absolute; 38 | width: 0; 39 | height: 0; 40 | border-color: transparent; 41 | border-style: solid; 42 | } 43 | // Note: Deprecated .top-left, .top-right, .bottom-left, and .bottom-right as of v3.3.1 44 | .tooltip { 45 | &.top .tooltip-arrow { 46 | bottom: 0; 47 | left: 50%; 48 | margin-left: -$tooltip-arrow-width; 49 | border-width: $tooltip-arrow-width $tooltip-arrow-width 0; 50 | border-top-color: $tooltip-arrow-color; 51 | } 52 | &.top-left .tooltip-arrow { 53 | bottom: 0; 54 | right: $tooltip-arrow-width; 55 | margin-bottom: -$tooltip-arrow-width; 56 | border-width: $tooltip-arrow-width $tooltip-arrow-width 0; 57 | border-top-color: $tooltip-arrow-color; 58 | } 59 | &.top-right .tooltip-arrow { 60 | bottom: 0; 61 | left: $tooltip-arrow-width; 62 | margin-bottom: -$tooltip-arrow-width; 63 | border-width: $tooltip-arrow-width $tooltip-arrow-width 0; 64 | border-top-color: $tooltip-arrow-color; 65 | } 66 | &.right .tooltip-arrow { 67 | top: 50%; 68 | left: 0; 69 | margin-top: -$tooltip-arrow-width; 70 | border-width: $tooltip-arrow-width $tooltip-arrow-width $tooltip-arrow-width 0; 71 | border-right-color: $tooltip-arrow-color; 72 | } 73 | &.left .tooltip-arrow { 74 | top: 50%; 75 | right: 0; 76 | margin-top: -$tooltip-arrow-width; 77 | border-width: $tooltip-arrow-width 0 $tooltip-arrow-width $tooltip-arrow-width; 78 | border-left-color: $tooltip-arrow-color; 79 | } 80 | &.bottom .tooltip-arrow { 81 | top: 0; 82 | left: 50%; 83 | margin-left: -$tooltip-arrow-width; 84 | border-width: 0 $tooltip-arrow-width $tooltip-arrow-width; 85 | border-bottom-color: $tooltip-arrow-color; 86 | } 87 | &.bottom-left .tooltip-arrow { 88 | top: 0; 89 | right: $tooltip-arrow-width; 90 | margin-top: -$tooltip-arrow-width; 91 | border-width: 0 $tooltip-arrow-width $tooltip-arrow-width; 92 | border-bottom-color: $tooltip-arrow-color; 93 | } 94 | &.bottom-right .tooltip-arrow { 95 | top: 0; 96 | left: $tooltip-arrow-width; 97 | margin-top: -$tooltip-arrow-width; 98 | border-width: 0 $tooltip-arrow-width $tooltip-arrow-width; 99 | border-bottom-color: $tooltip-arrow-color; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /app/controllers/auth/login.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const mysql = require('../../../lib/mysql'); 3 | const Joi = require('joi'); 4 | const Crypto = require('crypto'); 5 | 6 | exports.showForm = { 7 | description: 'Returns the login page', 8 | auth: { 9 | mode: 'try', 10 | strategy: 'standard' 11 | }, 12 | handler: function(request, reply) { 13 | if (request.auth.isAuthenticated) { 14 | return reply.redirect('/crash'); 15 | } 16 | reply.view('auth/login'); 17 | }, 18 | tags: ['api'] //swagger documentation 19 | }; 20 | exports.postForm = { 21 | description: 'Post to the login page', 22 | auth: { 23 | mode: 'try', 24 | strategy: 'standard' 25 | }, 26 | plugins: { 27 | crumb: { 28 | key: 'crumb', 29 | source: 'payload', 30 | } 31 | }, 32 | validate: { 33 | payload: { 34 | email: Joi.string().email().required(), 35 | password: Joi.string().min(6).max(20).required() 36 | }, 37 | failAction: function(request, reply, source, error) { 38 | request.yar.flash('error', error.data.details[0].message); 39 | return reply.redirect('/'); 40 | } 41 | }, 42 | handler: function(request, reply) { 43 | if (request.auth.isAuthenticated) { 44 | return reply.redirect('/crash'); 45 | } 46 | findByCredentials(request, reply); 47 | }, 48 | tags: ['api'] //swagger documentation 49 | }; 50 | 51 | function findByCredentials(request, reply) { 52 | mysql.getConnection(function(err, connection) { 53 | if (err) { 54 | console.log("*********** MySQL Error ***********" + err); 55 | connection.release(); 56 | request.yar.flash('error', 'An internal server error occurred'); 57 | return reply.redirect('/login'); 58 | } 59 | connection.query('select * from Web_App_Users where email=? ', request.payload.email.toLowerCase(), function(err, rows) { 60 | if (err) { 61 | request.yar.flash('error', 'An internal server error occurred'); 62 | return reply.redirect('/login'); 63 | } 64 | if (rows.length) { 65 | if (request.payload.password && request.payload.password.length >= 6) { 66 | var password1 = new Buffer(request.payload.password).toString('base64'); 67 | if (rows[0].password === password1) { 68 | var user = { 69 | password: password1, 70 | email: request.payload.email, 71 | name: rows[0].name, 72 | dob: rows[0].dob 73 | }; 74 | request.cookieAuth.set(user); 75 | return reply.redirect('/crash'); 76 | } else if (rows[0].password !== password1) { 77 | request.yar.flash('error', 'Invalid email address or password'); 78 | return reply.redirect('/'); 79 | } else { 80 | request.yar.flash('error', 'Your request is pending for approval'); 81 | return reply.redirect('/'); 82 | } 83 | } 84 | } else { 85 | request.yar.flash('error', 'Invalid email address or password'); 86 | return reply.redirect('/'); 87 | } 88 | }); 89 | connection.release(); 90 | }); 91 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Crashlyzer 2 | Dashboard tool to analyze the reported crashes from the [React Native Crash Reporter](https://github.com/SystangoTechnologies/rn-crash-reporter) library. 3 | 4 | 5 | ## Technology 6 | 7 | - **Hapi** - Server side framework 8 | - **Handlebar** - HTML templating engine 9 | - **MySql** - Mysql database 10 | - **SASS** - CSS preprocessor 11 | - **Gulp** - Javascript tasks automation 12 | - **WebPack** - Asset pipeline 13 | - **Docker** - Containerisation platform 14 | 15 | 16 | ## Application Structure 17 | 18 | ``` 19 | | 20 | | -- app 21 | | |-- controllers // Controllers are organised by module names 22 | | | |-- // Each controller defines config and handler for that route 23 | | | 24 | | |-- helpers // Helper functions used across application 25 | | |-- models // All mongoose models are defined here 26 | | |-- routes // All app routes are defined here 27 | | | |-- // Route module is a hapi plugin and can be toggled from config/manifest.js 28 | | | 29 | | `-- templates // All server-rendered handlebar templates, partials and helpers 30 | | |-- // Templates are organised by module names 31 | | 32 | |-- assets // Contains all static resources 33 | | |-- fonts // Fonts used in application 34 | | |-- images // Images used in application 35 | | |-- misc // Misc resources used in application 36 | | |-- scripts // Client javscripts files which are then packed by webpack 37 | | |-- styles // All SASS stylesheets 38 | | | |-- // Styles are organised by module names 39 | | 40 | |-- config // Contains all app configurations 41 | | |-- assets.js // Assets configuration file 42 | | |-- config.js // Application configuration file which stores all passwords etc. (gitignore) 43 | | |-- manifest.js // App manifest file listing all plugins and load order 44 | | |-- meta.js // App metadata file 45 | | 46 | | -- db 47 | | |-- data // Mysql Data directory 48 | | | |-- // Mysql Data files 49 | | |-- init // Mysql Initialisation Scripts 50 | | | |-- init.sql // Table definitions 51 | | | |-- insert.sql // Initial data 52 | | 53 | |-- lib // Core application lib/plugins 54 | |-- tasks // Contains all gulp tasks 55 | | 56 | |-- gulpfile.js // Gulp entry file 57 | |-- index.js // Application starting point 58 | |-- package.js // Package configuration file 59 | |-- server.js // Main server file 60 | |-- Dockerfile // Dockerfile containing the build information 61 | |-- docker-compose.yml // Docker-Compose file containing the web and db services information 62 | 63 | ``` 64 | 65 | ## Code Style 66 | 67 | We're using semi-colons and comma-last. No rhyme or reason; and some of the hapi [code convention guidelines](http://hapijs.com/styleguide). All client-side js code is also in commonJS pattern packs using webpack. Check out `.editorconfig`, `.jsbeautifyrc`, `.eslintrc` for additional code conventions used. 68 | 69 | ## Dockerised Startup 70 | Please execute the following command at the root of the project to boot the database and web-app containers 71 | ``` 72 | Docker-Compose up 73 | ``` 74 | 75 | ## Entity Relationship Diagram 76 | ![ERD](https://github.com/sytango-technologies/rn-crash-viewer/blob/master/ERD.png) 77 | 78 | ## Contributors 79 | [Arpit Khandelwal](https://www.linkedin.com/in/arpitkhandelwal1984/) 80 | [Anurag Vikram Singh](https://www.linkedin.com/in/anuragvikramsingh/) 81 | -------------------------------------------------------------------------------- /app/controllers/user_setting/setting.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const mysql = require('../../../lib/mysql'); 3 | const Joi = require('joi'); 4 | exports.showSetting = { 5 | description: 'Returns the User Setting', 6 | handler: function(request, reply) { 7 | reply.view('settings/setting'); 8 | }, 9 | tags: ['api'] //swagger documentation 10 | }; 11 | exports.changePassword = { 12 | description: 'Update the User Password', 13 | auth: { 14 | mode: 'try', 15 | strategy: 'standard' 16 | }, 17 | validate: { 18 | payload: { 19 | oldPassword: Joi.string().min(6).max(20).required(), 20 | newPassword: Joi.string().min(6).max(20).required(), 21 | confirmNewPassword: Joi.string().min(6).max(20).required() 22 | }, 23 | failAction: function(request, reply, source, error) { 24 | request.yar.flash('error', error.data.details[0].message); 25 | return reply.redirect('/setting'); 26 | } 27 | }, 28 | handler: function(request, reply) { 29 | var old_pwd = request.payload.oldPassword; 30 | var new_pwd = request.payload.newPassword; 31 | if (request.payload.newPassword !== request.payload.confirmNewPassword) { 32 | request.yar.flash('error', 'Password does not match'); 33 | return reply.redirect('/setting'); 34 | } 35 | //verify password from user table 36 | checkPassword(request, reply, old_pwd, new_pwd); 37 | }, 38 | tags: ['alias'] //swagger documentation 39 | }; 40 | 41 | function checkPassword(request, reply, old_pwd, new_pwd) { 42 | mysql.getConnection(function(err, connection) { 43 | if (err) { 44 | connection.release(); 45 | request.yar.flash('error', 'An internal server error occurred'); 46 | return reply.redirect('/setting'); 47 | } 48 | connection.query('select * from Web_App_Users where email=?', request.auth.credentials.email, function(err, rows) { 49 | if (err) { 50 | request.yar.flash('error', 'An internal server error occurred'); 51 | return reply.redirect('/setting'); 52 | } 53 | if (rows.length) { 54 | var oldPassword = new Buffer(old_pwd).toString('base64'); 55 | if (rows[0].password === oldPassword) { 56 | var newPassword = new Buffer(new_pwd).toString('base64'); 57 | //save new password 58 | savePassword(request, reply, newPassword); 59 | } else { 60 | request.yar.flash('error', 'Invalid current password'); 61 | return reply.redirect('/setting'); 62 | } 63 | } else { 64 | request.yar.flash('error', 'Invalid current password'); 65 | return reply.redirect('/setting'); 66 | } 67 | }); 68 | connection.release(); 69 | }); 70 | } 71 | 72 | function savePassword(request, reply, newPassword) { 73 | mysql.getConnection(function(err, connection) { 74 | if (err) { 75 | connection.release(); 76 | request.yar.flash('error', 'An internal server error occurred'); 77 | return reply.redirect('/setting'); 78 | } 79 | connection.query('update Web_App_Users set password=? where email=?', [newPassword, request.auth.credentials.email], function(err, rows) { 80 | if (err) { 81 | request.yar.flash('error', 'An internal server error occurred'); 82 | return reply.redirect('/setting'); 83 | } else { 84 | request.yar.flash('success', 'Password updated successfully!'); 85 | reply.redirect('/setting'); 86 | } 87 | }); 88 | connection.release(); 89 | }); 90 | } -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/mixins/_grid.scss: -------------------------------------------------------------------------------- 1 | // Grid system 2 | // 3 | // Generate semantic grid columns with these mixins. 4 | 5 | // Centered container element 6 | @mixin container-fixed($gutter: $grid-gutter-width) { 7 | margin-right: auto; 8 | margin-left: auto; 9 | padding-left: floor(($gutter / 2)); 10 | padding-right: ceil(($gutter / 2)); 11 | @include clearfix; 12 | } 13 | 14 | // Creates a wrapper for a series of columns 15 | @mixin make-row($gutter: $grid-gutter-width) { 16 | margin-left: ceil(($gutter / -2)); 17 | margin-right: floor(($gutter / -2)); 18 | @include clearfix; 19 | } 20 | 21 | // Generate the extra small columns 22 | @mixin make-xs-column($columns, $gutter: $grid-gutter-width) { 23 | position: relative; 24 | float: left; 25 | width: percentage(($columns / $grid-columns)); 26 | min-height: 1px; 27 | padding-left: ($gutter / 2); 28 | padding-right: ($gutter / 2); 29 | } 30 | @mixin make-xs-column-offset($columns) { 31 | margin-left: percentage(($columns / $grid-columns)); 32 | } 33 | @mixin make-xs-column-push($columns) { 34 | left: percentage(($columns / $grid-columns)); 35 | } 36 | @mixin make-xs-column-pull($columns) { 37 | right: percentage(($columns / $grid-columns)); 38 | } 39 | 40 | // Generate the small columns 41 | @mixin make-sm-column($columns, $gutter: $grid-gutter-width) { 42 | position: relative; 43 | min-height: 1px; 44 | padding-left: ($gutter / 2); 45 | padding-right: ($gutter / 2); 46 | 47 | @media (min-width: $screen-sm-min) { 48 | float: left; 49 | width: percentage(($columns / $grid-columns)); 50 | } 51 | } 52 | @mixin make-sm-column-offset($columns) { 53 | @media (min-width: $screen-sm-min) { 54 | margin-left: percentage(($columns / $grid-columns)); 55 | } 56 | } 57 | @mixin make-sm-column-push($columns) { 58 | @media (min-width: $screen-sm-min) { 59 | left: percentage(($columns / $grid-columns)); 60 | } 61 | } 62 | @mixin make-sm-column-pull($columns) { 63 | @media (min-width: $screen-sm-min) { 64 | right: percentage(($columns / $grid-columns)); 65 | } 66 | } 67 | 68 | // Generate the medium columns 69 | @mixin make-md-column($columns, $gutter: $grid-gutter-width) { 70 | position: relative; 71 | min-height: 1px; 72 | padding-left: ($gutter / 2); 73 | padding-right: ($gutter / 2); 74 | 75 | @media (min-width: $screen-md-min) { 76 | float: left; 77 | width: percentage(($columns / $grid-columns)); 78 | } 79 | } 80 | @mixin make-md-column-offset($columns) { 81 | @media (min-width: $screen-md-min) { 82 | margin-left: percentage(($columns / $grid-columns)); 83 | } 84 | } 85 | @mixin make-md-column-push($columns) { 86 | @media (min-width: $screen-md-min) { 87 | left: percentage(($columns / $grid-columns)); 88 | } 89 | } 90 | @mixin make-md-column-pull($columns) { 91 | @media (min-width: $screen-md-min) { 92 | right: percentage(($columns / $grid-columns)); 93 | } 94 | } 95 | 96 | // Generate the large columns 97 | @mixin make-lg-column($columns, $gutter: $grid-gutter-width) { 98 | position: relative; 99 | min-height: 1px; 100 | padding-left: ($gutter / 2); 101 | padding-right: ($gutter / 2); 102 | 103 | @media (min-width: $screen-lg-min) { 104 | float: left; 105 | width: percentage(($columns / $grid-columns)); 106 | } 107 | } 108 | @mixin make-lg-column-offset($columns) { 109 | @media (min-width: $screen-lg-min) { 110 | margin-left: percentage(($columns / $grid-columns)); 111 | } 112 | } 113 | @mixin make-lg-column-push($columns) { 114 | @media (min-width: $screen-lg-min) { 115 | left: percentage(($columns / $grid-columns)); 116 | } 117 | } 118 | @mixin make-lg-column-pull($columns) { 119 | @media (min-width: $screen-lg-min) { 120 | right: percentage(($columns / $grid-columns)); 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /assets/styles/bootstrap/bootstrap/_list-group.scss: -------------------------------------------------------------------------------- 1 | // 2 | // List groups 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | // 8 | // Easily usable on