├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── appveyor.yml ├── build ├── build.js ├── check-versions.js ├── dev-client.js ├── dev-server.js ├── utils.js ├── vue-loader.conf.js ├── webpack.base.conf.js ├── webpack.dev.conf.js └── webpack.prod.conf.js ├── client ├── App.vue ├── app.js ├── assets │ ├── 480.gif │ ├── logo.png │ ├── logo.svg │ ├── logo@2x.png │ └── puff.svg ├── components │ ├── layout │ │ ├── AppMain.vue │ │ ├── FooterBar.vue │ │ ├── Levelbar.vue │ │ ├── Navbar.vue │ │ ├── Sidebar.vue │ │ └── index.js │ └── ui │ │ ├── Notification.vue │ │ └── Notifications.vue ├── filters │ └── index.js ├── firebase-setup │ ├── config.js │ └── ref-types.js ├── index.js ├── router │ └── index.js ├── store │ ├── actions.js │ ├── getters.js │ ├── index.js │ ├── modules │ │ ├── app.js │ │ ├── auth │ │ │ ├── getters.js │ │ │ ├── index.js │ │ │ └── utils.js │ │ ├── menu │ │ │ ├── components.js │ │ │ ├── index.js │ │ │ ├── lazyLoading.js │ │ │ ├── tables.js │ │ │ └── uifeatures.js │ │ ├── notes │ │ │ ├── getters.js │ │ │ ├── index.js │ │ │ └── utils.js │ │ ├── notifications.js │ │ └── utils.js │ └── mutation-types.js ├── utils │ └── index.js └── views │ ├── Home.vue │ ├── auth │ ├── Login.vue │ ├── LoginFirebase.vue │ └── UserPassForm.vue │ ├── axios │ └── index.vue │ ├── components │ ├── BackToTop.vue │ ├── Brace.vue │ ├── Collapse.vue │ ├── Datepicker.vue │ ├── Default.vue │ ├── Emoji.vue │ ├── Lory.vue │ ├── Message.vue │ ├── Modal.vue │ ├── Notification.vue │ ├── ProgressBar.vue │ ├── ProgressTracker.vue │ ├── Quill.vue │ ├── Rating.vue │ ├── Slider.vue │ ├── Switch.vue │ ├── Tabs.vue │ ├── Tooltip.vue │ ├── index.vue │ └── modals │ │ ├── CardModal.vue │ │ ├── ImageModal.vue │ │ └── Modal.vue │ ├── dashboard │ └── index.vue │ ├── tables │ └── Basic.vue │ ├── ui │ ├── Buttons.vue │ ├── Form.vue │ ├── Icons.vue │ └── Typography.vue │ └── user │ ├── LinkedAccounts.vue │ ├── NewNoteForm.vue │ ├── Notes.vue │ ├── PassForm.vue │ ├── index.vue │ └── modals │ └── ReAuthenticate.vue ├── config ├── dev.env.js ├── firebase.env.js ├── index.js ├── prod.env.js └── test.env.js ├── electronIndex.js ├── index.html ├── package-lock.json ├── package.json └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["es2015", { "modules": false }], 4 | "stage-2" 5 | ], 6 | "plugins": [ 7 | "transform-export-extensions" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | build/build.js 2 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parser: 'babel-eslint', 4 | parserOptions: { 5 | sourceType: 'module' 6 | }, 7 | // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style 8 | extends: 'standard', 9 | // required to lint *.vue files 10 | plugins: [ 11 | 'html' 12 | ], 13 | // add your custom rules here 14 | 'rules': { 15 | // allow paren-less arrow functions 16 | 'arrow-parens': 0, 17 | // allow async-await 18 | 'generator-star-spacing': 0, 19 | // allow debugger during development 20 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log 5 | yarn-error.log 6 | selenium-debug.log 7 | test/unit/coverage 8 | test/e2e/reports 9 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - "5" 5 | - "6" 6 | 7 | before_install: 8 | - npm install npm@latest -g 9 | 10 | script: 11 | - node --version 12 | - npm --version 13 | - npm run build 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vuexfire-admin 2 | A Vue.js 2 admin app, based on vue-admin, using vuex, vuexfire, vue-router and firebase as the backend. 3 | 4 | This project aims to be a template for using Firebase as a backend, and vue-admin as a frontend. 5 | 6 | A lot of work has been done in a private repository and I'm currently in the progress of migrating this across to this public repo. 7 | 8 | ### Current features developed: 9 | 10 | - Vuexfire for Firebase integration 11 | - Firebase auth 12 | - Ability to set a password (including Firebase reauth flow handling) 13 | - Ability to link multiple auth providers 14 | - Frontend Notification dispatching system (ie. not integrated with Cloud Messaging) and default notifications 15 | - Protected Routes 16 | - A User dashboard 17 | - A basic User Notes taking feature, where completed / incompleted notes are shown on the User dashboard. Along with new note form that accepts a title, and wysiwyg body field (Quill) 18 | 19 | ### Installation 20 | 21 | **NOTE: This app assumes you have a working Firebase instance with at least one of the auth providers; Google, Facebook, Github or Password enabled.** 22 | 23 | 1. Update `config/firebase.env.js` with your firebase config variables 24 | 2. `npm install` 25 | 3. `npm run dev` 26 | 27 | ### Firebase Rules 28 | This app requires the following firebase rules (for notes facility) 29 | 30 | `````` 31 | { 32 | "rules": { 33 | // ".read": true, 34 | // ".write": false, 35 | "users": { 36 | ".indexOn": "ID", 37 | "$uid": { 38 | ".validate": "$uid === auth.uid", 39 | // grants write access to the owner of this user account 40 | // whose uid must exactly match the key ($uid) 41 | ".write": "$uid === auth.uid", 42 | ".read": "auth != null && auth.uid == $uid" 43 | } 44 | }, 45 | "notes": { 46 | ".indexOn": "uid", 47 | ".read" : "data.child(auth.uid).exists()", 48 | "$uid": { 49 | ".write": "$uid == auth.uid", 50 | } 51 | } 52 | } 53 | } 54 | `````` 55 | 56 | ### WARNING !!! 57 | 58 | THIS APP **SETS** FIREBASE REFS `/users` AND `/notes` !!!! 59 | 60 | If you already have data at these refs, be sure to change the ref names in the file `/client/firebase-setup/ref-types.js`. Otherwise, it will most likely be overwritten. 61 | 62 | ### Additional work 63 | 64 | I have a companion node.js server app that runs on heroku. It watches the firebase database and performs database actions using firebase-admin sdk. 65 | 66 | I will aim to make this app publicly available too, but optional (ie. not required for vuexfire-admin to work). 67 | 68 | --- 69 | ### Credits 70 | 71 | This project is inspired or powered by these people or projects so I want to thank them 72 | 73 | - [Vue](https://github.com/vuejs/vue) great work 74 | - [Bulma](https://github.com/jgthms/bulma) A modern CSS framework based on Flexbox 75 | - [vue-admin](https://github.com/vue-bulma/vue-admin) for laying the foundations 76 | - [VuexFire](https://github.com/posva/vuexfire) for work integrating Vuex & Firebase 77 | - [vee-validate](https://github.com/baianat/vee-validate) for making form validation in Vue so easy 78 | - [Firebase](https://firebase.google.com/) 79 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | matrix: 3 | - nodejs_version: '4' 4 | - nodejs_version: '5' 5 | - nodejs_version: '6' 6 | 7 | install: 8 | - ps: Install-Product node $env:nodejs_version 9 | - npm install npm@latest -g 10 | - npm install 11 | 12 | test_script: 13 | - node --version 14 | - npm --version 15 | - npm run build 16 | 17 | build: off 18 | 19 | version: "{build}" 20 | -------------------------------------------------------------------------------- /build/build.js: -------------------------------------------------------------------------------- 1 | // https://github.com/shelljs/shelljs 2 | 'use strict' 3 | 4 | require('./check-versions')() 5 | require('shelljs/global') 6 | 7 | env.NODE_ENV = 'production' 8 | 9 | const ora = require('ora') 10 | const path = require('path') 11 | const chalk = require('chalk') 12 | const webpack = require('webpack') 13 | const config = require('../config') 14 | const webpackConfig = require('./webpack.prod.conf') 15 | 16 | const spinner = ora('building for production...') 17 | spinner.start() 18 | 19 | const assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory) 20 | rm('-rf', assetsPath) 21 | mkdir('-p', assetsPath) 22 | cp('-R', 'assets/*', assetsPath) 23 | 24 | const compiler = webpack(webpackConfig) 25 | const ProgressPlugin = require('webpack/lib/ProgressPlugin') 26 | compiler.apply(new ProgressPlugin()) 27 | 28 | compiler.run((err, stats) => { 29 | spinner.stop() 30 | if (err) throw err 31 | process.stdout.write(stats.toString({ 32 | colors: true, 33 | modules: false, 34 | children: false, 35 | chunks: false, 36 | chunkModules: false 37 | }) + '\n\n') 38 | 39 | console.log(chalk.cyan(' Build complete.\n')) 40 | console.log(chalk.yellow( 41 | ' Tip: built files are meant to be served over an HTTP server.\n' + 42 | ' Opening index.html over file:// won\'t work.\n' 43 | )) 44 | }) 45 | -------------------------------------------------------------------------------- /build/check-versions.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const chalk = require('chalk') 4 | const semver = require('semver') 5 | const packageConfig = require('../package.json') 6 | 7 | const exec = (cmd) => { 8 | return require('child_process').execSync(cmd).toString().trim() 9 | } 10 | 11 | const versionRequirements = [ 12 | { 13 | name: 'node', 14 | currentVersion: semver.clean(process.version), 15 | versionRequirement: packageConfig.engines.node 16 | }, 17 | { 18 | name: 'npm', 19 | currentVersion: exec('npm --version'), 20 | versionRequirement: packageConfig.engines.npm 21 | } 22 | ] 23 | 24 | module.exports = () => { 25 | const warnings = [] 26 | for (let i = 0; i < versionRequirements.length; i++) { 27 | const mod = versionRequirements[i] 28 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 29 | warnings.push(mod.name + ': ' + 30 | chalk.red(mod.currentVersion) + ' should be ' + 31 | chalk.green(mod.versionRequirement) 32 | ) 33 | } 34 | } 35 | 36 | if (warnings.length) { 37 | console.log('') 38 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 39 | console.log() 40 | for (let i = 0; i < warnings.length; i++) { 41 | const warning = warnings[i] 42 | console.log(' ' + warning) 43 | } 44 | console.log() 45 | process.exit(1) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /build/dev-client.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | /* eslint-disable */ 4 | require('eventsource-polyfill') 5 | const hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 6 | 7 | hotClient.subscribe(event => { 8 | if (event.action === 'reload') { 9 | window.location.reload() 10 | } 11 | }) 12 | -------------------------------------------------------------------------------- /build/dev-server.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | require('./check-versions')() 4 | 5 | const path = require('path') 6 | const express = require('express') 7 | const webpack = require('webpack') 8 | const opn = require('opn') 9 | const config = require('../config') 10 | const proxyMiddleware = require('http-proxy-middleware') 11 | const webpackConfig = process.env.NODE_ENV === 'testing' 12 | ? require('./webpack.prod.conf') 13 | : require('./webpack.dev.conf') 14 | 15 | // default port where dev server listens for incoming traffic 16 | const port = process.env.PORT || config.dev.port 17 | // automatically open browser, if not set will be false 18 | const autoOpenBrowser = Boolean(config.dev.autoOpenBrowser) 19 | // Define HTTP proxies to your custom API backend 20 | // https://github.com/chimurai/http-proxy-middleware 21 | const proxyTable = config.dev.proxyTable 22 | 23 | const app = express() 24 | const compiler = webpack(webpackConfig) 25 | 26 | const devMiddleware = require('webpack-dev-middleware')(compiler, { 27 | publicPath: webpackConfig.output.publicPath, 28 | stats: { 29 | colors: true, 30 | chunks: false 31 | } 32 | }) 33 | 34 | const hotMiddleware = require('webpack-hot-middleware')(compiler) 35 | // force page reload when html-webpack-plugin template changes 36 | compiler.plugin('compilation', compilation => { 37 | compilation.plugin('html-webpack-plugin-after-emit', (data, cb) => { 38 | hotMiddleware.publish({ action: 'reload' }) 39 | cb() 40 | }) 41 | }) 42 | 43 | // proxy api requests 44 | Object.keys(proxyTable).forEach(context => { 45 | let options = proxyTable[context] 46 | if (typeof options === 'string') { 47 | options = { target: options } 48 | } 49 | app.use(proxyMiddleware(options.filter || context, options)) 50 | }) 51 | 52 | // handle fallback for HTML5 history API 53 | app.use(require('connect-history-api-fallback')()) 54 | 55 | // serve webpack bundle output 56 | app.use(devMiddleware) 57 | 58 | // enable hot-reload and state-preserving 59 | // compilation error display 60 | app.use(hotMiddleware) 61 | 62 | // serve pure static assets 63 | const staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory) 64 | app.use(staticPath, express.static('./assets')) 65 | 66 | const uri = 'http://localhost:' + port 67 | 68 | devMiddleware.waitUntilValid(() => { 69 | console.log('> Listening at ' + uri + '\n') 70 | }) 71 | 72 | module.exports = app.listen(port, err => { 73 | if (err) { 74 | console.log(err) 75 | return 76 | } 77 | 78 | // when env is testing, don't need open it 79 | if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') { 80 | opn(uri) 81 | } 82 | }) 83 | -------------------------------------------------------------------------------- /build/utils.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const path = require('path') 4 | const config = require('../config') 5 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 6 | 7 | exports.assetsPath = _path => { 8 | const assetsSubDirectory = process.env.NODE_ENV === 'production' 9 | ? config.build.assetsSubDirectory 10 | : config.dev.assetsSubDirectory 11 | return path.posix.join(assetsSubDirectory, _path) 12 | } 13 | 14 | exports.cssLoaders = options => { 15 | options = options || {} 16 | // generate loader string to be used with extract text plugin 17 | const generateLoaders = loaders => { 18 | const sourceLoader = loaders.map(loader => { 19 | let extraParamChar 20 | if (/\?/.test(loader)) { 21 | loader = loader.replace(/\?/, '-loader?') 22 | extraParamChar = '&' 23 | } else { 24 | loader = loader + '-loader' 25 | extraParamChar = '?' 26 | } 27 | return loader + (options.sourceMap ? extraParamChar + 'sourceMap' : '') 28 | }).join('!') 29 | 30 | // Extract CSS when that option is specified 31 | // (which is the case during production build) 32 | if (options.extract) { 33 | return ExtractTextPlugin.extract({ 34 | use: sourceLoader, 35 | fallback: 'vue-style-loader' 36 | }) 37 | } else { 38 | return ['vue-style-loader', sourceLoader].join('!') 39 | } 40 | } 41 | 42 | // http://vuejs.github.io/vue-loader/configurations/extract-css.html 43 | return { 44 | css: generateLoaders(['css']), 45 | postcss: generateLoaders(['css']), 46 | less: generateLoaders(['css', 'less']), 47 | sass: generateLoaders(['css', 'sass?indentedSyntax']), 48 | scss: generateLoaders(['css', 'sass']), 49 | stylus: generateLoaders(['css', 'stylus']), 50 | styl: generateLoaders(['css', 'stylus']) 51 | } 52 | } 53 | 54 | // Generate loaders for standalone style files (outside of .vue) 55 | exports.styleLoaders = options => { 56 | const output = [] 57 | const loaders = exports.cssLoaders(options) 58 | for (const extension of Object.keys(loaders)) { 59 | const loader = loaders[extension] 60 | output.push({ 61 | test: new RegExp('\\.' + extension + '$'), 62 | loader: loader 63 | }) 64 | } 65 | return output 66 | } 67 | -------------------------------------------------------------------------------- /build/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const utils = require('./utils') 4 | const config = require('../config') 5 | 6 | const isProduction = process.env.NODE_ENV === 'production' 7 | 8 | module.exports = { 9 | loaders: utils.cssLoaders({ 10 | sourceMap: isProduction ? config.build.productionSourceMap : config.dev.cssSourceMap, 11 | extract: isProduction 12 | }), 13 | postcss: [ 14 | require('autoprefixer')({ 15 | browsers: ['last 3 versions'] 16 | }) 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const path = require('path') 4 | const config = require('../config') 5 | const utils = require('./utils') 6 | const projectRoot = path.resolve(__dirname, '../') 7 | 8 | module.exports = { 9 | entry: { 10 | app: ['./client/index.js'], 11 | // If you want to support IE < 11, should add `babel-polyfill` to vendor. 12 | // e.g. ['babel-polyfill', 'vue', 'vue-router', 'vuex'] 13 | vendor: [ 14 | 'vue', 15 | 'vue-router', 16 | 'vuex', 17 | 'vuex-router-sync' 18 | ] 19 | }, 20 | output: { 21 | path: config.build.assetsRoot, 22 | publicPath: process.env.NODE_ENV === 'production' 23 | ? config.build.assetsPublicPath 24 | : config.dev.assetsPublicPath, 25 | filename: '[name].js' 26 | }, 27 | resolve: { 28 | extensions: ['.js', '.vue', '.css', '.json'], 29 | alias: { 30 | // https://github.com/vuejs/vue/wiki/Vue-2.0-RC-Starter-Resources 31 | // vue: 'vue/dist/vue', 32 | package: path.resolve(__dirname, '../package.json'), 33 | src: path.resolve(__dirname, '../client'), 34 | assets: path.resolve(__dirname, '../client/assets'), 35 | components: path.resolve(__dirname, '../client/components'), 36 | views: path.resolve(__dirname, '../client/views'), 37 | // third-party 38 | 'plotly.js': 'plotly.js/dist/plotly', 39 | // vue-addon 40 | 'vuex-store': path.resolve(__dirname, '../client/store') 41 | } 42 | }, 43 | module: { 44 | loaders: [ 45 | { 46 | test: /\.(js|vue)$/, 47 | loader: 'eslint-loader', 48 | include: projectRoot, 49 | exclude: /node_modules/, 50 | enforce: 'pre', 51 | options: { 52 | formatter: require('eslint-friendly-formatter') 53 | } 54 | }, 55 | { 56 | test: /\.vue$/, 57 | loader: 'vue-loader', 58 | options: require('./vue-loader.conf') 59 | }, 60 | { 61 | test: /\.js$/, 62 | loader: 'babel-loader', 63 | include: projectRoot, 64 | // /node_modules\/(?!vue-bulma-.*)/ 65 | exclude: [new RegExp(`node_modules\\${path.sep}(?!vue-bulma-.*)`)] 66 | }, 67 | { 68 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 69 | loader: 'url-loader', 70 | query: { 71 | limit: 10000, 72 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 73 | } 74 | }, 75 | { 76 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 77 | loader: 'url-loader', 78 | query: { 79 | limit: 10000, 80 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 81 | } 82 | } 83 | ] 84 | }, 85 | // See https://github.com/webpack/webpack/issues/3486 86 | performance: { 87 | hints: false 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const webpack = require('webpack') 4 | const merge = require('webpack-merge') 5 | const HtmlWebpackPlugin = require('html-webpack-plugin') 6 | const baseWebpackConfig = require('./webpack.base.conf') 7 | const config = require('../config') 8 | const utils = require('./utils') 9 | 10 | // add hot-reload related code to entry chunks 11 | Object.keys(baseWebpackConfig.entry).forEach(name => { 12 | baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name]) 13 | }) 14 | 15 | module.exports = merge(baseWebpackConfig, { 16 | module: { 17 | loaders: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap }) 18 | }, 19 | // eval-source-map is faster for development 20 | devtool: '#eval-source-map', 21 | plugins: [ 22 | new webpack.DefinePlugin({ 23 | 'process.env': config.dev.env 24 | }), 25 | // https://github.com/glenjamin/webpack-hot-middleware#installation--usage 26 | new webpack.HotModuleReplacementPlugin(), 27 | new webpack.NoEmitOnErrorsPlugin(), 28 | // extract vendor chunks for better caching 29 | new webpack.optimize.CommonsChunkPlugin({ 30 | name: 'vendor', 31 | filename: 'vendor.js' 32 | }), 33 | // https://github.com/ampedandwired/html-webpack-plugin 34 | new HtmlWebpackPlugin({ 35 | title: 'Vue Admin', 36 | filename: 'index.html', 37 | template: 'index.html', 38 | inject: true, 39 | favicon: 'client/assets/logo.png' 40 | }) 41 | ] 42 | }) 43 | -------------------------------------------------------------------------------- /build/webpack.prod.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const path = require('path') 4 | const webpack = require('webpack') 5 | const merge = require('webpack-merge') 6 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 7 | const HtmlWebpackPlugin = require('html-webpack-plugin') 8 | const baseWebpackConfig = require('./webpack.base.conf') 9 | const config = require('../config') 10 | const utils = require('./utils') 11 | const env = process.env.NODE_ENV === 'testing' 12 | ? require('../config/test.env') 13 | : config.build.env 14 | const isELECTRON = process.env.NODE_ELECTRON === 'true' 15 | 16 | const webpackConfig = merge(baseWebpackConfig, { 17 | module: { 18 | loaders: utils.styleLoaders({ 19 | sourceMap: config.build.productionSourceMap, 20 | extract: true 21 | }) 22 | }, 23 | devtool: config.build.productionSourceMap ? '#source-map' : false, 24 | output: { 25 | path: config.build.assetsRoot, 26 | publicPath: isELECTRON ? path.join(__dirname, '../dist/') : config.build.assetsPublicPath, 27 | filename: utils.assetsPath('js/[name].[chunkhash].js'), 28 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') 29 | }, 30 | plugins: [ 31 | // http://vuejs.github.io/vue-loader/workflow/production.html 32 | new webpack.DefinePlugin({ 33 | 'process.env': env 34 | }), 35 | new webpack.LoaderOptionsPlugin({ 36 | minimize: true 37 | }), 38 | new webpack.optimize.UglifyJsPlugin({ 39 | 'screw-ie8': true, 40 | sourceMap: true, 41 | compress: { 42 | warnings: false 43 | }, 44 | output: { 45 | comments: false 46 | } 47 | }), 48 | // extract css into its own file 49 | new ExtractTextPlugin(utils.assetsPath('css/[name].[contenthash].css')), 50 | // generate dist index.html with correct asset hash for caching. 51 | // you can customize output by editing /index.html 52 | // see https://github.com/ampedandwired/html-webpack-plugin 53 | new HtmlWebpackPlugin({ 54 | title: 'Vue Admin', 55 | filename: process.env.NODE_ENV === 'testing' 56 | ? 'index.html' 57 | : config.build.index, 58 | template: 'index.html', 59 | inject: true, 60 | favicon: 'client/assets/logo.png', 61 | minify: { 62 | removeComments: true, 63 | collapseWhitespace: true, 64 | removeAttributeQuotes: true 65 | // more options: 66 | // https://github.com/kangax/html-minifier#options-quick-reference 67 | }, 68 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin 69 | chunksSortMode: 'dependency' 70 | }), 71 | // split vendor js into its own file 72 | new webpack.optimize.CommonsChunkPlugin({ 73 | name: 'vendor', 74 | minChunks (module, count) { 75 | // any required modules inside node_modules are extracted to vendor 76 | return ( 77 | module.resource && 78 | /\.js$/.test(module.resource) && 79 | module.resource.indexOf( 80 | path.join(__dirname, '../node_modules') 81 | ) === 0 82 | ) 83 | } 84 | }), 85 | // extract webpack runtime and module manifest to its own file in order to 86 | // prevent vendor hash from being updated whenever app bundle is updated 87 | new webpack.optimize.CommonsChunkPlugin({ 88 | name: 'manifest', 89 | chunks: ['vendor'] 90 | }) 91 | ] 92 | }) 93 | 94 | if (config.build.productionGzip) { 95 | const CompressionWebpackPlugin = require('compression-webpack-plugin') 96 | 97 | webpackConfig.plugins.push( 98 | new CompressionWebpackPlugin({ 99 | asset: '[path].gz[query]', 100 | algorithm: 'gzip', 101 | test: new RegExp( 102 | '\\.(' + 103 | config.build.productionGzipExtensions.join('|') + 104 | ')$' 105 | ), 106 | threshold: 10240, 107 | minRatio: 0.8 108 | }) 109 | ) 110 | } 111 | 112 | module.exports = webpackConfig 113 | -------------------------------------------------------------------------------- /client/App.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 59 | 60 | 101 | -------------------------------------------------------------------------------- /client/app.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import * as firebase from 'firebase' 3 | import config from './firebase-setup/config' 4 | import axios from 'axios' 5 | import VueAxios from 'vue-axios' 6 | import VueAuth from '@websanova/vue-auth' 7 | import NProgress from 'vue-nprogress' 8 | import { sync } from 'vuex-router-sync' 9 | import App from './App.vue' 10 | import router from './router' 11 | import store from './store' 12 | import * as filters from './filters' 13 | import { TOGGLE_SIDEBAR } from 'vuex-store/mutation-types' 14 | import VeeValidate from 'vee-validate' 15 | import veeValidateConfig from './utils' 16 | // adding firebase to the Vue.prototype allows usage of firebase in your vue components by using this.$firebase 17 | Vue.prototype.$firebase = firebase.initializeApp(config) 18 | 19 | Vue.router = router 20 | 21 | Vue.use(VeeValidate, veeValidateConfig) 22 | Vue.use(VueAxios, axios) 23 | Vue.use(VueAuth, { 24 | auth: { 25 | request: function (req, token) { 26 | this.options.http._setHeaders.call(this, req, {Authorization: 'Bearer ' + token}) 27 | }, 28 | response: function (res) { 29 | // Get Token from response body 30 | return res.data 31 | } 32 | }, 33 | http: require('@websanova/vue-auth/drivers/http/axios.1.x.js'), 34 | router: require('@websanova/vue-auth/drivers/router/vue-router.2.x.js'), 35 | loginData: { url: 'http://localhost:6789/login', fetchUser: false }, 36 | refreshData: { enabled: false } 37 | }) 38 | 39 | Vue.use(NProgress) 40 | 41 | // Enable devtools 42 | Vue.config.devtools = true 43 | 44 | sync(store, router) 45 | 46 | const nprogress = new NProgress({ parent: '.nprogress-container' }) 47 | 48 | const { state } = store 49 | 50 | router.beforeEach((route, redirect, next) => { 51 | if (state.app.device.isMobile && state.app.sidebar.opened) { 52 | store.commit(TOGGLE_SIDEBAR, false) 53 | } 54 | // Check route meta to see if it requires basic auth 55 | if (route.matched.some(record => record.meta.requiresAuth)) { 56 | // this route requires auth, check if logged in 57 | // if not, redirect to login page. 58 | if (!store.state.auth.loggedIn) { 59 | next({ 60 | path: '/login-firebase', 61 | query: { redirect: route.fullPath } 62 | }) 63 | store.dispatch('setNotification', { 64 | 'message': 'You are not logged in.', 65 | 'type': 'danger' 66 | }) 67 | } else { 68 | next() 69 | } 70 | } else { 71 | next() // make sure to always call next()! 72 | } 73 | }) 74 | 75 | Object.keys(filters).forEach(key => { 76 | Vue.filter(key, filters[key]) 77 | }) 78 | 79 | const app = new Vue({ 80 | router, 81 | store, 82 | nprogress, 83 | ...App 84 | }) 85 | 86 | export { app, router, store } 87 | -------------------------------------------------------------------------------- /client/assets/480.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vue-bulma/vuexfire-admin/6cb43109ecbba31eb58822fa1c6bb2ab91a946d2/client/assets/480.gif -------------------------------------------------------------------------------- /client/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vue-bulma/vuexfire-admin/6cb43109ecbba31eb58822fa1c6bb2ab91a946d2/client/assets/logo.png -------------------------------------------------------------------------------- /client/assets/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | vue-admin 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /client/assets/logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vue-bulma/vuexfire-admin/6cb43109ecbba31eb58822fa1c6bb2ab91a946d2/client/assets/logo@2x.png -------------------------------------------------------------------------------- /client/assets/puff.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 19 | 20 | 21 | 28 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /client/components/layout/AppMain.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 54 | 55 | 81 | -------------------------------------------------------------------------------- /client/components/layout/FooterBar.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 33 | 34 | 53 | -------------------------------------------------------------------------------- /client/components/layout/Levelbar.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 80 | -------------------------------------------------------------------------------- /client/components/layout/Navbar.vue: -------------------------------------------------------------------------------- 1 | 36 | 37 | 75 | 76 | 141 | -------------------------------------------------------------------------------- /client/components/layout/Sidebar.vue: -------------------------------------------------------------------------------- 1 | 59 | 60 | 160 | 161 | 214 | -------------------------------------------------------------------------------- /client/components/layout/index.js: -------------------------------------------------------------------------------- 1 | export Navbar from './Navbar' 2 | 3 | export Sidebar from './Sidebar' 4 | 5 | export AppMain from './AppMain' 6 | 7 | export FooterBar from './FooterBar' 8 | -------------------------------------------------------------------------------- /client/components/ui/Notification.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 52 | 53 | 62 | -------------------------------------------------------------------------------- /client/components/ui/Notifications.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 41 | 42 | 74 | -------------------------------------------------------------------------------- /client/filters/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vue-bulma/vuexfire-admin/6cb43109ecbba31eb58822fa1c6bb2ab91a946d2/client/filters/index.js -------------------------------------------------------------------------------- /client/firebase-setup/config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | // Firebase Config 3 | apiKey: process.env.FB_API_KEY, 4 | authDomain: process.env.FB_AUTH_DOMAIN, 5 | databaseURL: process.env.FB_DATABASE_URL, 6 | projectId: process.env.FB_PROJECT_ID, 7 | storageBucket: process.env.FB_STORAGE_BUCKET, 8 | messagingSenderId: process.env.FB_MESSAGE_SENDER_ID 9 | } 10 | -------------------------------------------------------------------------------- /client/firebase-setup/ref-types.js: -------------------------------------------------------------------------------- 1 | // App 2 | export const NOTES = 'notes' 3 | export const MESSAGES = 'messages' 4 | -------------------------------------------------------------------------------- /client/index.js: -------------------------------------------------------------------------------- 1 | import { app } from './app' 2 | 3 | app.$mount('#app') 4 | -------------------------------------------------------------------------------- /client/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | import menuModule from 'vuex-store/modules/menu' 4 | Vue.use(Router) 5 | 6 | export default new Router({ 7 | mode: 'hash', // Demo is living in GitHub.io, so required! 8 | linkActiveClass: 'is-active', 9 | scrollBehavior: () => ({ y: 0 }), 10 | routes: [ 11 | { 12 | name: 'Home', 13 | path: '/', 14 | component: require('../views/Home') 15 | }, 16 | { 17 | name: 'Login', 18 | path: '/login', 19 | component: require('../views/auth/Login') 20 | }, 21 | { 22 | name: 'Login Firebase', 23 | path: '/login-firebase', 24 | component: require('../views/auth/LoginFirebase') 25 | }, 26 | ...generateRoutesFromMenu(menuModule.state.items), 27 | { 28 | path: '*', 29 | redirect: '/' 30 | } 31 | ] 32 | }) 33 | 34 | // Menu should have 2 levels. 35 | function generateRoutesFromMenu (menu = [], routes = []) { 36 | for (let i = 0, l = menu.length; i < l; i++) { 37 | let item = menu[i] 38 | if (item.path) { 39 | routes.push(item) 40 | } 41 | if (!item.component) { 42 | generateRoutesFromMenu(item.children, routes) 43 | } 44 | } 45 | return routes 46 | } 47 | -------------------------------------------------------------------------------- /client/store/actions.js: -------------------------------------------------------------------------------- 1 | import * as types from './mutation-types' 2 | 3 | export const toggleSidebar = ({ commit }, config) => { 4 | if (config instanceof Object) { 5 | commit(types.TOGGLE_SIDEBAR, config) 6 | } 7 | } 8 | 9 | export const toggleDevice = ({ commit }, device) => commit(types.TOGGLE_DEVICE, device) 10 | 11 | export const expandMenu = ({ commit }, menuItem) => { 12 | if (menuItem) { 13 | menuItem.expanded = menuItem.expanded || false 14 | commit(types.EXPAND_MENU, menuItem) 15 | } 16 | } 17 | 18 | export const switchEffect = ({ commit }, effectItem) => { 19 | if (effectItem) { 20 | commit(types.SWITCH_EFFECT, effectItem) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /client/store/getters.js: -------------------------------------------------------------------------------- 1 | const pkg = state => state.pkg 2 | const app = state => state.app 3 | const device = state => state.app.device 4 | const sidebar = state => state.app.sidebar 5 | const effect = state => state.app.effect 6 | const menuitems = state => state.menu.items 7 | const componententry = state => { 8 | return state.menu.items.filter(c => c.meta && c.meta.label === 'Components')[0] 9 | } 10 | 11 | export { 12 | pkg, 13 | app, 14 | device, 15 | sidebar, 16 | effect, 17 | menuitems, 18 | componententry 19 | } 20 | -------------------------------------------------------------------------------- /client/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | import {firebaseMutations} from 'vuexfire' 4 | // import { firebaseAction } from 'vuexfire' 5 | import pkg from 'package' 6 | import * as actions from './actions' 7 | import * as getters from './getters' 8 | import createPersistedState from 'vuex-persistedstate' 9 | // Modules 10 | import app from './modules/app' 11 | import menu from './modules/menu' 12 | import auth from './modules/auth' 13 | import notes from './modules/notes' 14 | import notifications from './modules/notifications' 15 | 16 | Vue.use(Vuex) 17 | 18 | const store = new Vuex.Store({ 19 | strict: true, // process.env.NODE_ENV !== 'production', 20 | actions, 21 | getters, 22 | modules: { 23 | app, 24 | menu, 25 | auth, 26 | notifications, 27 | notes 28 | }, 29 | state: { 30 | pkg 31 | }, 32 | plugins: [createPersistedState()], 33 | mutations: { 34 | ...firebaseMutations 35 | } 36 | }) 37 | 38 | export default store 39 | -------------------------------------------------------------------------------- /client/store/modules/app.js: -------------------------------------------------------------------------------- 1 | import * as types from '../mutation-types' 2 | 3 | const state = { 4 | device: { 5 | isMobile: false, 6 | isTablet: false 7 | }, 8 | sidebar: { 9 | opened: false, 10 | hidden: false 11 | }, 12 | effect: { 13 | translate3d: true 14 | } 15 | } 16 | 17 | const mutations = { 18 | [types.TOGGLE_DEVICE] (state, device) { 19 | state.device.isMobile = device === 'mobile' 20 | state.device.isTablet = device === 'tablet' 21 | }, 22 | 23 | [types.TOGGLE_SIDEBAR] (state, config) { 24 | if (state.device.isMobile && config.hasOwnProperty('opened')) { 25 | state.sidebar.opened = config.opened 26 | } else { 27 | state.sidebar.opened = true 28 | } 29 | 30 | if (config.hasOwnProperty('hidden')) { 31 | state.sidebar.hidden = config.hidden 32 | } 33 | }, 34 | 35 | [types.SWITCH_EFFECT] (state, effectItem) { 36 | for (let name in effectItem) { 37 | state.effect[name] = effectItem[name] 38 | } 39 | } 40 | } 41 | 42 | export default { 43 | state, 44 | mutations 45 | } 46 | -------------------------------------------------------------------------------- /client/store/modules/auth/getters.js: -------------------------------------------------------------------------------- 1 | const user = state => state.user 2 | const authProviders = state => state.user.authProviders 3 | const passwordAuthLinkingPending = state => state.user.authProviders.password.pending 4 | const authStatus = state => state.loggedIn 5 | const authUI = state => state.UI 6 | const reAuthRequired = state => state.UI.reAuthRequired 7 | const reAuthTriggeredBy = state => state.reAuth.reAuthTriggeredBy 8 | const reAuthInfo = state => state.reAuth.info 9 | 10 | export { 11 | user, 12 | authProviders, 13 | authStatus, 14 | authUI, 15 | passwordAuthLinkingPending, 16 | reAuthRequired, 17 | reAuthTriggeredBy, 18 | reAuthInfo 19 | } 20 | -------------------------------------------------------------------------------- /client/store/modules/auth/utils.js: -------------------------------------------------------------------------------- 1 | import firebase from 'firebase' 2 | import store from '../../../store' 3 | // 4 | // 5 | // Functions and Helpers for auth store. 6 | 7 | // 8 | // Check if a user exists in the /users ref 9 | // 10 | const checkUserExists = function (userId) { 11 | var ref = firebase.database().ref('users/' + userId) 12 | 13 | var checkUserId = ref.once('value') 14 | .then(function (snapshot) { 15 | var userIdInDatabase = snapshot.hasChild('uid') // true 16 | console.log(userIdInDatabase) 17 | if (userIdInDatabase) { 18 | // console.log('User Database Record:') 19 | // console.log(snapshot.child(userId).val()) 20 | return true 21 | } else { 22 | // console.log('User Database Record:') 23 | // console.log(snapshot.child(userId).val()) 24 | return false 25 | } 26 | }) 27 | // console.log(checkUserId) 28 | checkUserId.then(function (result) { 29 | // console.log(result) 30 | store.dispatch('setNotification', { 31 | type: 'primary', 32 | message: 'checkUserExists(): ' + result 33 | }) 34 | return result 35 | }) 36 | // if (checkUserId) { 37 | // return true 38 | // } else { 39 | // return false 40 | // } 41 | } 42 | 43 | // Function to call if access denied. 44 | function onReject (rejection) { 45 | store.dispatch('setNotification', { 46 | type: 'danger', 47 | message: rejection.message 48 | }) 49 | } 50 | 51 | export { 52 | checkUserExists, 53 | onReject 54 | } 55 | -------------------------------------------------------------------------------- /client/store/modules/menu/components.js: -------------------------------------------------------------------------------- 1 | import lazyLoading from './lazyLoading' 2 | 3 | export default { 4 | path: '/components', 5 | meta: { 6 | icon: 'fa-building-o', 7 | expanded: false, 8 | label: 'Components' 9 | }, 10 | component: lazyLoading('components', true), 11 | 12 | children: [ 13 | { 14 | name: 'Components', 15 | path: '', 16 | component: lazyLoading('components/Default'), 17 | meta: { 18 | link: 'components/Default.vue' 19 | } 20 | }, 21 | { 22 | name: 'BackToTop', 23 | path: 'backToTop', 24 | meta: { 25 | description: 'Jump component is based on jump.js', 26 | repository: 'https://github.com/vue-bulma/jump', 27 | link: 'components/BackToTop.vue' 28 | }, 29 | component: lazyLoading('components/BackToTop') 30 | }, 31 | { 32 | name: 'Brace', 33 | path: 'brace', 34 | meta: { 35 | description: 'Code editor component that based on brace', 36 | repository: 'https://github.com/vue-bulma/brace', 37 | link: 'components/Brace.vue' 38 | }, 39 | component: lazyLoading('components/Brace') 40 | }, 41 | { 42 | name: 'Collapse', 43 | path: 'collapse', 44 | meta: { 45 | description: 'Collapse component', 46 | repository: 'https://github.com/vue-bulma/collapse', 47 | link: 'components/Collapse.vue' 48 | }, 49 | component: lazyLoading('components/Collapse') 50 | }, 51 | { 52 | name: 'Datepicker', 53 | path: 'datepicker', 54 | meta: { 55 | description: 'Datepicker component is based on flatpickr', 56 | repository: 'https://github.com/vue-bulma/datepicker', 57 | link: 'components/Datepicker.vue' 58 | }, 59 | component: lazyLoading('components/Datepicker') 60 | }, 61 | { 62 | name: 'Emoji', 63 | path: 'emoji', 64 | meta: { 65 | description: 'Emoji Component is based on emojione.com', 66 | repository: 'https://github.com/vue-bulma/emoji', 67 | link: 'components/Emoji.vue' 68 | }, 69 | component: lazyLoading('components/Emoji') 70 | }, 71 | { 72 | name: 'Message', 73 | path: 'message', 74 | meta: { 75 | description: 'Message component', 76 | repository: 'https://github.com/vue-bulma/message', 77 | link: 'components/Message.vue' 78 | }, 79 | component: lazyLoading('components/Message') 80 | }, 81 | { 82 | name: 'Modal', 83 | path: 'modal', 84 | meta: { 85 | description: 'Modal component', 86 | repository: 'https://github.com/vue-bulma/modal', 87 | link: 'components/Modal.vue' 88 | }, 89 | component: lazyLoading('components/Modal') 90 | }, 91 | { 92 | name: 'Notification', 93 | path: 'notification', 94 | meta: { 95 | description: 'Notification component', 96 | repository: 'https://github.com/vue-bulma/notification', 97 | link: 'components/Notification.vue' 98 | }, 99 | component: lazyLoading('components/Notification') 100 | }, 101 | { 102 | name: 'ProgressBar', 103 | path: 'progress-bar', 104 | meta: { 105 | description: 'ProgressBar component', 106 | repository: 'https://github.com/vue-bulma/progress-bar', 107 | link: 'components/ProgressBar.vue' 108 | }, 109 | component: lazyLoading('components/ProgressBar') 110 | }, 111 | { 112 | name: 'ProgressTracker', 113 | path: 'progress-tracker', 114 | meta: { 115 | description: 'ProgressTracker component is based on progress-tracker', 116 | repository: 'https://github.com/vue-bulma/progress-tracker', 117 | link: 'components/ProgressTracker.vue' 118 | }, 119 | component: lazyLoading('components/ProgressTracker') 120 | }, 121 | { 122 | name: 'Quill', 123 | path: 'quill', 124 | meta: { 125 | description: 'Your powerful, rich text editor', 126 | repository: 'https://github.com/vue-bulma/quill', 127 | link: 'components/Quill.vue' 128 | }, 129 | component: lazyLoading('components/Quill') 130 | }, 131 | { 132 | name: 'Rating', 133 | path: 'rating', 134 | meta: { 135 | description: 'Rating component is based on starability.css', 136 | repository: 'https://github.com/vue-bulma/rating', 137 | link: 'components/Rating.vue' 138 | }, 139 | component: lazyLoading('components/Rating') 140 | }, 141 | { 142 | name: 'Slider', 143 | path: 'slider', 144 | meta: { 145 | description: 'Slider component', 146 | repository: 'https://github.com/vue-bulma/slider', 147 | link: 'components/Slider.vue' 148 | }, 149 | component: lazyLoading('components/Slider') 150 | }, 151 | { 152 | name: 'Switch', 153 | path: 'switch', 154 | meta: { 155 | description: 'Switch component', 156 | repository: 'https://github.com/vue-bulma/switch', 157 | link: 'components/Switch.vue' 158 | }, 159 | component: lazyLoading('components/Switch') 160 | }, 161 | { 162 | name: 'Tabs', 163 | path: 'tabs', 164 | meta: { 165 | description: 'Tabs component', 166 | repository: 'https://github.com/vue-bulma/tabs', 167 | link: 'components/Tabs.vue' 168 | }, 169 | component: lazyLoading('components/Tabs') 170 | }, 171 | { 172 | name: 'Tooltip', 173 | path: 'tooltip', 174 | meta: { 175 | description: 'Tooltip component is based on hint.css', 176 | repository: 'https://github.com/vue-bulma/tooltip', 177 | link: 'components/Tooltip.vue' 178 | }, 179 | component: lazyLoading('components/Tooltip') 180 | }, 181 | { 182 | name: 'Lory', 183 | path: 'lory', 184 | meta: { 185 | description: 'Slider component is based on lory, lory: ☀ Touch enabled minimalistic slider', 186 | repository: 'https://github.com/vue-bulma/lory', 187 | link: 'components/Lory.vue' 188 | }, 189 | component: lazyLoading('components/Lory') 190 | } 191 | ] 192 | } 193 | -------------------------------------------------------------------------------- /client/store/modules/menu/index.js: -------------------------------------------------------------------------------- 1 | import * as types from '../../mutation-types' 2 | import lazyLoading from './lazyLoading' 3 | import uifeatures from './uifeatures' 4 | import components from './components' 5 | import tables from './tables' 6 | 7 | // show: meta.label -> name 8 | // name: component name 9 | // meta.label: display label 10 | 11 | const state = { 12 | items: [ 13 | { 14 | name: 'User', 15 | path: '/user', 16 | meta: { 17 | icon: 'fa-user', 18 | link: 'user/index.vue', 19 | requiresAuth: true 20 | }, 21 | component: lazyLoading('user', true) 22 | }, 23 | { 24 | name: 'Dashboard', 25 | path: '/dashboard', 26 | meta: { 27 | icon: 'fa-tachometer', 28 | link: 'dashboard/index.vue' 29 | }, 30 | component: lazyLoading('dashboard', true) 31 | }, 32 | { 33 | name: 'Axios', 34 | path: '/axiosDemo', 35 | meta: { 36 | auth: true, 37 | icon: 'fa-rocket', 38 | link: 'axios/index.vue' 39 | }, 40 | component: lazyLoading('axios', true) 41 | }, 42 | uifeatures, 43 | components, 44 | tables 45 | ] 46 | } 47 | 48 | const mutations = { 49 | [types.EXPAND_MENU] (state, menuItem) { 50 | if (menuItem.index > -1) { 51 | if (state.items[menuItem.index] && state.items[menuItem.index].meta) { 52 | state.items[menuItem.index].meta.expanded = menuItem.expanded 53 | } 54 | } else if (menuItem.item && 'expanded' in menuItem.item.meta) { 55 | menuItem.item.meta.expanded = menuItem.expanded 56 | } 57 | } 58 | } 59 | 60 | export default { 61 | state, 62 | mutations 63 | } 64 | -------------------------------------------------------------------------------- /client/store/modules/menu/lazyLoading.js: -------------------------------------------------------------------------------- 1 | // lazy loading Components 2 | // https://github.com/vuejs/vue-router/blob/dev/examples/lazy-loading/app.js#L8 3 | export default (name, index = false) => () => import(`views/${name}${index ? '/index' : ''}.vue`) 4 | -------------------------------------------------------------------------------- /client/store/modules/menu/tables.js: -------------------------------------------------------------------------------- 1 | import lazyLoading from './lazyLoading' 2 | 3 | export default { 4 | name: 'Tables', 5 | meta: { 6 | icon: 'fa-table', 7 | expanded: false 8 | }, 9 | 10 | children: [ 11 | { 12 | name: 'BasicTables', 13 | path: '/tables/basic', 14 | meta: { 15 | label: 'Basic Tables', 16 | link: 'tables/Basic.vue' 17 | }, 18 | component: lazyLoading('tables/Basic') 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /client/store/modules/menu/uifeatures.js: -------------------------------------------------------------------------------- 1 | import lazyLoading from './lazyLoading' 2 | 3 | export default { 4 | meta: { 5 | label: 'UI Features', 6 | icon: 'fa-laptop', 7 | expanded: false 8 | }, 9 | 10 | children: [ 11 | { 12 | name: 'Buttons', 13 | path: '/buttons', 14 | meta: { 15 | link: 'ui/Buttons.vue' 16 | }, 17 | component: lazyLoading('ui/Buttons') 18 | }, 19 | { 20 | name: 'Form', 21 | path: '/form', 22 | meta: { 23 | link: 'ui/Form.vue' 24 | }, 25 | component: lazyLoading('ui/Form') 26 | }, 27 | { 28 | name: 'Typography', 29 | path: '/typography', 30 | meta: { 31 | link: 'ui/Typography.vue' 32 | }, 33 | component: lazyLoading('ui/Typography') 34 | }, 35 | { 36 | name: 'Icons', 37 | path: '/icons', 38 | meta: { 39 | link: 'ui/Icons.vue' 40 | }, 41 | component: lazyLoading('ui/Icons') 42 | } 43 | ] 44 | } 45 | -------------------------------------------------------------------------------- /client/store/modules/notes/getters.js: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /client/store/modules/notes/index.js: -------------------------------------------------------------------------------- 1 | import { firebaseAction } from 'vuexfire' 2 | import * as types from '../../mutation-types' 3 | import * as firebase from 'firebase' 4 | import * as refTypes from '../../../firebase-setup/ref-types' 5 | // Firebase Setup 6 | 7 | // Set Messages refx 8 | const state = { 9 | notes: [], 10 | newNote: {}, 11 | newNoteContents: {}, 12 | UI: { 13 | loading: false 14 | } 15 | } 16 | 17 | const mutations = { 18 | [types.SET_NEW_NOTE_CONTENTS] (state, noteContents) { 19 | state.newNoteContents = noteContents 20 | }, 21 | [types.SET_NEW_NOTE] (state, note) { 22 | state.newNote = note 23 | }, 24 | [types.ADD_NOTE] (state, note) { 25 | state.notes.push(note) 26 | }, 27 | [types.NOTES_LOADING] (state, isLoading) { 28 | state.UI.loading = isLoading 29 | } 30 | } 31 | 32 | const getters = { 33 | newNote: state => state.newNote, 34 | newNoteContents: state => state.newNoteContents, 35 | notes: state => state.notes, 36 | loadingNotes: state => state.UI.loading 37 | } 38 | 39 | const actions = { 40 | // On change of add note input, calls GET_NOTE mutation with data from add not input 41 | setNoteContents ({commit}, noteContents) { 42 | commit(types.SET_NEW_NOTE_CONTENTS, noteContents) 43 | }, 44 | setNewNote ({commit}, note) { 45 | commit(types.SET_NEW_NOTE, note) 46 | }, 47 | isLoading ({commit, state}) { 48 | var notesInStore = state.notes 49 | if (notesInStore === undefined || notesInStore.length === 0) { 50 | commit(types.NOTES_LOADING, true) 51 | } else { 52 | commit(types.NOTES_LOADING, false) 53 | } 54 | }, 55 | addNote ({commit, getters, state}) { 56 | var uid = getters.user.uid 57 | var userNotes = firebase.database().ref(refTypes.NOTES).child(uid) 58 | // Push to firebase 59 | userNotes.push({ 60 | title: state.newNote.title, 61 | text: state.newNoteContents, 62 | completed: false 63 | }) 64 | }, 65 | removeNote ({commit, getters}, note) { 66 | var uid = getters.user.uid 67 | var notes = firebase.database().ref(refTypes.NOTES).child(uid) 68 | notes.child(note['.key']).remove() 69 | }, 70 | setNotesRef: firebaseAction(({ bindFirebaseRef, rootState }, ref) => { 71 | bindFirebaseRef(refTypes.NOTES, ref) 72 | }), 73 | initNotesRef ({dispatch, rootState}) { // Init notes ref in App.vue 74 | dispatch('isLoading') 75 | // var userNotes = firebase.database().ref(refTypes.NOTES) 76 | // firebase.database().ref(refTypes.NOTES).orderByChild('uid').equalTo(rootState.auth.user.uid).once('value', function (snapshot) { 77 | // console.log(snapshot.val()) 78 | // }) 79 | // var userNotes = firebase.database().ref(refTypes.NOTES) 80 | var userNotes = firebase.database().ref(refTypes.NOTES).child(rootState.auth.user.uid) 81 | console.log(rootState.auth.user.uid) 82 | dispatch('setNotesRef', userNotes) 83 | dispatch('isLoading') 84 | } 85 | } 86 | 87 | export default { 88 | state, 89 | mutations, 90 | actions, 91 | getters 92 | } 93 | -------------------------------------------------------------------------------- /client/store/modules/notes/utils.js: -------------------------------------------------------------------------------- 1 | // import firebase from 'firebase' 2 | // import store from '../../../store' 3 | -------------------------------------------------------------------------------- /client/store/modules/notifications.js: -------------------------------------------------------------------------------- 1 | import * as types from '../mutation-types' 2 | import {generateUuid} from './utils' 3 | 4 | // State 5 | const state = { 6 | items: [], 7 | defaultNotifications: { 8 | loggedInMessage: { 9 | id: 'loggedInMessage', 10 | message: 'You\'re logged in.', 11 | type: 'primary', 12 | duration: 5000 13 | }, 14 | loggedOutMessage: { 15 | id: 'loggedInMessage', 16 | message: 'You\'re logged out.', 17 | type: 'primary', 18 | duration: 5000 19 | }, 20 | reAuthenticated: { 21 | id: 'reAuthenticated', 22 | message: 'You have been reauthenticated.', 23 | type: 'primary', 24 | duration: 5000 25 | }, 26 | reAuthSuccess: { 27 | id: 'reAuthSuccess', 28 | message: 'You have been reauthenticated.', 29 | type: 'primary', 30 | duration: 5000 31 | }, 32 | accountExistsDifferentWithCredential: { 33 | id: 'accountExistsDifferentWithCredential', 34 | message: 'You have already signed up with a different auth provider for that email.', 35 | type: 'danger', 36 | duration: 5000 37 | } 38 | } 39 | } 40 | 41 | // Mutations 42 | const mutations = { 43 | [types.SET_NOTIFICATION] (state, notification) { 44 | state.items.push(notification) 45 | }, 46 | [types.DISMISS_NOTIFICATION] (state) { 47 | state.show = false 48 | }, 49 | [types.DESTROY_NOTIFICATION] (state, notification) { 50 | var index = state.items.indexOf(notification) 51 | if (index > -1) { 52 | state.items.splice(index, 1) 53 | } 54 | } 55 | } 56 | 57 | // Getters 58 | const getters = { 59 | notifications: (state) => state.items, 60 | defaultNotifications: (state) => state.defaultNotifications 61 | } 62 | 63 | // Actions 64 | const actions = { 65 | setNotification ({dispatch, commit}, {message, type, uuid, duration}) { 66 | commit(types.SET_NOTIFICATION, {message: message, type: type, id: generateUuid(), duration: duration}) 67 | }, 68 | dismissNotification ({commit}) { 69 | commit(types.DISMISS_NOTIFICATION) 70 | }, 71 | destroyNotification ({commit}, notification) { 72 | commit(types.DESTROY_NOTIFICATION, notification) 73 | } 74 | } 75 | 76 | // Export 77 | export default { 78 | state, 79 | mutations, 80 | getters, 81 | actions 82 | } 83 | -------------------------------------------------------------------------------- /client/store/modules/utils.js: -------------------------------------------------------------------------------- 1 | // Util - Generate UUID 2 | var lut = []; for (var i = 0; i < 256; i++) { lut[i] = (i < 16 ? '0' : '') + (i).toString(16) } 3 | 4 | const generateUuid = function () { 5 | var dvals = new Uint32Array(4) 6 | window.crypto.getRandomValues(dvals) 7 | var d0 = dvals[0] 8 | var d1 = dvals[1] 9 | var d2 = dvals[2] 10 | var d3 = dvals[3] 11 | return lut[d0 & 0xff] + lut[d0 >> 8 & 0xff] + lut[d0 >> 16 & 0xff] + lut[d0 >> 24 & 0xff] + '-' + 12 | lut[d1 & 0xff] + lut[d1 >> 8 & 0xff] + '-' + lut[d1 >> 16 & 0x0f | 0x40] + lut[d1 >> 24 & 0xff] + '-' + 13 | lut[d2 & 0x3f | 0x80] + lut[d2 >> 8 & 0xff] + '-' + lut[d2 >> 16 & 0xff] + lut[d2 >> 24 & 0xff] + lut[d3 & 0xff] + lut[d3 >> 8 & 0xff] + lut[d3 >> 16 & 0xff] + lut[d3 >> 24 & 0xff] 14 | } 15 | 16 | export { generateUuid } 17 | -------------------------------------------------------------------------------- /client/store/mutation-types.js: -------------------------------------------------------------------------------- 1 | // App 2 | export const TOGGLE_DEVICE = 'TOGGLE_DEVICE' 3 | export const TOGGLE_SIDEBAR = 'TOGGLE_SIDEBAR' 4 | export const EXPAND_MENU = 'EXPAND_MENU' 5 | export const SWITCH_EFFECT = 'SWITCH_EFFECT' 6 | // Auth 7 | export const SET_USER = 'SET_USER' 8 | export const SET_LOGGED_IN = 'SET_LOGGED_IN' 9 | export const SET_UI_LOGIN_DISABLED = 'SET_UI_LOGIN_DISABLED' 10 | export const SET_UI_LOGIN_BTN_TEXT = 'SET_UI_LOGIN_BTN_TEXT' 11 | export const SET_AUTH_PENDING = 'SET_AUTH_PENDING' 12 | export const SET_USERS_LINKED_AUTH_PROVIDERS = 'SET_USERS_LINKED_AUTH_PROVIDERS' 13 | export const SET_PASSWORD_AUTH_LINKING_PENDING = 'SET_PASSWORD_AUTH_LINKING_PENDING' 14 | export const UNLINK_AUTH_PROVIDER = 'UNLINK_AUTH_PROVIDER' 15 | export const REAUTH_REQUIRED = 'REAUTH_REQUIRED' 16 | export const REAUTH_TRIGGERED_BY = 'REAUTH_TRIGGERED_BY' 17 | export const REAUTH_INFO = 'REAUTH_INFO' 18 | // Notices 19 | export const SET_ERROR = 'SET_ERROR' 20 | export const SET_NOTIFICATION = 'SET_NOTIFICATION' 21 | export const DISMISS_NOTIFICATION = 'DISMISS_NOTIFICATION' 22 | export const DESTROY_NOTIFICATION = 'DESTROY_NOTIFICATION' 23 | // Notes 24 | export const SET_NEW_NOTE = 'SET_NEW_NOTE' 25 | export const SET_NEW_NOTE_CONTENTS = 'SET_NEW_NOTE_CONTENTS' 26 | export const ADD_NOTE = 'ADD_NOTE' 27 | export const GET_NEW_NOTE = 'GET_NEW_NOTE' 28 | export const GET_NOTE = 'GET_NOTE' 29 | export const NOTES_LOADING = 'NOTES_LOADING' 30 | -------------------------------------------------------------------------------- /client/utils/index.js: -------------------------------------------------------------------------------- 1 | const veeValidateConfig = { 2 | errorBagName: 'errors', // change if property conflicts. 3 | fieldsBagName: 'fields', 4 | delay: 0, 5 | locale: 'en', 6 | dictionary: null, 7 | strict: true, 8 | enableAutoClasses: false, 9 | classNames: { 10 | touched: 'touched', // the control has been blurred 11 | untouched: 'untouched', // the control hasn't been blurred 12 | valid: 'valid', // model is valid 13 | invalid: 'invalid', // model is invalid 14 | pristine: 'pristine', // control has not been interacted with 15 | dirty: 'dirty' // control has been interacted with 16 | }, 17 | events: 'input|blur', 18 | inject: true 19 | } 20 | 21 | export default { 22 | veeValidateConfig 23 | } 24 | -------------------------------------------------------------------------------- /client/views/Home.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 27 | 28 | 33 | -------------------------------------------------------------------------------- /client/views/auth/Login.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | 100 | 101 | 106 | -------------------------------------------------------------------------------- /client/views/auth/LoginFirebase.vue: -------------------------------------------------------------------------------- 1 | 57 | 58 | 120 | 121 | 148 | -------------------------------------------------------------------------------- /client/views/auth/UserPassForm.vue: -------------------------------------------------------------------------------- 1 | 55 | 56 | 91 | 92 | 94 | -------------------------------------------------------------------------------- /client/views/axios/index.vue: -------------------------------------------------------------------------------- 1 | 68 | 69 | 153 | 154 | 156 | -------------------------------------------------------------------------------- /client/views/components/BackToTop.vue: -------------------------------------------------------------------------------- 1 | 48 | 49 | 58 | -------------------------------------------------------------------------------- /client/views/components/Brace.vue: -------------------------------------------------------------------------------- 1 | 115 | 116 | 157 | 158 | 166 | -------------------------------------------------------------------------------- /client/views/components/Collapse.vue: -------------------------------------------------------------------------------- 1 | 75 | 76 | 86 | 87 | 92 | -------------------------------------------------------------------------------- /client/views/components/Default.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 70 | -------------------------------------------------------------------------------- /client/views/components/Emoji.vue: -------------------------------------------------------------------------------- 1 | 49 | 50 | 62 | 63 | 80 | -------------------------------------------------------------------------------- /client/views/components/Lory.vue: -------------------------------------------------------------------------------- 1 | 142 | 143 | 155 | 156 | 170 | -------------------------------------------------------------------------------- /client/views/components/Message.vue: -------------------------------------------------------------------------------- 1 | 41 | 42 | 88 | 89 | 98 | -------------------------------------------------------------------------------- /client/views/components/Modal.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 93 | 94 | 96 | -------------------------------------------------------------------------------- /client/views/components/Notification.vue: -------------------------------------------------------------------------------- 1 | 41 | 42 | 87 | 88 | 97 | -------------------------------------------------------------------------------- /client/views/components/ProgressBar.vue: -------------------------------------------------------------------------------- 1 | 53 | 54 | 82 | 83 | 88 | -------------------------------------------------------------------------------- /client/views/components/ProgressTracker.vue: -------------------------------------------------------------------------------- 1 | 74 | 75 | 108 | 109 | 114 | -------------------------------------------------------------------------------- /client/views/components/Quill.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 31 | 32 | 36 | -------------------------------------------------------------------------------- /client/views/components/Rating.vue: -------------------------------------------------------------------------------- 1 | 47 | 48 | 92 | 93 | 101 | -------------------------------------------------------------------------------- /client/views/components/Slider.vue: -------------------------------------------------------------------------------- 1 | 69 | 70 | 100 | 101 | 112 | -------------------------------------------------------------------------------- /client/views/components/Switch.vue: -------------------------------------------------------------------------------- 1 | 66 | 67 | 90 | 91 | 102 | -------------------------------------------------------------------------------- /client/views/components/Tabs.vue: -------------------------------------------------------------------------------- 1 | 123 | 124 | 174 | 175 | 183 | -------------------------------------------------------------------------------- /client/views/components/Tooltip.vue: -------------------------------------------------------------------------------- 1 | 151 | 152 | 161 | 162 | 175 | -------------------------------------------------------------------------------- /client/views/components/index.vue: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /client/views/components/modals/CardModal.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 39 | -------------------------------------------------------------------------------- /client/views/components/modals/ImageModal.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 27 | -------------------------------------------------------------------------------- /client/views/components/modals/Modal.vue: -------------------------------------------------------------------------------- 1 | 36 | 37 | 56 | -------------------------------------------------------------------------------- /client/views/dashboard/index.vue: -------------------------------------------------------------------------------- 1 | 107 | 108 | 153 | 154 | 156 | -------------------------------------------------------------------------------- /client/views/ui/Buttons.vue: -------------------------------------------------------------------------------- 1 | 180 | 181 | 183 | 184 | 189 | -------------------------------------------------------------------------------- /client/views/ui/Icons.vue: -------------------------------------------------------------------------------- 1 | 59 | 60 | 64 | -------------------------------------------------------------------------------- /client/views/ui/Typography.vue: -------------------------------------------------------------------------------- 1 | 50 | 51 | 53 | -------------------------------------------------------------------------------- /client/views/user/LinkedAccounts.vue: -------------------------------------------------------------------------------- 1 | 56 | 57 | 100 | 101 | 127 | -------------------------------------------------------------------------------- /client/views/user/NewNoteForm.vue: -------------------------------------------------------------------------------- 1 | 34 | 35 | 84 | 85 | 90 | -------------------------------------------------------------------------------- /client/views/user/Notes.vue: -------------------------------------------------------------------------------- 1 | 95 | 96 | 157 | 158 | 178 | -------------------------------------------------------------------------------- /client/views/user/PassForm.vue: -------------------------------------------------------------------------------- 1 | 41 | 42 | 69 | 70 | 72 | -------------------------------------------------------------------------------- /client/views/user/index.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 60 | 61 | 64 | -------------------------------------------------------------------------------- /client/views/user/modals/ReAuthenticate.vue: -------------------------------------------------------------------------------- 1 | 47 | 48 | 101 | 102 | 120 | -------------------------------------------------------------------------------- /config/dev.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const merge = require('webpack-merge') 4 | const prodEnv = require('./prod.env') 5 | 6 | module.exports = merge(prodEnv, { 7 | NODE_ENV: '"development"' 8 | }) 9 | -------------------------------------------------------------------------------- /config/firebase.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | NODE_ENV: '"production"', 5 | FB_DATABASE_URL: '"https://vuexfire-admin-demo.firebaseio.com"', 6 | FB_PROJECT_ID: '"vuexfire-admin-demo"', 7 | FB_API_KEY: '"AIzaSyCBq2L-MzdNlxhNS8jeYa5-CyFXSFIKcAw"', 8 | FB_AUTH_DOMAIN: '"vuexfire-admin-demo.firebaseapp.com"', 9 | FB_STORAGE_BUCKET: '"vuexfire-admin-demo.appspot.com"', 10 | FB_MESSAGE_SENDER_ID: '"639997901163"' 11 | } 12 | -------------------------------------------------------------------------------- /config/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | // see http://vuejs-templates.github.io/webpack for documentation. 4 | const path = require('path') 5 | 6 | module.exports = { 7 | build: { 8 | env: require('./prod.env'), 9 | index: path.resolve(__dirname, '../dist/index.html'), 10 | assetsRoot: path.resolve(__dirname, '../dist'), 11 | assetsSubDirectory: 'assets', 12 | assetsPublicPath: '/', 13 | productionSourceMap: true, 14 | // Gzip off by default as many popular static hosts such as 15 | // Surge or Netlify already gzip all static assets for you. 16 | // Before setting to `true`, make sure to: 17 | // npm install --save-dev compression-webpack-plugin 18 | productionGzip: false, 19 | productionGzipExtensions: ['js', 'css'] 20 | }, 21 | dev: { 22 | env: require('./dev.env'), 23 | port: process.env.DEV_PORT || 8080, 24 | autoOpenBrowser: true, 25 | assetsSubDirectory: 'assets', 26 | assetsPublicPath: '/', 27 | proxyTable: { 28 | '/MODApis': { 29 | target: 'http://dev.markitondemand.com', 30 | changeOrigin: true 31 | } 32 | }, 33 | // CSS Sourcemaps off by default because relative paths are "buggy" 34 | // with this option, according to the CSS-Loader README 35 | // (https://github.com/webpack/css-loader#sourcemaps) 36 | // In our experience, they generally work as expected, 37 | // just be aware of this issue when enabling this option. 38 | cssSourceMap: false 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /config/prod.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const merge = require('webpack-merge') 4 | const firebaseEnv = require('./firebase.env') 5 | 6 | module.exports = merge(firebaseEnv, { 7 | NODE_ENV: '"production"' 8 | }) 9 | -------------------------------------------------------------------------------- /config/test.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const merge = require('webpack-merge') 4 | const devEnv = require('./dev.env') 5 | 6 | module.exports = merge(devEnv, { 7 | NODE_ENV: '"testing"' 8 | }) 9 | -------------------------------------------------------------------------------- /electronIndex.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const { app, BrowserWindow } = require('electron') 4 | 5 | // Keep a global reference of the window object, if you don't, the window will 6 | // be closed automatically when the JavaScript object is garbage collected. 7 | let mainWindow 8 | 9 | const isDev = process.env.NODE_ENV === 'development' 10 | 11 | function createWindow () { 12 | // Create the browser window. 13 | mainWindow = new BrowserWindow({ 14 | width: 800, 15 | height: 600 16 | }) 17 | 18 | // and load the index.html of the app. 19 | mainWindow.loadURL(`file://${__dirname}/dist/index.html`) 20 | 21 | // Open the DevTools. 22 | if (isDev) { 23 | mainWindow.webContents.openDevTools() 24 | 25 | const installExtension = require('electron-devtools-installer') 26 | installExtension.default(installExtension.VUEJS_DEVTOOLS) 27 | .then(name => console.log(`Added Extension: ${name}`)) 28 | .catch(err => console.log('An error occurred: ', err)) 29 | } 30 | 31 | // Emitted when the window is closed. 32 | mainWindow.on('closed', () => { 33 | // Dereference the window object, usually you would store windows 34 | // in an array if your app supports multi windows, this is the time 35 | // when you should delete the corresponding element. 36 | mainWindow = null 37 | }) 38 | } 39 | 40 | // This method will be called when Electron has finished 41 | // initialization and is ready to create browser windows. 42 | // Some APIs can only be used after this event occurs. 43 | app.on('ready', createWindow) 44 | 45 | // Quit when all windows are closed. 46 | app.on('window-all-closed', () => { 47 | // On OS X it is common for applications and their menu bar 48 | // to stay active until the user quits explicitly with Cmd + Q 49 | if (process.platform !== 'darwin') { 50 | app.quit() 51 | } 52 | }) 53 | 54 | app.on('activate', () => { 55 | // On OS X it's common to re-create a window in the app when the 56 | // dock icon is clicked and there are no other windows open. 57 | if (mainWindow === null) { 58 | createWindow() 59 | } 60 | }) 61 | 62 | // In this file you can include the rest of your app's specific main process 63 | // code. You can also put them in separate files and require them here. 64 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | <%= htmlWebpackPlugin.options.title %> 8 | 9 | 10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vuexfire-admin", 3 | "version": "0.0.01", 4 | "description": "VuexFire Admin Panel Framework", 5 | "repository": "vue-bulma/vuexfire-admin", 6 | "homepage": "https://github.com/vue-bulma/vuexfire-admin", 7 | "license": "MIT", 8 | "author": { 9 | "name": "Tim Daff", 10 | "email": "timdaff@gmail.com", 11 | "url": "southerndigital.com.au" 12 | }, 13 | "keywords": [ 14 | "admin", 15 | "bulma", 16 | "dashboard", 17 | "data", 18 | "visualization", 19 | "vue", 20 | "firebase", 21 | "vuexfire", 22 | "vue-admin", 23 | "vuexfire-admin", 24 | "vue-bulma" 25 | ], 26 | "engines": { 27 | "node": ">=4", 28 | "npm": ">=3" 29 | }, 30 | "scripts": { 31 | "build": "cross-env NODE_ENV=production node build/build.js", 32 | "clean": "rm -rf dist", 33 | "dev": "cross-env NODE_ENV=development node build/dev-server.js", 34 | "electron": "cross-env NODE_ELECTRON=true npm run build && electron electronIndex.js", 35 | "gh": "npm run build && gh-pages -d dist", 36 | "lint": "eslint --ext .js .vue client/*", 37 | "lint:fix": "eslint --fix --ext .js .vue electron.js client/* build/* config/*", 38 | "test": "echo lol" 39 | }, 40 | "dependencies": { 41 | "@websanova/vue-auth": "^2.8.2-beta", 42 | "animate.css": "3.5.2", 43 | "animejs": "^2.0.1", 44 | "axios": "^0.15.3", 45 | "bulma": "^0.5.3", 46 | "firebase": "^4.1.3", 47 | "font-awesome": "4.7.0", 48 | "mdi": "^1.8.36", 49 | "quill-delta-to-html": "^0.3.0", 50 | "vee-validate": "^2.0.0-rc.13", 51 | "vue": "^2.2.2", 52 | "vue-axios": "^2.0.1", 53 | "vue-bulma-brace": "^0.1.0", 54 | "vue-bulma-breadcrumb": "^1.0.1", 55 | "vue-bulma-card": "^1.0.2", 56 | "vue-bulma-chartjs": "^1.0.5", 57 | "vue-bulma-collapse": "1.0.3", 58 | "vue-bulma-datepicker": "^1.3.0", 59 | "vue-bulma-emoji": "^0.0.2", 60 | "vue-bulma-expanding": "^0.0.1", 61 | "vue-bulma-jump": "^0.0.2", 62 | "vue-bulma-message": "^1.1.1", 63 | "vue-bulma-modal": "1.0.1", 64 | "vue-bulma-notification": "^1.1.1", 65 | "vue-bulma-progress-bar": "^1.0.2", 66 | "vue-bulma-progress-tracker": "0.0.4", 67 | "vue-bulma-quill": "0.0.1", 68 | "vue-bulma-rating": "^1.0.1", 69 | "vue-bulma-slider": "^1.0.2", 70 | "vue-bulma-switch": "^1.0.4", 71 | "vue-bulma-tabs": "^1.1.2", 72 | "vue-bulma-tooltip": "^1.0.3", 73 | "vue-cleave": "1.1.1", 74 | "vue-lory": "0.0.4", 75 | "vue-nprogress": "0.1.5", 76 | "vue-router": "^2.3.0", 77 | "vuex": "^2.2.1", 78 | "vuex-persistedstate": "^2.0.0", 79 | "vuex-router-sync": "^4.1.2", 80 | "vuexfire": "^2.1.3", 81 | "wysiwyg.css": "0.0.2" 82 | }, 83 | "devDependencies": { 84 | "autoprefixer": "^6.7.7", 85 | "babel-core": "^6.21.0", 86 | "babel-eslint": "^7.1.1", 87 | "babel-loader": "^6.4.0", 88 | "babel-plugin-transform-export-extensions": "^6.8.0", 89 | "babel-preset-es2015": "^6.14.0", 90 | "babel-preset-stage-2": "^6.17.0", 91 | "connect-history-api-fallback": "^1.3.0", 92 | "cross-env": "^3.1.3", 93 | "css-loader": "^0.27.1", 94 | "electron-devtools-installer": "^2.0.1", 95 | "eslint": "^3.17.1", 96 | "eslint-config-standard": "^7.0.1", 97 | "eslint-friendly-formatter": "^2.0.7", 98 | "eslint-loader": "^1.6.1", 99 | "eslint-plugin-html": "^2.0.1", 100 | "eslint-plugin-promise": "^3.5.0", 101 | "eslint-plugin-standard": "^2.1.1", 102 | "eventsource-polyfill": "^0.9.6", 103 | "express": "^4.15.2", 104 | "extract-text-webpack-plugin": "^2.0.0-beta.4", 105 | "file-loader": "^0.10.1", 106 | "html-webpack-plugin": "^2.25.0", 107 | "http-proxy-middleware": "^0.17.4", 108 | "imports-loader": "^0.7.0", 109 | "node-sass": "^4.1.1", 110 | "opn": "^4.0.2", 111 | "ora": "^1.1.0", 112 | "postcss-loader": "^1.3.3", 113 | "progress-bar-webpack-plugin": "^1.9.1", 114 | "sass-loader": "^6.0.3", 115 | "serve-favicon": "^2.4.1", 116 | "style-loader": "^0.13.1", 117 | "stylus": "^0.54.5", 118 | "stylus-loader": "^3.0.1", 119 | "url-loader": "^0.5.7", 120 | "vue-html-loader": "^1.2.3", 121 | "vue-loader": "^11.1.4", 122 | "vue-template-compiler": "^2.2.2", 123 | "webpack": "^2.2.1", 124 | "webpack-dev-middleware": "^1.9.0", 125 | "webpack-hot-middleware": "^2.14.0", 126 | "webpack-merge": "^4.0.0" 127 | } 128 | } 129 | --------------------------------------------------------------------------------