├── src
├── home.js
├── img
│ ├── .gitkeep
│ ├── cc-voyager-logo.svg
│ └── cc-voyager.svg
├── scss
│ ├── fonts
│ │ ├── .gitkeep
│ │ ├── lato.scss
│ │ └── roboto-mono.scss
│ ├── partials
│ │ ├── footer.scss
│ │ └── header.scss
│ ├── pages
│ │ └── index.scss
│ ├── style.scss
│ └── global
│ │ ├── _variables.scss
│ │ └── util.scss
└── global.js
├── controllers
└── .gitkeep
├── views
├── partials
│ ├── footer.hbs
│ └── header.hbs
├── error.hbs
├── layouts
│ └── main.hbs
└── index.hbs
├── public
├── robots.txt
├── js
│ ├── home.bundle.js
│ └── global.bundle.js
├── img
│ ├── cc-voyager-logo.svg
│ └── cc-voyager.svg
└── css
│ └── style.css
├── .env.example
├── config
├── app.js
└── bookshelf.js
├── postcss.config.js
├── models
└── User.js
├── routes
└── web.js
├── test
└── app.test.js
├── knexfile.js
├── migrations
└── 20171203143245_users.js
├── .eslintrc.js
├── .gitignore
├── LICENSE.md
├── package.json
├── app.js
├── bin
└── www
├── README.md
└── webpack.config.js
/src/home.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/img/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/controllers/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/scss/fonts/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/views/partials/footer.hbs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/scss/partials/footer.scss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
--------------------------------------------------------------------------------
/.env.example:
--------------------------------------------------------------------------------
1 | DB_HOST=
2 | DB_USER=
3 | DB_PASSWORD=
4 | DB_NAME=
--------------------------------------------------------------------------------
/config/app.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | useEnv: false
3 | }
4 |
--------------------------------------------------------------------------------
/views/error.hbs:
--------------------------------------------------------------------------------
1 |
2 |

