├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .firebaserc ├── .gitignore ├── .postcssrc.js ├── .prettierrc ├── LICENSE ├── README.md ├── build ├── build.js ├── check-versions.js ├── utils.js ├── vue-loader.conf.js ├── webpack.base.conf.js ├── webpack.dev.conf.js └── webpack.prod.conf.js ├── config ├── dev.env.js ├── index.js └── prod.env.js ├── firebase.json ├── firestore.indexes.json ├── firestore.rules ├── index.html ├── package.json ├── src ├── App.vue ├── firebase │ ├── config.js │ └── index.js ├── main.js ├── router │ └── index.js ├── store │ └── index.js ├── stylesheet │ ├── app.scss │ ├── config │ │ ├── mixin.scss │ │ └── variables.scss │ ├── helper │ │ ├── form.scss │ │ ├── global.scss │ │ ├── typography.scss │ │ └── utility.scss │ └── reset │ │ ├── formalize.scss │ │ └── normalize.scss ├── utils │ └── loader.js └── view │ ├── Auth │ ├── index.vue │ └── store │ │ └── index.js │ ├── Home │ ├── index.vue │ └── store │ │ └── index.js │ ├── Profile │ ├── index.vue │ └── store │ │ └── index.js │ ├── card │ ├── index.vue │ └── link.vue │ ├── header │ └── index.vue │ └── icon │ └── index.vue └── static └── .gitkeep /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "env", 5 | { 6 | "modules": false 7 | } 8 | ], 9 | "stage-2" 10 | ], 11 | "plugins": [ 12 | "transform-runtime" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /.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/ 2 | /config/ 3 | /dist/ 4 | /*.js 5 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | // https://eslint.org/docs/user-guide/configuring 2 | 3 | module.exports = { 4 | root: true, 5 | parser: 'babel-eslint', 6 | parserOptions: { 7 | sourceType: 'module' 8 | }, 9 | env: { 10 | browser: true 11 | }, 12 | // https://github.com/standard/standard/blob/master/docs/RULES-en.md 13 | extends: 'standard', 14 | // required to lint *.vue files 15 | plugins: ['html', 'pug'], 16 | // add your custom rules here 17 | rules: { 18 | 'space-before-function-paren': ['error', 'never'], 19 | // allow paren-less arrow functions 20 | 'arrow-parens': 0, 21 | // allow async-await 22 | 'generator-star-spacing': 0, 23 | // allow debugger during development 24 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "staging": "profile-cards" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | /dist/ 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | package-lock.json 8 | yarn.lock 9 | 10 | # Editor directories and files 11 | .vscode 12 | *.suo 13 | *.ntvs* 14 | *.njsproj 15 | *.sln 16 | -------------------------------------------------------------------------------- /.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | plugins: { 5 | // to edit target browsers: use "browserslist" field in package.json 6 | 'postcss-import': {}, 7 | autoprefixer: {} 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 180, 3 | "singleQuote": true, 4 | "semi": false 5 | } 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Adem ilter 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 | # Vue Firebase Example 2 | - [Firebase Console](https://console.firebase.google.com/u/0/)'dan yeni bir proje oluşturun. 3 | - Database menüsünden Firestore'u aktifleştirin. 4 | - [config.js](https://github.com/ademilter/vue-firebase-example/blob/master/src/firebase/config.js) dosyasını kendi proje bilgilerinizle güncelleyin. 5 | - terminal'den `npm i -g firebase-tools` komutu ile bilgisayarınıza firebase terminal aracını kurun. 6 | - proje dizinine girin ve `firebase login` komutunu çalıştırarak login olun. 7 | - tekrar proje dizininde `firebase use -add` diyerek projenizi seçin. 8 | - tekrar proje dizininde `npm install` diyerek projeye ait paketleri yükleyin. 9 | - son olarak `npm run deploy` diyerek proje build olur ve firebase'e gönderilir. 10 | 11 | ## Yapılacaklar 12 | - [ ] Şehire göre filtreleme 13 | - [ ] Uygunluk durumuna göre filtreleme 14 | - [ ] Mesleğe göre filtreleme 15 | -------------------------------------------------------------------------------- /build/build.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | require('./check-versions')() 3 | 4 | process.env.NODE_ENV = 'production' 5 | 6 | const ora = require('ora') 7 | const rm = require('rimraf') 8 | const path = require('path') 9 | const chalk = require('chalk') 10 | const webpack = require('webpack') 11 | const config = require('../config') 12 | const webpackConfig = require('./webpack.prod.conf') 13 | 14 | const spinner = ora('building for production...') 15 | spinner.start() 16 | 17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { 18 | if (err) throw err 19 | webpack(webpackConfig, function (err, stats) { 20 | spinner.stop() 21 | if (err) throw err 22 | process.stdout.write(stats.toString({ 23 | colors: true, 24 | modules: false, 25 | children: false, 26 | chunks: false, 27 | chunkModules: false 28 | }) + '\n\n') 29 | 30 | if (stats.hasErrors()) { 31 | console.log(chalk.red(' Build failed with errors.\n')) 32 | process.exit(1) 33 | } 34 | 35 | console.log(chalk.cyan(' Build complete.\n')) 36 | console.log(chalk.yellow( 37 | ' Tip: built files are meant to be served over an HTTP server.\n' + 38 | ' Opening index.html over file:// won\'t work.\n' 39 | )) 40 | }) 41 | }) 42 | -------------------------------------------------------------------------------- /build/check-versions.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const chalk = require('chalk') 3 | const semver = require('semver') 4 | const packageConfig = require('../package.json') 5 | const shell = require('shelljs') 6 | 7 | function 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 | 19 | if (shell.which('npm')) { 20 | versionRequirements.push({ 21 | name: 'npm', 22 | currentVersion: exec('npm --version'), 23 | versionRequirement: packageConfig.engines.npm 24 | }) 25 | } 26 | 27 | module.exports = function () { 28 | const warnings = [] 29 | for (let i = 0; i < versionRequirements.length; i++) { 30 | const mod = versionRequirements[i] 31 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 32 | warnings.push(mod.name + ': ' + 33 | chalk.red(mod.currentVersion) + ' should be ' + 34 | chalk.green(mod.versionRequirement) 35 | ) 36 | } 37 | } 38 | 39 | if (warnings.length) { 40 | console.log('') 41 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 42 | console.log() 43 | for (let i = 0; i < warnings.length; i++) { 44 | const warning = warnings[i] 45 | console.log(' ' + warning) 46 | } 47 | console.log() 48 | process.exit(1) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /build/utils.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const config = require('../config') 4 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 5 | const pkg = require('../package.json') 6 | 7 | exports.assetsPath = function (_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 = function (options) { 15 | options = options || {} 16 | 17 | const cssLoader = { 18 | loader: 'css-loader', 19 | options: { 20 | sourceMap: options.sourceMap 21 | } 22 | } 23 | 24 | var postcssLoader = { 25 | loader: 'postcss-loader', 26 | options: { 27 | sourceMap: options.sourceMap 28 | } 29 | } 30 | 31 | // generate loader string to be used with extract text plugin 32 | function generateLoaders (loader, loaderOptions) { 33 | const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] 34 | if (loader) { 35 | loaders.push({ 36 | loader: loader + '-loader', 37 | options: Object.assign({}, loaderOptions, { 38 | sourceMap: options.sourceMap 39 | }) 40 | }) 41 | } 42 | 43 | // Extract CSS when that option is specified 44 | // (which is the case during production build) 45 | if (options.extract) { 46 | return ExtractTextPlugin.extract({ 47 | use: loaders, 48 | fallback: 'vue-style-loader' 49 | }) 50 | } else { 51 | return ['vue-style-loader'].concat(loaders) 52 | } 53 | } 54 | 55 | // https://vue-loader.vuejs.org/en/configurations/extract-css.html 56 | return { 57 | css: generateLoaders(), 58 | postcss: generateLoaders(), 59 | less: generateLoaders('less'), 60 | sass: generateLoaders('sass', { indentedSyntax: true }), 61 | scss: generateLoaders('sass'), 62 | stylus: generateLoaders('stylus'), 63 | styl: generateLoaders('stylus') 64 | } 65 | } 66 | 67 | // Generate loaders for standalone style files (outside of .vue) 68 | exports.styleLoaders = function (options) { 69 | const output = [] 70 | const loaders = exports.cssLoaders(options) 71 | for (const extension in loaders) { 72 | const loader = loaders[extension] 73 | output.push({ 74 | test: new RegExp('\\.' + extension + '$'), 75 | use: loader 76 | }) 77 | } 78 | return output 79 | } 80 | 81 | exports.createNotifierCallback = function () { 82 | const notifier = require('node-notifier') 83 | 84 | return (severity, errors) => { 85 | if (severity !== 'error') { 86 | return 87 | } 88 | const error = errors[0] 89 | 90 | const filename = error.file && error.file.split('!').pop() 91 | notifier.notify({ 92 | title: pkg.name, 93 | message: severity + ': ' + error.name, 94 | subtitle: filename || '', 95 | icon: path.join(__dirname, 'logo.png') 96 | }) 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /build/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const config = require('../config') 4 | const isProduction = process.env.NODE_ENV === 'production' 5 | const sourceMapEnabled = isProduction 6 | ? config.build.productionSourceMap 7 | : config.dev.cssSourceMap 8 | 9 | module.exports = { 10 | loaders: utils.cssLoaders({ 11 | sourceMap: sourceMapEnabled, 12 | extract: isProduction 13 | }), 14 | cssSourceMap: sourceMapEnabled, 15 | cacheBusting: config.dev.cacheBusting, 16 | transformToRequire: { 17 | video: 'src', 18 | source: 'src', 19 | img: 'src', 20 | image: 'xlink:href' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const merge = require('webpack-merge') 4 | const utils = require('./utils') 5 | const config = require('../config') 6 | const vueLoaderConfig = require('./vue-loader.conf') 7 | 8 | function resolve (dir) { 9 | return path.join(__dirname, '..', dir) 10 | } 11 | 12 | module.exports = { 13 | context: path.resolve(__dirname, '../'), 14 | entry: { 15 | app: './src/main.js' 16 | }, 17 | output: { 18 | path: config.build.assetsRoot, 19 | filename: '[name].js', 20 | publicPath: process.env.NODE_ENV === 'production' 21 | ? config.build.assetsPublicPath 22 | : config.dev.assetsPublicPath 23 | }, 24 | resolve: { 25 | extensions: ['.js', '.vue', '.json'], 26 | alias: { 27 | 'vue$': 'vue/dist/vue.esm.js', 28 | '@': resolve('src') 29 | } 30 | }, 31 | module: { 32 | rules: [ 33 | ...(config.dev.useEslint ? [{ 34 | test: /\.(js|vue)$/, 35 | loader: 'eslint-loader', 36 | enforce: 'pre', 37 | include: [resolve('src'), resolve('test')], 38 | options: { 39 | formatter: require('eslint-friendly-formatter'), 40 | emitWarning: !config.dev.showEslintErrorsInOverlay 41 | } 42 | }] : []), 43 | { 44 | test: /\.vue$/, 45 | loader: 'vue-loader', 46 | options: merge(vueLoaderConfig, { 47 | loaders: { 48 | i18n: '@kazupon/vue-i18n-loader' 49 | } 50 | }) 51 | }, 52 | { 53 | test: /\.js$/, 54 | loader: 'babel-loader', 55 | include: [resolve('src'), resolve('test')] 56 | }, 57 | { 58 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 59 | loader: 'url-loader', 60 | options: { 61 | limit: 10000, 62 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 63 | } 64 | }, 65 | { 66 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, 67 | loader: 'url-loader', 68 | options: { 69 | limit: 10000, 70 | name: utils.assetsPath('media/[name].[hash:7].[ext]') 71 | } 72 | }, 73 | { 74 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 75 | loader: 'url-loader', 76 | options: { 77 | limit: 10000, 78 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 79 | } 80 | } 81 | ] 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const webpack = require('webpack') 4 | const config = require('../config') 5 | const merge = require('webpack-merge') 6 | const baseWebpackConfig = require('./webpack.base.conf') 7 | const HtmlWebpackPlugin = require('html-webpack-plugin') 8 | const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') 9 | const portfinder = require('portfinder') 10 | 11 | const devWebpackConfig = merge(baseWebpackConfig, { 12 | module: { 13 | rules: utils.styleLoaders({ 14 | sourceMap: config.dev.cssSourceMap, 15 | usePostCSS: true 16 | }) 17 | }, 18 | // cheap-module-eval-source-map is faster for development 19 | devtool: config.dev.devtool, 20 | 21 | // these devServer options should be customized in /config/index.js 22 | devServer: { 23 | clientLogLevel: 'warning', 24 | historyApiFallback: true, 25 | hot: true, 26 | compress: true, 27 | host: process.env.HOST || config.dev.host, 28 | port: process.env.PORT || config.dev.port, 29 | open: config.dev.autoOpenBrowser, 30 | overlay: config.dev.errorOverlay ? { 31 | warnings: false, 32 | errors: true 33 | } : false, 34 | publicPath: config.dev.assetsPublicPath, 35 | proxy: config.dev.proxyTable, 36 | quiet: true, // necessary for FriendlyErrorsPlugin 37 | watchOptions: { 38 | poll: config.dev.poll 39 | } 40 | }, 41 | plugins: [ 42 | new webpack.DefinePlugin({ 43 | 'process.env': require('../config/dev.env') 44 | }), 45 | new webpack.HotModuleReplacementPlugin(), 46 | new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. 47 | new webpack.NoEmitOnErrorsPlugin(), 48 | // https://github.com/ampedandwired/html-webpack-plugin 49 | new HtmlWebpackPlugin({ 50 | filename: 'index.html', 51 | template: 'index.html', 52 | inject: true 53 | }) 54 | ] 55 | }) 56 | 57 | module.exports = new Promise((resolve, reject) => { 58 | portfinder.basePort = process.env.PORT || config.dev.port 59 | portfinder.getPort((err, port) => { 60 | if (err) { 61 | reject(err) 62 | } else { 63 | // publish the new Port, necessary for e2e tests 64 | process.env.PORT = port 65 | // add port to devServer config 66 | devWebpackConfig.devServer.port = port 67 | 68 | // Add FriendlyErrorsPlugin 69 | devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ 70 | compilationSuccessInfo: { 71 | messages: [`Your application is running here: http://${config.dev.host}:${port}`] 72 | }, 73 | onErrors: config.dev.notifyOnErrors 74 | ? utils.createNotifierCallback() 75 | : undefined 76 | })) 77 | 78 | resolve(devWebpackConfig) 79 | } 80 | }) 81 | }) 82 | -------------------------------------------------------------------------------- /build/webpack.prod.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const utils = require('./utils') 4 | const webpack = require('webpack') 5 | const config = require('../config') 6 | const merge = require('webpack-merge') 7 | const baseWebpackConfig = require('./webpack.base.conf') 8 | const CopyWebpackPlugin = require('copy-webpack-plugin') 9 | const HtmlWebpackPlugin = require('html-webpack-plugin') 10 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 11 | const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') 12 | const MomentLocalesPlugin = require('moment-locales-webpack-plugin') 13 | 14 | const env = require('../config/prod.env') 15 | 16 | const webpackConfig = merge(baseWebpackConfig, { 17 | module: { 18 | rules: utils.styleLoaders({ 19 | sourceMap: config.build.productionSourceMap, 20 | extract: true, 21 | usePostCSS: true 22 | }) 23 | }, 24 | devtool: config.build.productionSourceMap ? config.build.devtool : false, 25 | output: { 26 | path: config.build.assetsRoot, 27 | filename: utils.assetsPath('js/[name].[chunkhash].js'), 28 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') 29 | }, 30 | plugins: [ 31 | // To strip all locales except “en” 32 | new MomentLocalesPlugin(), 33 | 34 | // Or: To strip all locales except “en”, “es-us” and “ru” 35 | // (“en” is built into Moment and can’t be removed) 36 | new MomentLocalesPlugin({ 37 | localesToKeep: ['es-us', 'tr'] 38 | }), 39 | // http://vuejs.github.io/vue-loader/en/workflow/production.html 40 | new webpack.DefinePlugin({ 41 | 'process.env': env 42 | }), 43 | // UglifyJs do not support ES6+, you can also use babel-minify for better treeshaking: https://github.com/babel/minify 44 | new webpack.optimize.UglifyJsPlugin({ 45 | compress: { 46 | warnings: false 47 | }, 48 | sourceMap: config.build.productionSourceMap, 49 | parallel: true 50 | }), 51 | // extract css into its own file 52 | new ExtractTextPlugin({ 53 | filename: utils.assetsPath('css/[name].[contenthash].css'), 54 | // set the following option to `true` if you want to extract CSS from 55 | // codesplit chunks into this main css file as well. 56 | // This will result in *all* of your app's CSS being loaded upfront. 57 | allChunks: false 58 | }), 59 | // Compress extracted CSS. We are using this plugin so that possible 60 | // duplicated CSS from different components can be deduped. 61 | new OptimizeCSSPlugin({ 62 | cssProcessorOptions: config.build.productionSourceMap 63 | ? { 64 | safe: true, 65 | map: { inline: false } 66 | } 67 | : { safe: true } 68 | }), 69 | // generate dist index.html with correct asset hash for caching. 70 | // you can customize output by editing /index.html 71 | // see https://github.com/ampedandwired/html-webpack-plugin 72 | new HtmlWebpackPlugin({ 73 | filename: config.build.index, 74 | template: 'index.html', 75 | inject: true, 76 | minify: { 77 | removeComments: true, 78 | collapseWhitespace: true, 79 | removeAttributeQuotes: true 80 | // more options: 81 | // https://github.com/kangax/html-minifier#options-quick-reference 82 | }, 83 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin 84 | chunksSortMode: 'dependency' 85 | }), 86 | // keep module.id stable when vender modules does not change 87 | new webpack.HashedModuleIdsPlugin(), 88 | // enable scope hoisting 89 | new webpack.optimize.ModuleConcatenationPlugin(), 90 | // split vendor js into its own file 91 | new webpack.optimize.CommonsChunkPlugin({ 92 | name: 'vendor', 93 | minChunks: function (module) { 94 | // any required modules inside node_modules are extracted to vendor 95 | return ( 96 | module.resource && 97 | /\.js$/.test(module.resource) && 98 | module.resource.indexOf( 99 | path.join(__dirname, '../node_modules') 100 | ) === 0 101 | ) 102 | } 103 | }), 104 | // extract webpack runtime and module manifest to its own file in order to 105 | // prevent vendor hash from being updated whenever app bundle is updated 106 | new webpack.optimize.CommonsChunkPlugin({ 107 | name: 'manifest', 108 | minChunks: Infinity 109 | }), 110 | // This instance extracts shared chunks from code splitted chunks and bundles them 111 | // in a separate chunk, similar to the vendor chunk 112 | // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk 113 | new webpack.optimize.CommonsChunkPlugin({ 114 | name: 'app', 115 | async: 'vendor-async', 116 | children: true, 117 | minChunks: 3 118 | }), 119 | 120 | // copy custom static assets 121 | new CopyWebpackPlugin([ 122 | { 123 | from: path.resolve(__dirname, '../static'), 124 | to: config.build.assetsSubDirectory, 125 | ignore: ['.*'] 126 | } 127 | ]) 128 | ] 129 | }) 130 | 131 | if (config.build.productionGzip) { 132 | const CompressionWebpackPlugin = require('compression-webpack-plugin') 133 | 134 | webpackConfig.plugins.push( 135 | new CompressionWebpackPlugin({ 136 | asset: '[path].gz[query]', 137 | algorithm: 'gzip', 138 | test: new RegExp( 139 | '\\.(' + 140 | config.build.productionGzipExtensions.join('|') + 141 | ')$' 142 | ), 143 | threshold: 10240, 144 | minRatio: 0.8 145 | }) 146 | ) 147 | } 148 | 149 | if (config.build.bundleAnalyzerReport) { 150 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin 151 | webpackConfig.plugins.push(new BundleAnalyzerPlugin({ 152 | analyzerHost: 'localhost', 153 | analyzerPort: '1453' 154 | })) 155 | } 156 | 157 | module.exports = webpackConfig 158 | -------------------------------------------------------------------------------- /config/dev.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const merge = require('webpack-merge') 3 | const prodEnv = require('./prod.env') 4 | 5 | module.exports = merge(prodEnv, { 6 | PROJECT_NAMESPACE: '"exampleDevStore"', // localStorage store key name 7 | NODE_ENV: '"development"', 8 | API_URL: '"http://5a304ec3a871f00012678e6c.mockapi.io/"' 9 | }) 10 | -------------------------------------------------------------------------------- /config/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | // Template version: 1.2.4 3 | // see http://vuejs-templates.github.io/webpack for documentation. 4 | 5 | const path = require('path') 6 | 7 | module.exports = { 8 | dev: { 9 | 10 | // Paths 11 | assetsSubDirectory: 'static', 12 | assetsPublicPath: '/', 13 | proxyTable: {}, 14 | 15 | // Various Dev Server settings 16 | host: 'localhost', // can be overwritten by process.env.HOST 17 | port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined 18 | autoOpenBrowser: true, 19 | errorOverlay: true, 20 | notifyOnErrors: true, 21 | poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- 22 | 23 | // Use Eslint Loader? 24 | // If true, your code will be linted during bundling and 25 | // linting errors and warnings will be shown in the console. 26 | useEslint: true, 27 | // If true, eslint errors and warnings will also be shown in the error overlay 28 | // in the browser. 29 | showEslintErrorsInOverlay: false, 30 | 31 | /** 32 | * Source Maps 33 | */ 34 | 35 | // https://webpack.js.org/configuration/devtool/#development 36 | devtool: 'eval-source-map', 37 | 38 | // If you have problems debugging vue-files in devtools, 39 | // set this to false - it *may* help 40 | // https://vue-loader.vuejs.org/en/options.html#cachebusting 41 | cacheBusting: true, 42 | 43 | // CSS Sourcemaps off by default because relative paths are "buggy" 44 | // with this option, according to the CSS-Loader README 45 | // (https://github.com/webpack/css-loader#sourcemaps) 46 | // In our experience, they generally work as expected, 47 | // just be aware of this issue when enabling this option. 48 | cssSourceMap: false 49 | }, 50 | 51 | build: { 52 | // Template for index.html 53 | index: path.resolve(__dirname, '../dist/index.html'), 54 | 55 | // Paths 56 | assetsRoot: path.resolve(__dirname, '../dist'), 57 | assetsSubDirectory: 'static', 58 | assetsPublicPath: '/', 59 | 60 | /** 61 | * Source Maps 62 | */ 63 | 64 | productionSourceMap: true, 65 | // https://webpack.js.org/configuration/devtool/#production 66 | devtool: '#source-map', 67 | 68 | // Gzip off by default as many popular static hosts such as 69 | // Surge or Netlify already gzip all static assets for you. 70 | // Before setting to `true`, make sure to: 71 | // npm install --save-dev compression-webpack-plugin 72 | productionGzip: false, 73 | productionGzipExtensions: ['js', 'css'], 74 | 75 | // Run the build command with an extra argument to 76 | // View the bundle analyzer report after build finishes: 77 | // `npm run build --report` 78 | // Set to `true` or `false` to always turn it on or off 79 | bundleAnalyzerReport: process.env.npm_config_report 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /config/prod.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = { 3 | PROJECT_NAMESPACE: '"exampleProdStore"', // localStorage store key name 4 | NODE_ENV: '"production"', 5 | API_URL: '"http://5a304ec3a871f00012678e6c.mockapi.io/"' 6 | } 7 | -------------------------------------------------------------------------------- /firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "firestore": { 3 | "rules": "firestore.rules", 4 | "indexes": "firestore.indexes.json" 5 | }, 6 | "hosting": { 7 | "public": "./dist", 8 | "ignore": ["firebase.json", "**/.*", "**/node_modules/**"] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /firestore.indexes.json: -------------------------------------------------------------------------------- 1 | { 2 | // Example: 3 | // 4 | // "indexes": [ 5 | // { 6 | // "collectionId": "widgets", 7 | // "fields": [ 8 | // { "fieldPath": "foo", "mode": "ASCENDING" }, 9 | // { "fieldPath": "bar", "mode": "DESCENDING" } 10 | // ] 11 | // } 12 | // ] 13 | "indexes": [] 14 | } 15 | -------------------------------------------------------------------------------- /firestore.rules: -------------------------------------------------------------------------------- 1 | service cloud.firestore { 2 | match /databases/{database}/documents { 3 | // match /{document=**} { 4 | // allow read, write; 5 | // } 6 | match /Users/{userId} { 7 | allow read; 8 | allow write: if request.auth.uid == userId; 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Project Name 7 | 8 | 9 |
10 | 11 | 12 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mc", 3 | "version": "1.1.0", 4 | "description": "A Vue.js project", 5 | "author": "Adem ilter ", 6 | "private": true, 7 | "scripts": { 8 | "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", 9 | "start": "yarn run dev", 10 | "test": "echo 'No tests.'; exit 0;", 11 | "lint": "eslint --ext .js,.vue src", 12 | "build": "node build/build.js", 13 | "deploy": "npm run build; firebase deploy" 14 | }, 15 | "dependencies": { 16 | "firebase": "^4.9.1", 17 | "lodash": "^4.17.5", 18 | "moment": "^2.20.1", 19 | "vee-validate": "^2.0.3", 20 | "vue": "^2.5.13", 21 | "vue-router": "^3.0.1", 22 | "vue-the-mask": "^0.11.1", 23 | "vuex": "^3.0.1", 24 | "vuex-loading": "^0.2.5" 25 | }, 26 | "devDependencies": { 27 | "autoprefixer": "^7.1.2", 28 | "babel-core": "^6.22.1", 29 | "babel-eslint": "^7.1.1", 30 | "babel-loader": "^7.1.1", 31 | "babel-plugin-transform-runtime": "^6.22.0", 32 | "babel-preset-env": "^1.3.2", 33 | "babel-preset-stage-2": "^6.22.0", 34 | "babel-register": "^6.22.0", 35 | "chalk": "^2.0.1", 36 | "copy-webpack-plugin": "^4.0.1", 37 | "css-loader": "^0.28.0", 38 | "eslint": "^3.19.0", 39 | "eslint-config-standard": "^10.2.1", 40 | "eslint-friendly-formatter": "^3.0.0", 41 | "eslint-loader": "^1.7.1", 42 | "eslint-plugin-html": "^3.0.0", 43 | "eslint-plugin-import": "^2.7.0", 44 | "eslint-plugin-node": "^5.2.0", 45 | "eslint-plugin-promise": "^3.4.0", 46 | "eslint-plugin-pug": "^1.1.1", 47 | "eslint-plugin-standard": "^3.0.1", 48 | "eventsource-polyfill": "^0.9.6", 49 | "extract-text-webpack-plugin": "^3.0.0", 50 | "file-loader": "^1.1.4", 51 | "friendly-errors-webpack-plugin": "^1.6.1", 52 | "html-webpack-plugin": "^2.30.1", 53 | "moment-locales-webpack-plugin": "^1.0.4", 54 | "node-notifier": "^5.1.2", 55 | "node-sass": "^4.7.2", 56 | "optimize-css-assets-webpack-plugin": "^3.2.0", 57 | "ora": "^1.2.0", 58 | "portfinder": "^1.0.13", 59 | "postcss-import": "^11.0.0", 60 | "postcss-loader": "^2.0.8", 61 | "pug": "^2.0.0-rc.4", 62 | "rimraf": "^2.6.0", 63 | "sass-loader": "^6.0.6", 64 | "semver": "^5.3.0", 65 | "shelljs": "^0.7.6", 66 | "surge": "^0.19.0", 67 | "url-loader": "^0.5.8", 68 | "vue-loader": "^13.3.0", 69 | "vue-style-loader": "^3.0.1", 70 | "vue-template-compiler": "^2.5.2", 71 | "webpack": "^3.6.0", 72 | "webpack-bundle-analyzer": "^2.10.0", 73 | "webpack-dev-server": "^2.9.1", 74 | "webpack-merge": "^4.1.1" 75 | }, 76 | "engines": { 77 | "node": ">= 8.9.0", 78 | "npm": ">= 5.6.0" 79 | }, 80 | "browserslist": ["> 1%", "last 1 versions", "not ie <= 8"] 81 | } 82 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 26 | 27 | 34 | -------------------------------------------------------------------------------- /src/firebase/config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | apiKey: 'AIzaSyBbLqy_mg2dGCooHiVtPNLOrz4hmPxRJxk', 3 | authDomain: 'profile-cards.firebaseapp.com', 4 | databaseURL: 'https://profile-cards.firebaseio.com', 5 | projectId: 'profile-cards' 6 | } 7 | -------------------------------------------------------------------------------- /src/firebase/index.js: -------------------------------------------------------------------------------- 1 | import firebaseConfig from './config' 2 | // 3 | import firebase from 'firebase/app' 4 | import 'firebase/auth' 5 | import 'firebase/firestore' 6 | 7 | firebase.initializeApp(firebaseConfig) 8 | 9 | export const AUTH = firebase.auth() 10 | export const FIRESTORE = firebase.firestore() 11 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App' 3 | import router from './router' 4 | import store from '@/store' 5 | import VeeValidate, { Validator } from 'vee-validate' 6 | import tr from 'vee-validate/dist/locale/tr' 7 | import VueLoading from 'vuex-loading' 8 | // import '@/firebase' 9 | import { AUTH } from '@/firebase' 10 | 11 | Vue.config.productionTip = false 12 | Validator.localize('tr', tr) 13 | 14 | Vue.use(VueLoading) 15 | Vue.use(VeeValidate, { 16 | events: 'input' 17 | }) 18 | 19 | let app 20 | AUTH.onAuthStateChanged(() => { 21 | if (!app) { 22 | app = new Vue({ 23 | el: '#app', 24 | router, 25 | store, 26 | vueLoading: new VueLoading({ useVuex: true }), 27 | template: '', 28 | components: { App } 29 | }) 30 | } 31 | }) 32 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | 4 | // Pages 5 | import Home from '@/view/Home' 6 | import Auth from '@/view/Auth' 7 | import Profile from '@/view/Profile' 8 | 9 | Vue.use(Router) 10 | 11 | const router = new Router({ 12 | routes: [ 13 | { 14 | path: '/', 15 | name: 'Home', 16 | component: Home, 17 | children: [ 18 | { 19 | path: 'auth', 20 | name: 'Auth', 21 | component: Auth 22 | }, 23 | { 24 | path: 'profile', 25 | name: 'Profile', 26 | component: Profile 27 | } 28 | ] 29 | } 30 | ] 31 | }) 32 | 33 | export default router 34 | -------------------------------------------------------------------------------- /src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | 4 | // Pages 5 | import Auth from '@/view/Auth/store' 6 | import Profile from '@/view/Profile/store' 7 | import Home from '@/view/Home/store' 8 | 9 | Vue.use(Vuex) 10 | 11 | const debug = process.env.NODE_ENV !== 'production' 12 | 13 | export default new Vuex.Store({ 14 | modules: { 15 | Auth, 16 | Profile, 17 | Home 18 | }, 19 | strict: debug 20 | }) 21 | -------------------------------------------------------------------------------- /src/stylesheet/app.scss: -------------------------------------------------------------------------------- 1 | // CONFIG 2 | @import "config/variables"; 3 | @import "config/mixin"; 4 | // RESET 5 | @import "reset/normalize"; 6 | @import "reset/formalize"; 7 | // HELPER 8 | @import "helper/typography"; 9 | @import "helper/global"; 10 | @import "helper/utility"; 11 | @import "helper/form"; 12 | 13 | .container { 14 | max-width: 1200px; 15 | margin-left: auto; 16 | margin-right: auto; 17 | padding-left: 20px; 18 | padding-right: 20px; 19 | } 20 | 21 | .textFit { 22 | overflow: hidden; 23 | white-space: nowrap; 24 | text-overflow: ellipsis; 25 | } 26 | 27 | .alert { 28 | padding: 10px; 29 | color: $color-warning; 30 | background-color: rgba($color-warning, .1); 31 | border-radius: $border-radius; 32 | } 33 | 34 | .Popup { 35 | z-index: 100; 36 | position: fixed; 37 | left: 0; 38 | top: 0; 39 | width: 100vw; 40 | height: 100vh; 41 | 42 | &-overlay { 43 | position: absolute; 44 | left: 0; 45 | top: 0; 46 | width: 100%; 47 | height: 100%; 48 | background-color: rgba(black, .4); 49 | } 50 | 51 | &-container { 52 | position: absolute; 53 | left: 50%; 54 | top: 50%; 55 | width: 90%; 56 | max-width: 800px; 57 | padding: 20px; 58 | transform: translate(-50%, -50%); 59 | background-color: white; 60 | border-radius: $border-radius; 61 | box-shadow: 0 20px 30px rgba(black, .2); 62 | } 63 | 64 | &-loading { 65 | z-index: 10; 66 | position: absolute; 67 | left: 0; 68 | top: 0; 69 | width: 100%; 70 | height: 100%; 71 | display: flex; 72 | align-items: center; 73 | justify-content: center; 74 | color: white; 75 | font-size: 2em; 76 | background-color: rgba($color-primary, .7); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/stylesheet/config/mixin.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ademilter/vue-firebase-example/2735e0f56784cced50e4bd5a580b818327881271/src/stylesheet/config/mixin.scss -------------------------------------------------------------------------------- /src/stylesheet/config/variables.scss: -------------------------------------------------------------------------------- 1 | // GLOBAL 2 | $transition: 120ms; 3 | $finger-size: 38px; 4 | $border-radius: 5px; 5 | 6 | // COLOR 7 | $color-primary: #ade; 8 | $color-success: limegreen; 9 | $color-warning: red; 10 | $color-dark: #323232; 11 | $color-light: #777; 12 | $color-shadow: #ccc; 13 | 14 | // FONT 15 | $font-family-fallback: "Helvetica Neue", Helvetica, Arial, sans-serif; 16 | $font-family-title: 'Roboto Condensed', $font-family-fallback; 17 | $font-family-body: 'Roboto', $font-family-fallback; 18 | $font-line-height: 1.4; 19 | $font-size-normal: 16px; 20 | $font-title-weight-normal: 400; 21 | $font-body-weight-bold: 700; 22 | -------------------------------------------------------------------------------- /src/stylesheet/helper/form.scss: -------------------------------------------------------------------------------- 1 | .button { 2 | user-select: none; 3 | height: $finger-size; 4 | display: flex; 5 | min-width: $finger-size; 6 | width: 100%; 7 | align-items: center; 8 | justify-content: center; 9 | padding-left: 15px; 10 | padding-right: 15px; 11 | color: $color-dark; 12 | border: solid 1px $color-shadow; 13 | background-color: white; 14 | border-radius: $border-radius; 15 | box-shadow: 0 1px 1px rgba(black, .05); 16 | 17 | &-inline { 18 | display: inline-flex; 19 | width: auto; 20 | } 21 | 22 | &-primary { 23 | color: darken($color-primary, 50); 24 | background-color: $color-primary; 25 | } 26 | 27 | &:disabled, 28 | &.disabled { 29 | cursor: not-allowed; 30 | opacity: .4; 31 | background-color: #eee; 32 | } 33 | 34 | &.is-danger { 35 | border-color: $color-warning; 36 | background-color: rgba($color-warning, .05); 37 | } 38 | 39 | } 40 | 41 | .label { 42 | min-height: $finger-size; 43 | padding: 5px 10px; 44 | display: flex; 45 | align-items: center; 46 | color: $color-dark; 47 | border: solid 1px $color-shadow; 48 | background-color: white; 49 | border-radius: $border-radius; 50 | 51 | &:active { 52 | box-shadow: inset 0 1px 1px rgba(black, .05); 53 | } 54 | 55 | &:disabled, 56 | &.disabled { 57 | cursor: not-allowed; 58 | opacity: .4; 59 | background-color: #eee; 60 | } 61 | 62 | span { 63 | margin-left: 10px; 64 | } 65 | } 66 | 67 | .text { 68 | display: block; 69 | width: 100%; 70 | min-height: $finger-size; 71 | padding: 5px 10px; 72 | color: $color-dark; 73 | border: solid 1px $color-shadow; 74 | background-color: white; 75 | border-radius: $border-radius; 76 | box-shadow: inset 0 1px 1px rgba(black, .05); 77 | 78 | &:focus { 79 | background-color: rgba(yellow, .1); 80 | } 81 | 82 | &:disabled, 83 | &.disabled { 84 | cursor: not-allowed; 85 | opacity: .4; 86 | background-color: #eee; 87 | } 88 | 89 | &.is-danger { 90 | border-color: $color-warning; 91 | background-color: rgba($color-warning, .05); 92 | } 93 | } 94 | 95 | .select { 96 | height: $finger-size; 97 | padding-left: 10px; 98 | padding-right: 10px; 99 | display: block; 100 | width: 100%; 101 | color: $color-dark; 102 | border: solid 1px $color-shadow; 103 | background-color: white; 104 | border-radius: $border-radius; 105 | 106 | &:disabled, 107 | &.disabled { 108 | cursor: not-allowed; 109 | opacity: .4; 110 | background-color: #eee; 111 | } 112 | 113 | &.is-danger { 114 | border-color: $color-warning; 115 | background-color: rgba($color-warning, .05); 116 | } 117 | } 118 | 119 | .Form { 120 | 121 | &-item { 122 | 123 | & + & { 124 | margin-top: 10px; 125 | } 126 | 127 | &-label { 128 | display: block; 129 | margin-bottom: 10px; 130 | } 131 | 132 | &-help { 133 | margin-top: 10px; 134 | font-size: .9em; 135 | color: $color-warning; 136 | } 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /src/stylesheet/helper/global.scss: -------------------------------------------------------------------------------- 1 | .icon { 2 | display: inline-block; 3 | vertical-align: middle; 4 | width: 1em; 5 | height: 1em; 6 | stroke-width: 0; 7 | stroke: currentColor; 8 | fill: currentColor; 9 | } 10 | -------------------------------------------------------------------------------- /src/stylesheet/helper/typography.scss: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: $font-family-body; 3 | font-size: $font-size-normal; 4 | line-height: $font-line-height; 5 | } 6 | 7 | h1, h2, h3, h4, h5, h6, b, strong, label { 8 | 9 | } 10 | 11 | h1, h2, h3, h4, h5, h6 { 12 | font-family: $font-family-title; 13 | } 14 | 15 | h6 { 16 | font-size: .9em; 17 | } 18 | 19 | h5 { 20 | font-size: 1em; 21 | } 22 | 23 | h4 { 24 | font-size: 1.4em; 25 | } 26 | 27 | h3 { 28 | font-size: 1.6em; 29 | } 30 | 31 | h2 { 32 | font-size: 1.8em; 33 | } 34 | 35 | h1 { 36 | font-size: 2em; 37 | } 38 | 39 | button, 40 | input, 41 | textarea { 42 | font-family: inherit; 43 | line-height: normal; 44 | font-size: inherit; 45 | font-weight: inherit; 46 | } 47 | -------------------------------------------------------------------------------- /src/stylesheet/helper/utility.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ademilter/vue-firebase-example/2735e0f56784cced50e4bd5a580b818327881271/src/stylesheet/helper/utility.scss -------------------------------------------------------------------------------- /src/stylesheet/reset/formalize.scss: -------------------------------------------------------------------------------- 1 | /*! formalize.css | MIT License | github.com/interacthings/formalize */ 2 | 3 | * { 4 | outline: 0; 5 | &, 6 | &:before, 7 | &:after { 8 | box-sizing: inherit; 9 | } 10 | } 11 | 12 | html, body { 13 | overflow-x: hidden; 14 | } 15 | 16 | html { 17 | box-sizing: border-box; 18 | text-rendering: optimizeLegibility; 19 | } 20 | 21 | body { 22 | -webkit-font-smoothing: antialiased; 23 | -moz-osx-font-smoothing: grayscale; 24 | } 25 | 26 | a { 27 | color: inherit; 28 | text-decoration: none; 29 | } 30 | 31 | button { 32 | cursor: pointer; 33 | background-color: transparent; 34 | } 35 | 36 | img { 37 | max-width: 100%; 38 | vertical-align: middle; 39 | } 40 | 41 | blockquote, dl, dd, h1, h2, h3, h4, h5, h6, figure, p, pre, fieldset, ul, ol, menu, form { 42 | margin: 0; 43 | } 44 | 45 | button, 46 | fieldset, 47 | iframe { 48 | border: 0; 49 | } 50 | 51 | fieldset, ul, ol, button, menu { 52 | padding: 0; 53 | } 54 | 55 | ol, ul { 56 | list-style: none; 57 | } 58 | 59 | textarea { 60 | resize: vertical; 61 | } 62 | 63 | table { 64 | width: 100%; 65 | border-collapse: collapse; 66 | border-spacing: 0; 67 | } 68 | 69 | th, td { 70 | padding: 0; 71 | } 72 | -------------------------------------------------------------------------------- /src/stylesheet/reset/normalize.scss: -------------------------------------------------------------------------------- 1 | /*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */ 2 | 3 | /* Document 4 | ========================================================================== */ 5 | 6 | /** 7 | * 1. Correct the line height in all browsers. 8 | * 2. Prevent adjustments of font size after orientation changes in 9 | * IE on Windows Phone and in iOS. 10 | */ 11 | 12 | html { 13 | line-height: 1.15; /* 1 */ 14 | -ms-text-size-adjust: 100%; /* 2 */ 15 | -webkit-text-size-adjust: 100%; /* 2 */ 16 | } 17 | 18 | /* Sections 19 | ========================================================================== */ 20 | 21 | /** 22 | * Remove the margin in all browsers (opinionated). 23 | */ 24 | 25 | body { 26 | margin: 0; 27 | } 28 | 29 | /** 30 | * Add the correct display in IE 9-. 31 | */ 32 | 33 | article, 34 | aside, 35 | footer, 36 | header, 37 | nav, 38 | section { 39 | display: block; 40 | } 41 | 42 | /** 43 | * Correct the font size and margin on `h1` elements within `section` and 44 | * `article` contexts in Chrome, Firefox, and Safari. 45 | */ 46 | 47 | h1 { 48 | font-size: 2em; 49 | margin: 0.67em 0; 50 | } 51 | 52 | /* Grouping content 53 | ========================================================================== */ 54 | 55 | /** 56 | * Add the correct display in IE 9-. 57 | * 1. Add the correct display in IE. 58 | */ 59 | 60 | figcaption, 61 | figure, 62 | main { /* 1 */ 63 | display: block; 64 | } 65 | 66 | /** 67 | * Add the correct margin in IE 8. 68 | */ 69 | 70 | figure { 71 | margin: 1em 40px; 72 | } 73 | 74 | /** 75 | * 1. Add the correct box sizing in Firefox. 76 | * 2. Show the overflow in Edge and IE. 77 | */ 78 | 79 | hr { 80 | box-sizing: content-box; /* 1 */ 81 | height: 0; /* 1 */ 82 | overflow: visible; /* 2 */ 83 | } 84 | 85 | /** 86 | * 1. Correct the inheritance and scaling of font size in all browsers. 87 | * 2. Correct the odd `em` font sizing in all browsers. 88 | */ 89 | 90 | pre { 91 | font-family: monospace, monospace; /* 1 */ 92 | font-size: 1em; /* 2 */ 93 | } 94 | 95 | /* Text-level semantics 96 | ========================================================================== */ 97 | 98 | /** 99 | * 1. Remove the gray background on active links in IE 10. 100 | * 2. Remove gaps in links underline in iOS 8+ and Safari 8+. 101 | */ 102 | 103 | a { 104 | background-color: transparent; /* 1 */ 105 | -webkit-text-decoration-skip: objects; /* 2 */ 106 | } 107 | 108 | /** 109 | * 1. Remove the bottom border in Chrome 57- and Firefox 39-. 110 | * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. 111 | */ 112 | 113 | abbr[title] { 114 | border-bottom: none; /* 1 */ 115 | text-decoration: underline; /* 2 */ 116 | text-decoration: underline dotted; /* 2 */ 117 | } 118 | 119 | /** 120 | * Prevent the duplicate application of `bolder` by the next rule in Safari 6. 121 | */ 122 | 123 | b, 124 | strong { 125 | font-weight: inherit; 126 | } 127 | 128 | /** 129 | * Add the correct font weight in Chrome, Edge, and Safari. 130 | */ 131 | 132 | b, 133 | strong { 134 | font-weight: bolder; 135 | } 136 | 137 | /** 138 | * 1. Correct the inheritance and scaling of font size in all browsers. 139 | * 2. Correct the odd `em` font sizing in all browsers. 140 | */ 141 | 142 | code, 143 | kbd, 144 | samp { 145 | font-family: monospace, monospace; /* 1 */ 146 | font-size: 1em; /* 2 */ 147 | } 148 | 149 | /** 150 | * Add the correct font style in Android 4.3-. 151 | */ 152 | 153 | dfn { 154 | font-style: italic; 155 | } 156 | 157 | /** 158 | * Add the correct background and color in IE 9-. 159 | */ 160 | 161 | mark { 162 | background-color: #ff0; 163 | color: #000; 164 | } 165 | 166 | /** 167 | * Add the correct font size in all browsers. 168 | */ 169 | 170 | small { 171 | font-size: 80%; 172 | } 173 | 174 | /** 175 | * Prevent `sub` and `sup` elements from affecting the line height in 176 | * all browsers. 177 | */ 178 | 179 | sub, 180 | sup { 181 | font-size: 75%; 182 | line-height: 0; 183 | position: relative; 184 | vertical-align: baseline; 185 | } 186 | 187 | sub { 188 | bottom: -0.25em; 189 | } 190 | 191 | sup { 192 | top: -0.5em; 193 | } 194 | 195 | /* Embedded content 196 | ========================================================================== */ 197 | 198 | /** 199 | * Add the correct display in IE 9-. 200 | */ 201 | 202 | audio, 203 | video { 204 | display: inline-block; 205 | } 206 | 207 | /** 208 | * Add the correct display in iOS 4-7. 209 | */ 210 | 211 | audio:not([controls]) { 212 | display: none; 213 | height: 0; 214 | } 215 | 216 | /** 217 | * Remove the border on images inside links in IE 10-. 218 | */ 219 | 220 | img { 221 | border-style: none; 222 | } 223 | 224 | /** 225 | * Hide the overflow in IE. 226 | */ 227 | 228 | svg:not(:root) { 229 | overflow: hidden; 230 | } 231 | 232 | /* Forms 233 | ========================================================================== */ 234 | 235 | /** 236 | * 1. Change the font styles in all browsers (opinionated). 237 | * 2. Remove the margin in Firefox and Safari. 238 | */ 239 | 240 | button, 241 | input, 242 | optgroup, 243 | select, 244 | textarea { 245 | font-family: sans-serif; /* 1 */ 246 | font-size: 100%; /* 1 */ 247 | line-height: 1.15; /* 1 */ 248 | margin: 0; /* 2 */ 249 | } 250 | 251 | /** 252 | * Show the overflow in IE. 253 | * 1. Show the overflow in Edge. 254 | */ 255 | 256 | button, 257 | input { /* 1 */ 258 | overflow: visible; 259 | } 260 | 261 | /** 262 | * Remove the inheritance of text transform in Edge, Firefox, and IE. 263 | * 1. Remove the inheritance of text transform in Firefox. 264 | */ 265 | 266 | button, 267 | select { /* 1 */ 268 | text-transform: none; 269 | } 270 | 271 | /** 272 | * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video` 273 | * controls in Android 4. 274 | * 2. Correct the inability to style clickable types in iOS and Safari. 275 | */ 276 | 277 | button, 278 | html [type="button"], /* 1 */ 279 | [type="reset"], 280 | [type="submit"] { 281 | -webkit-appearance: button; /* 2 */ 282 | } 283 | 284 | /** 285 | * Remove the inner border and padding in Firefox. 286 | */ 287 | 288 | button::-moz-focus-inner, 289 | [type="button"]::-moz-focus-inner, 290 | [type="reset"]::-moz-focus-inner, 291 | [type="submit"]::-moz-focus-inner { 292 | border-style: none; 293 | padding: 0; 294 | } 295 | 296 | /** 297 | * Restore the focus styles unset by the previous rule. 298 | */ 299 | 300 | button:-moz-focusring, 301 | [type="button"]:-moz-focusring, 302 | [type="reset"]:-moz-focusring, 303 | [type="submit"]:-moz-focusring { 304 | outline: 1px dotted ButtonText; 305 | } 306 | 307 | /** 308 | * Correct the padding in Firefox. 309 | */ 310 | 311 | fieldset { 312 | padding: 0.35em 0.75em 0.625em; 313 | } 314 | 315 | /** 316 | * 1. Correct the text wrapping in Edge and IE. 317 | * 2. Correct the color inheritance from `fieldset` elements in IE. 318 | * 3. Remove the padding so developers are not caught out when they zero out 319 | * `fieldset` elements in all browsers. 320 | */ 321 | 322 | legend { 323 | box-sizing: border-box; /* 1 */ 324 | color: inherit; /* 2 */ 325 | display: table; /* 1 */ 326 | max-width: 100%; /* 1 */ 327 | padding: 0; /* 3 */ 328 | white-space: normal; /* 1 */ 329 | } 330 | 331 | /** 332 | * 1. Add the correct display in IE 9-. 333 | * 2. Add the correct vertical alignment in Chrome, Firefox, and Opera. 334 | */ 335 | 336 | progress { 337 | display: inline-block; /* 1 */ 338 | vertical-align: baseline; /* 2 */ 339 | } 340 | 341 | /** 342 | * Remove the default vertical scrollbar in IE. 343 | */ 344 | 345 | textarea { 346 | overflow: auto; 347 | } 348 | 349 | /** 350 | * 1. Add the correct box sizing in IE 10-. 351 | * 2. Remove the padding in IE 10-. 352 | */ 353 | 354 | [type="checkbox"], 355 | [type="radio"] { 356 | box-sizing: border-box; /* 1 */ 357 | padding: 0; /* 2 */ 358 | } 359 | 360 | /** 361 | * Correct the cursor style of increment and decrement buttons in Chrome. 362 | */ 363 | 364 | [type="number"]::-webkit-inner-spin-button, 365 | [type="number"]::-webkit-outer-spin-button { 366 | height: auto; 367 | } 368 | 369 | /** 370 | * 1. Correct the odd appearance in Chrome and Safari. 371 | * 2. Correct the outline style in Safari. 372 | */ 373 | 374 | [type="search"] { 375 | -webkit-appearance: textfield; /* 1 */ 376 | outline-offset: -2px; /* 2 */ 377 | } 378 | 379 | /** 380 | * Remove the inner padding and cancel buttons in Chrome and Safari on macOS. 381 | */ 382 | 383 | [type="search"]::-webkit-search-cancel-button, 384 | [type="search"]::-webkit-search-decoration { 385 | -webkit-appearance: none; 386 | } 387 | 388 | /** 389 | * 1. Correct the inability to style clickable types in iOS and Safari. 390 | * 2. Change font properties to `inherit` in Safari. 391 | */ 392 | 393 | ::-webkit-file-upload-button { 394 | -webkit-appearance: button; /* 1 */ 395 | font: inherit; /* 2 */ 396 | } 397 | 398 | /* Interactive 399 | ========================================================================== */ 400 | 401 | /* 402 | * Add the correct display in IE 9-. 403 | * 1. Add the correct display in Edge, IE, and Firefox. 404 | */ 405 | 406 | details, /* 1 */ 407 | menu { 408 | display: block; 409 | } 410 | 411 | /* 412 | * Add the correct display in all browsers. 413 | */ 414 | 415 | summary { 416 | display: list-item; 417 | } 418 | 419 | /* Scripting 420 | ========================================================================== */ 421 | 422 | /** 423 | * Add the correct display in IE 9-. 424 | */ 425 | 426 | canvas { 427 | display: inline-block; 428 | } 429 | 430 | /** 431 | * Add the correct display in IE. 432 | */ 433 | 434 | template { 435 | display: none; 436 | } 437 | 438 | /* Hidden 439 | ========================================================================== */ 440 | 441 | /** 442 | * Add the correct display in IE 10-. 443 | */ 444 | 445 | [hidden] { 446 | display: none; 447 | } 448 | -------------------------------------------------------------------------------- /src/utils/loader.js: -------------------------------------------------------------------------------- 1 | import { createActionHelpers } from 'vuex-loading' 2 | 3 | const { startLoading, endLoading } = createActionHelpers({ 4 | moduleName: 'loading' 5 | }) 6 | 7 | export { startLoading, endLoading } 8 | -------------------------------------------------------------------------------- /src/view/Auth/index.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 109 | 110 | 125 | -------------------------------------------------------------------------------- /src/view/Auth/store/index.js: -------------------------------------------------------------------------------- 1 | import _ from 'lodash' 2 | 3 | export default { 4 | namespaced: true, 5 | state: { 6 | User: { 7 | rawData: null, 8 | cardData: null 9 | } 10 | }, 11 | getters: { 12 | isLogin: state => state.User.rawData !== null, 13 | hasCard: state => state.User.cardData !== null, 14 | User: state => state.User 15 | }, 16 | actions: {}, 17 | mutations: { 18 | saveRawData(state, payload) { 19 | console.log(payload) 20 | payload = JSON.parse(JSON.stringify(payload)) 21 | payload = _.pick(payload, ['createdAt', 'displayName', 'emailVerified', 'isAnonymous', 'lastLoginAt', 'photoURL', 'providerData', 'uid']) 22 | state.User.rawData = payload 23 | }, 24 | saveCardData(state, payload) { 25 | state.User.cardData = JSON.parse(JSON.stringify(payload)) 26 | }, 27 | logout(state) { 28 | state.User.rawData = null 29 | state.User.cardData = null 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/view/Home/index.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 46 | 47 | 66 | -------------------------------------------------------------------------------- /src/view/Home/store/index.js: -------------------------------------------------------------------------------- 1 | import { FIRESTORE } from '@/firebase' 2 | import _ from 'lodash' 3 | import { startLoading, endLoading } from '@/utils/loader' 4 | 5 | export default { 6 | namespaced: true, 7 | state: { 8 | isFirstPage: true, 9 | perPage: 12, 10 | isEnd: false, 11 | lastVisible: null, 12 | Cards: [] 13 | }, 14 | getters: { 15 | hasCards: state => state.Cards.length > 0, 16 | isEndCard: state => state.isEnd, 17 | Cards: state => state.Cards 18 | }, 19 | actions: { 20 | getCards({ state, commit, dispatch }) { 21 | startLoading(dispatch, 'loading cards') 22 | // 23 | let refUsers = FIRESTORE.collection('Users') 24 | .where('hasCard', '==', true) 25 | .limit(state.perPage) 26 | 27 | if (!state.isFirstPage) { 28 | refUsers = refUsers.startAfter(state.lastVisible) 29 | } 30 | 31 | refUsers 32 | .get() 33 | .then(documentSnapshots => { 34 | if (documentSnapshots.empty) { 35 | commit('endCard') 36 | return 37 | } 38 | commit('addCards', documentSnapshots) 39 | }) 40 | .catch(error => { 41 | console.log(error) 42 | }) 43 | .then(() => { 44 | endLoading(dispatch, 'loading cards') 45 | }) 46 | } 47 | }, 48 | mutations: { 49 | resetCards(state) { 50 | state.isFirstPage = true 51 | state.isEnd = false 52 | state.lastVisible = null 53 | state.Cards = [] 54 | }, 55 | endCard(state) { 56 | state.isEnd = true 57 | }, 58 | addCards(state, documentSnapshots) { 59 | if (state.isFirstPage) state.isFirstPage = false 60 | state.lastVisible = _.cloneDeep(documentSnapshots.docs[documentSnapshots.docs.length - 1]) 61 | documentSnapshots.forEach(doc => { 62 | state.Cards.push(_.cloneDeep(doc.data())) 63 | }) 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/view/Profile/index.vue: -------------------------------------------------------------------------------- 1 | 73 | 74 | 160 | 161 | 206 | -------------------------------------------------------------------------------- /src/view/Profile/store/index.js: -------------------------------------------------------------------------------- 1 | export default { 2 | namespaced: true, 3 | state: {}, 4 | getters: { 5 | // isLogin: state => state.user !== null 6 | }, 7 | actions: {}, 8 | mutations: { 9 | // login (state, payload) { 10 | // state.user = payload 11 | // } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/view/card/index.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 52 | 53 | 138 | -------------------------------------------------------------------------------- /src/view/card/link.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 45 | -------------------------------------------------------------------------------- /src/view/header/index.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 42 | 43 | 62 | -------------------------------------------------------------------------------- /src/view/icon/index.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 19 | -------------------------------------------------------------------------------- /static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ademilter/vue-firebase-example/2735e0f56784cced50e4bd5a580b818327881271/static/.gitkeep --------------------------------------------------------------------------------