3 |
4 |
Resources
5 |
11 |
12 |
20 |
21 |
--------------------------------------------------------------------------------
/src/scss/global/_variables.scss:
--------------------------------------------------------------------------------
1 | $light-gray: #c5c5c5;
2 | $gray: #636363;
3 | $red: #ff0000;
4 | $purple: #635afe;
5 |
6 | $lato: 'Lato', sans-serif;
7 | $roboto: 'Roboto Mono', monospace;
8 |
9 | $screen-sm-min: 576px;
10 | $screen-md-min: 768px;
11 | $screen-lg-min: 992px;
12 | $screen-xl-min: 1200px;
13 |
14 | @mixin breakpoint($point) {
15 | @if $point == $screen-sm-min {
16 | @media screen and (min-width: $screen-sm-min) {
17 | @content;
18 | }
19 | }
20 | @elseif $point == $screen-md-min {
21 | @media screen and (min-width: $screen-md-min) {
22 | @content;
23 | }
24 | }
25 | @elseif $point == $screen-lg-min {
26 | @media screen and (min-width: $screen-lg-min) {
27 | @content;
28 | }
29 | }
30 | @elseif $point == $screen-xl-min {
31 | @media screen and (min-width: $screen-xl-min) {
32 | @content;
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | ## The MIT License (MIT)
2 |
3 | Copyright © 2017-2018 Chris Courses
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "voyager",
3 | "version": "0.0.0",
4 | "private": true,
5 | "scripts": {
6 | "start": "nodemon ./bin/www"
7 | },
8 | "dependencies": {
9 | "body-parser": "~1.18.2",
10 | "bookshelf": "^0.12.0",
11 | "cookie-parser": "~1.4.3",
12 | "debug": "~2.6.9",
13 | "dotenv-safe": "^4.0.4",
14 | "express": "~4.15.5",
15 | "express-handlebars": "^3.0.0",
16 | "hbs": "~4.0.1",
17 | "knex": "^0.14.2",
18 | "morgan": "~1.9.0",
19 | "mysql": "^2.15.0",
20 | "serve-favicon": "~2.4.5"
21 | },
22 | "devDependencies": {
23 | "babel-core": "^6.26.0",
24 | "babel-loader": "^7.1.2",
25 | "babel-preset-env": "^1.6.1",
26 | "browser-sync": "^2.18.13",
27 | "browser-sync-webpack-plugin": "^1.2.0",
28 | "chai": "^4.1.2",
29 | "css-loader": "^0.28.7",
30 | "extract-text-webpack-plugin": "^3.0.2",
31 | "file-loader": "^1.1.6",
32 | "mocha": "^4.0.1",
33 | "node-sass": "^4.7.2",
34 | "postcss-loader": "^2.0.9",
35 | "prettier": "^1.10.2",
36 | "sass-loader": "^6.0.6",
37 | "style-loader": "^0.19.1",
38 | "supertest": "^3.0.0",
39 | "webpack": "^3.10.0"
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app.js:
--------------------------------------------------------------------------------
1 | const express = require('express')
2 | const path = require('path')
3 | const favicon = require('serve-favicon')
4 | const logger = require('morgan')
5 | const cookieParser = require('cookie-parser')
6 | const bodyParser = require('body-parser')
7 | const config = require('./config/app')
8 |
9 | const exphbs = require('express-handlebars')
10 |
11 | if (config.useEnv) require('dotenv-safe').load() // Must load as early as possible
12 |
13 | const routes = require('./routes/web')
14 |
15 | const app = express()
16 |
17 | // view engine setup
18 | const hbs = exphbs.create({
19 | extname: '.hbs',
20 | defaultLayout: 'main',
21 | helpers: {
22 | ifeq(a, b, options) {
23 | if (a === b) return options.fn(this)
24 | return options.inverse(this)
25 | },
26 | toJSON(object) {
27 | return JSON.stringify(object)
28 | }
29 | }
30 | })
31 |
32 | app.engine('.hbs', hbs.engine)
33 | app.set('views', path.join(__dirname, 'views'))
34 | app.set('view engine', '.hbs')
35 |
36 | // uncomment after placing your favicon in /public
37 | //app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
38 | app.use(logger('dev'))
39 | app.use(bodyParser.json())
40 | app.use(bodyParser.urlencoded({ extended: false }))
41 | app.use(cookieParser())
42 | app.use(express.static(path.join(__dirname, 'public')))
43 |
44 | app.use('/', routes)
45 |
46 | // catch 404 and forward to error handler
47 | app.use((req, res, next) => {
48 | const err = new Error('Not Found')
49 | err.status = 404
50 | next(err)
51 | })
52 |
53 | // error handler
54 | app.use((err, req, res) => {
55 | // set locals, only providing error in development
56 | res.locals.message = err.message
57 | res.locals.error = req.app.get('env') === 'development' ? err : {}
58 |
59 | // render the error page
60 | res.status(err.status || 500)
61 | res.render('error')
62 | })
63 |
64 | module.exports = app
65 |
--------------------------------------------------------------------------------
/bin/www:
--------------------------------------------------------------------------------
1 | /**
2 | * Module dependencies.
3 | */
4 |
5 | const app = require('../app')
6 | const debug = require('debug')('chris-courses-2018:server')
7 | const http = require('http')
8 |
9 | /**
10 | * Get port from environment and store in Express.
11 | */
12 |
13 | const port = normalizePort(process.env.PORT || '3000')
14 | app.set('port', port)
15 |
16 | /**
17 | * Create HTTP server.
18 | */
19 |
20 | const server = http.createServer(app)
21 |
22 | /**
23 | * Listen on provided port, on all network interfaces.
24 | */
25 |
26 | server.listen(port)
27 | server.on('error', onError)
28 | server.on('listening', onListening)
29 |
30 | /**
31 | * Normalize a port into a number, string, or false.
32 | */
33 |
34 | function normalizePort(val) {
35 | const port = parseInt(val, 10)
36 |
37 | if (isNaN(port)) {
38 | // named pipe
39 | return val
40 | }
41 |
42 | if (port >= 0) {
43 | // port number
44 | return port
45 | }
46 |
47 | return false
48 | }
49 |
50 | /**
51 | * Event listener for HTTP server "error" event.
52 | */
53 |
54 | function onError(error) {
55 | if (error.syscall !== 'listen') {
56 | throw error
57 | }
58 |
59 | const bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port
60 |
61 | // handle specific listen errors with friendly messages
62 | switch (error.code) {
63 | case 'EACCES':
64 | console.error(bind + ' requires elevated privileges')
65 | process.exit(1)
66 | break
67 | case 'EADDRINUSE':
68 | console.error(bind + ' is already in use')
69 | process.exit(1)
70 | break
71 | default:
72 | throw error
73 | }
74 | }
75 |
76 | /**
77 | * Event listener for HTTP server "listening" event.
78 | */
79 |
80 | function onListening() {
81 | const addr = server.address()
82 | const bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port
83 | debug('Listening on ' + bind)
84 | }
85 |
--------------------------------------------------------------------------------
/public/js/home.bundle.js:
--------------------------------------------------------------------------------
1 | /******/ (function(modules) { // webpackBootstrap
2 | /******/ // The module cache
3 | /******/ var installedModules = {};
4 | /******/
5 | /******/ // The require function
6 | /******/ function __webpack_require__(moduleId) {
7 | /******/
8 | /******/ // Check if module is in cache
9 | /******/ if(installedModules[moduleId]) {
10 | /******/ return installedModules[moduleId].exports;
11 | /******/ }
12 | /******/ // Create a new module (and put it into the cache)
13 | /******/ var module = installedModules[moduleId] = {
14 | /******/ i: moduleId,
15 | /******/ l: false,
16 | /******/ exports: {}
17 | /******/ };
18 | /******/
19 | /******/ // Execute the module function
20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21 | /******/
22 | /******/ // Flag the module as loaded
23 | /******/ module.l = true;
24 | /******/
25 | /******/ // Return the exports of the module
26 | /******/ return module.exports;
27 | /******/ }
28 | /******/
29 | /******/
30 | /******/ // expose the modules object (__webpack_modules__)
31 | /******/ __webpack_require__.m = modules;
32 | /******/
33 | /******/ // expose the module cache
34 | /******/ __webpack_require__.c = installedModules;
35 | /******/
36 | /******/ // define getter function for harmony exports
37 | /******/ __webpack_require__.d = function(exports, name, getter) {
38 | /******/ if(!__webpack_require__.o(exports, name)) {
39 | /******/ Object.defineProperty(exports, name, {
40 | /******/ configurable: false,
41 | /******/ enumerable: true,
42 | /******/ get: getter
43 | /******/ });
44 | /******/ }
45 | /******/ };
46 | /******/
47 | /******/ // getDefaultExport function for compatibility with non-harmony modules
48 | /******/ __webpack_require__.n = function(module) {
49 | /******/ var getter = module && module.__esModule ?
50 | /******/ function getDefault() { return module['default']; } :
51 | /******/ function getModuleExports() { return module; };
52 | /******/ __webpack_require__.d(getter, 'a', getter);
53 | /******/ return getter;
54 | /******/ };
55 | /******/
56 | /******/ // Object.prototype.hasOwnProperty.call
57 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
58 | /******/
59 | /******/ // __webpack_public_path__
60 | /******/ __webpack_require__.p = "";
61 | /******/
62 | /******/ // Load entry module and return exports
63 | /******/ return __webpack_require__(__webpack_require__.s = 2);
64 | /******/ })
65 | /************************************************************************/
66 | /******/ ({
67 |
68 | /***/ 2:
69 | /***/ (function(module, exports, __webpack_require__) {
70 |
71 | "use strict";
72 | eval("//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMi5qcyIsInNvdXJjZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///2\n");
73 |
74 | /***/ })
75 |
76 | /******/ });
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |