├── .babelrc
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── .postcssrc.js
├── 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
├── circle.yml
├── config
├── dev.env.js
├── index.js
└── prod.env.js
├── index.html
├── package.json
├── src
├── App.vue
├── i18n
│ ├── index.js
│ └── store
│ │ └── 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
│ ├── helper.js
│ ├── http.js
│ └── loader.js
└── view
│ ├── global
│ ├── app-footer
│ │ └── index.vue
│ ├── app-header
│ │ └── index.vue
│ └── app-navigation
│ │ └── index.vue
│ └── pages
│ ├── About
│ ├── i18n
│ │ └── index.json
│ ├── index.vue
│ ├── route
│ │ └── index.js
│ └── store
│ │ └── index.js
│ ├── Contact
│ ├── i18n
│ │ └── index.json
│ ├── index.vue
│ ├── model
│ │ └── index.js
│ ├── route
│ │ └── index.js
│ └── store
│ │ └── index.js
│ └── Home
│ ├── i18n
│ └── index.json
│ ├── index.vue
│ ├── route
│ └── index.js
│ └── store
│ └── index.js
└── static
└── .gitkeep
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | ["env", {
4 | "modules": false
5 | }],
6 | "stage-2"
7 | ],
8 | "plugins": ["transform-runtime"]
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/
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: [
16 | 'html',
17 | 'pug'
18 | ],
19 | // add your custom rules here
20 | 'rules': {
21 | // allow paren-less arrow functions
22 | 'arrow-parens': 0,
23 | // allow async-await
24 | 'generator-star-spacing': 0,
25 | // allow debugger during development
26 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/.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 | .idea
12 | .vscode
13 | *.suo
14 | *.ntvs*
15 | *.njsproj
16 | *.sln
17 |
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/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 Starter Kit
2 |
3 | - :speech_balloon: multi-language support
4 | - :warning: form validations ready (https://github.com/baianat/vee-validate)
5 | - :scissors: input mask (https://github.com/vuejs-tips/vue-the-mask)
6 | - :truck: state management with vuex
7 | - :link: router management
8 |
9 | ## Build Setup
10 |
11 | ``` bash
12 | # install dependencies
13 | npm install
14 |
15 | # serve with hot reload at localhost:8080
16 | npm run dev
17 |
18 | # build for production with minification
19 | npm run build
20 |
21 | # build for production and view the bundle analyzer report
22 | npm run build --report
23 | ```
24 |
--------------------------------------------------------------------------------
/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 =
9 | process.env.NODE_ENV === 'production'
10 | ? config.build.assetsSubDirectory
11 | : config.dev.assetsSubDirectory
12 | return path.posix.join(assetsSubDirectory, _path)
13 | }
14 |
15 | exports.cssLoaders = function (options) {
16 | options = options || {}
17 |
18 | const cssLoader = {
19 | loader: 'css-loader',
20 | options: {
21 | sourceMap: options.sourceMap
22 | }
23 | }
24 |
25 | var postcssLoader = {
26 | loader: 'postcss-loader',
27 | options: {
28 | sourceMap: options.sourceMap
29 | }
30 | }
31 |
32 | // generate loader string to be used with extract text plugin
33 | function generateLoaders(loader, loaderOptions) {
34 | const loaders = options.usePostCSS
35 | ? [cssLoader, postcssLoader]
36 | : [cssLoader]
37 | if (loader) {
38 | loaders.push({
39 | loader: loader + '-loader',
40 | options: Object.assign({}, loaderOptions, {
41 | sourceMap: options.sourceMap
42 | })
43 | })
44 | }
45 |
46 | // Extract CSS when that option is specified
47 | // (which is the case during production build)
48 | if (options.extract) {
49 | return ExtractTextPlugin.extract({
50 | use: loaders,
51 | fallback: 'vue-style-loader'
52 | })
53 | } else {
54 | return ['vue-style-loader'].concat(loaders)
55 | }
56 | }
57 |
58 | // https://vue-loader.vuejs.org/en/configurations/extract-css.html
59 | return {
60 | css: generateLoaders(),
61 | postcss: generateLoaders(),
62 | less: generateLoaders('less'),
63 | sass: generateLoaders('sass', {indentedSyntax: true}),
64 | scss: generateLoaders('sass', {
65 | data: '@import "~@/stylesheet/config/variables";'
66 | }),
67 | stylus: generateLoaders('stylus'),
68 | styl: generateLoaders('stylus')
69 | }
70 | }
71 |
72 | // Generate loaders for standalone style files (outside of .vue)
73 | exports.styleLoaders = function (options) {
74 | const output = []
75 | const loaders = exports.cssLoaders(options)
76 | for (const extension in loaders) {
77 | const loader = loaders[extension]
78 | output.push({
79 | test: new RegExp('\\.' + extension + '$'),
80 | use: loader
81 | })
82 | }
83 | return output
84 | }
85 |
86 | exports.createNotifierCallback = function () {
87 | const notifier = require('node-notifier')
88 |
89 | return (severity, errors) => {
90 | if (severity !== 'error') {
91 | return
92 | }
93 | const error = errors[0]
94 |
95 | const filename = error.file && error.file.split('!').pop()
96 | notifier.notify({
97 | title: pkg.name,
98 | message: severity + ': ' + error.name,
99 | subtitle: filename || '',
100 | icon: path.join(__dirname, 'logo.png')
101 | })
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/circle.yml:
--------------------------------------------------------------------------------
1 | machine:
2 | timezone:
3 | Europe/Istanbul
4 | node:
5 | version: 8.9.4
6 | database:
7 | override:
8 | - echo "Skipping DB."
9 | dependencies:
10 | post:
11 | - npm run build
12 | deployment:
13 | production:
14 | branch: master
15 | commands:
16 | - surge --project ./dist/ --domain vue-starter-kit.surge.sh
17 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 | },
14 | "dependencies": {
15 | "axios": "^0.17.1",
16 | "lodash": "^4.17.5",
17 | "moment": "^2.20.1",
18 | "vee-validate": "^2.0.3",
19 | "vue": "^2.5.13",
20 | "vue-i18n": "^7.4.2",
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 | "moment-locales-webpack-plugin": "^1.0.4",
28 | "@kazupon/vue-i18n-loader": "^0.2.1",
29 | "autoprefixer": "^7.1.2",
30 | "babel-core": "^6.22.1",
31 | "babel-eslint": "^7.1.1",
32 | "babel-loader": "^7.1.1",
33 | "babel-plugin-transform-runtime": "^6.22.0",
34 | "babel-preset-env": "^1.3.2",
35 | "babel-preset-stage-2": "^6.22.0",
36 | "babel-register": "^6.22.0",
37 | "chalk": "^2.0.1",
38 | "copy-webpack-plugin": "^4.0.1",
39 | "css-loader": "^0.28.0",
40 | "eslint": "^3.19.0",
41 | "eslint-config-standard": "^10.2.1",
42 | "eslint-friendly-formatter": "^3.0.0",
43 | "eslint-loader": "^1.7.1",
44 | "eslint-plugin-html": "^3.0.0",
45 | "eslint-plugin-import": "^2.7.0",
46 | "eslint-plugin-node": "^5.2.0",
47 | "eslint-plugin-promise": "^3.4.0",
48 | "eslint-plugin-pug": "^1.1.1",
49 | "eslint-plugin-standard": "^3.0.1",
50 | "eventsource-polyfill": "^0.9.6",
51 | "extract-text-webpack-plugin": "^3.0.0",
52 | "file-loader": "^1.1.4",
53 | "friendly-errors-webpack-plugin": "^1.6.1",
54 | "html-webpack-plugin": "^2.30.1",
55 | "node-notifier": "^5.1.2",
56 | "node-sass": "^4.7.2",
57 | "optimize-css-assets-webpack-plugin": "^3.2.0",
58 | "ora": "^1.2.0",
59 | "portfinder": "^1.0.13",
60 | "postcss-import": "^11.0.0",
61 | "postcss-loader": "^2.0.8",
62 | "pug": "^2.0.0-rc.4",
63 | "rimraf": "^2.6.0",
64 | "sass-loader": "^6.0.6",
65 | "semver": "^5.3.0",
66 | "shelljs": "^0.7.6",
67 | "surge": "^0.19.0",
68 | "url-loader": "^0.5.8",
69 | "vue-loader": "^13.3.0",
70 | "vue-style-loader": "^3.0.1",
71 | "vue-template-compiler": "^2.5.2",
72 | "webpack": "^3.6.0",
73 | "webpack-bundle-analyzer": "^2.10.0",
74 | "webpack-dev-server": "^2.9.1",
75 | "webpack-merge": "^4.1.1"
76 | },
77 | "engines": {
78 | "node": ">= 8.9.0",
79 | "npm": ">= 5.6.0"
80 | },
81 | "browserslist": [
82 | "> 1%",
83 | "last 1 versions",
84 | "not ie <= 8"
85 | ]
86 | }
87 |
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 | .App
3 | AppHeader
4 | AppNavigation
5 | main.AppContent
6 | router-view
7 | AppFooter
8 |
9 |
10 |
37 |
38 |
41 |
--------------------------------------------------------------------------------
/src/i18n/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import VueI18n from 'vue-i18n'
3 |
4 | Vue.use(VueI18n)
5 |
6 | export default new VueI18n({
7 | locale: 'tr'
8 | })
9 |
--------------------------------------------------------------------------------
/src/i18n/store/index.js:
--------------------------------------------------------------------------------
1 | export default {
2 | namespaced: true,
3 | state: {
4 | langDefault: localStorage.lang,
5 | langFallback: 'tr',
6 | langSupport: ['tr', 'en']
7 | },
8 | getters: {
9 | langDefault: state => {
10 | if (state.langSupport.indexOf(state.langDefault) === -1) {
11 | return state.langFallback
12 | }
13 | return state.langDefault
14 | },
15 | langSupport: state => state.langSupport
16 | },
17 | actions: {},
18 | mutations: {
19 | LANG_CHANGE (state, { lang, app }) {
20 | state.langDefault = lang
21 | localStorage.setItem('lang', lang)
22 | app.$root.$i18n.locale = lang
23 | app.$root.$validator.localize(lang)
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App'
3 | import router from './router'
4 | import i18n from './i18n'
5 | import store from '@/store'
6 | import VeeValidate, { Validator } from 'vee-validate'
7 | import tr from 'vee-validate/dist/locale/tr'
8 | import VueLoading from 'vuex-loading'
9 |
10 | Validator.localize('tr', tr)
11 |
12 | const config = {
13 | events: 'input'
14 | }
15 |
16 | Vue.use(VueLoading)
17 | Vue.use(VeeValidate, config)
18 | Vue.config.productionTip = false
19 |
20 | /* eslint-disable no-new */
21 | new Vue({
22 | el: '#app',
23 | router,
24 | i18n,
25 | store,
26 | vueLoading: new VueLoading({ useVuex: true }),
27 | template: '',
28 | components: { App }
29 | })
30 |
--------------------------------------------------------------------------------
/src/router/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Router from 'vue-router'
3 |
4 | // Pages
5 | import Home from '@/view/pages/Home/route'
6 | import About from '@/view/pages/About/route'
7 | import Contact from '@/view/pages/Contact/route'
8 |
9 | Vue.use(Router)
10 |
11 | const router = new Router({
12 | routes: [
13 | Home,
14 | About,
15 | Contact
16 | ]
17 | })
18 |
19 | export default router
20 |
--------------------------------------------------------------------------------
/src/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Vuex from 'vuex'
3 |
4 | // Global
5 | import i18n from '@/i18n/store'
6 |
7 | // Pages
8 | import Home from '@/view/pages/Home/store'
9 | import About from '@/view/pages/About/store'
10 | import Contact from '@/view/pages/Contact/store'
11 |
12 | Vue.use(Vuex)
13 |
14 | const debug = process.env.NODE_ENV !== 'production'
15 |
16 | export default new Vuex.Store({
17 | modules: {
18 | i18n,
19 | Home,
20 | About,
21 | Contact
22 | },
23 | strict: debug
24 | })
25 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/src/stylesheet/config/mixin.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ademilter/vue-starter-kit/91a22238d3297ed833b81f625830354fa2a8e82b/src/stylesheet/config/mixin.scss
--------------------------------------------------------------------------------
/src/stylesheet/config/variables.scss:
--------------------------------------------------------------------------------
1 | // GLOBAL
2 | $transition: 120ms;
3 | $finger-size: 46px;
4 | $border-radius: 4px;
5 |
6 | // COLOR
7 | $color-primary: #ade;
8 | $color-success: #1ecf72;
9 | $color-warning: #fc7a5d;
10 | $color-dark: #323232;
11 | $color-light: #777;
12 | //
13 | $color-text-light: $color-light;
14 | $color-text-dark: $color-dark;
15 |
16 | // FONT
17 | $font-family-fallback: "Helvetica Neue", Helvetica, Arial, sans-serif;
18 | $font-family: "Raleway", $font-family-fallback;
19 | $font-line-height: 1.4;
20 | $font-size-normal: 16px;
21 | $font-size-small: 14px;
22 | $font-weight-light: 300;
23 | $font-weight-normal: 500;
24 | $font-weight-bold: 700;
25 |
--------------------------------------------------------------------------------
/src/stylesheet/helper/form.scss:
--------------------------------------------------------------------------------
1 | .btn, .text {
2 | font-family: inherit;
3 | font-weight: $font-weight-bold;
4 | line-height: normal;
5 | }
6 |
7 | .btn {
8 | user-select: none;
9 | height: $finger-size;
10 | display: inline-flex;
11 | align-items: center;
12 | justify-content: center;
13 | padding-left: 20px;
14 | padding-right: 20px;
15 | color: white;
16 | background-color: $color-primary;
17 | border-radius: $border-radius;
18 |
19 | &:disabled,
20 | &-disabled {
21 | cursor: not-allowed !important;
22 | background-color: #e6e6e6 !important;
23 | color: darken(#e6e6e6, 30%) !important;
24 | border-color: #e6e6e6 !important;
25 | }
26 |
27 | &-full {
28 | display: flex;
29 | width: 100%;
30 | }
31 |
32 | &-blue {
33 | color: white;
34 | background-color: $color-success;
35 | }
36 |
37 | &-light {
38 | color: $color-light;
39 | background-color: #eaeaeb;
40 | }
41 |
42 | &-ilginc {
43 | color: $color-success;
44 | background-color: #fff1e8;
45 | }
46 |
47 | &-ghost {
48 | color: $color-warning;
49 | border: 1px solid;
50 | background-color: white;
51 |
52 | &:active, &:focus {
53 | background-color: $color-warning;
54 | color: #FFF;
55 | border-color: $color-warning;
56 | }
57 | }
58 |
59 | &-icon {
60 | width: $finger-size;
61 | padding-left: 0;
62 | padding-right: 0;
63 | background-color: transparent;
64 | }
65 |
66 | .icon-left {
67 | margin-right: 10px;
68 | }
69 |
70 | .icon-right {
71 | margin-left: 10px;
72 | }
73 |
74 | }
75 |
76 | .txt {
77 | display: block;
78 | width: 100%;
79 | min-height: $finger-size;
80 | padding-top: 5px;
81 | padding-bottom: 5px;
82 | padding-left: 10px;
83 | padding-right: 10px;
84 | color: $color-text-dark;
85 | border: solid 1px #ccc;
86 | background-color: white;
87 | border-radius: $border-radius;
88 |
89 | &:focus {
90 | border-color: rgba($color-warning, .4);
91 | }
92 |
93 | &.is-danger {
94 | border-color: $color-warning;
95 | background-color: rgba($color-warning, .05);
96 | }
97 | }
98 |
99 | .Form {
100 |
101 | &-item {
102 |
103 | & + & {
104 | margin-top: 20px;
105 | }
106 |
107 | &-label {
108 | display: block;
109 | margin-bottom: 10px;
110 | }
111 |
112 | .control {
113 |
114 | }
115 |
116 | &-help {
117 | margin-top: 10px;
118 | font-size: $font-size-small;
119 | color: $color-warning;
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/src/stylesheet/helper/global.scss:
--------------------------------------------------------------------------------
1 | .icon {
2 | display: inline-block;
3 | vertical-align: middle;
4 | width: 24px;
5 | height: 24px;
6 | stroke-width: 0;
7 | stroke: currentColor;
8 | fill: currentColor;
9 | }
10 |
--------------------------------------------------------------------------------
/src/stylesheet/helper/typography.scss:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: $font-family;
3 | font-weight: $font-weight-normal;
4 | font-size: $font-size-normal;
5 | line-height: $font-line-height;
6 | }
7 |
8 | h1, h2, h3, h4, h5, h6, b, strong, label {
9 | font-weight: $font-weight-bold;
10 | }
11 |
12 | small {
13 | font-size: $font-size-small;
14 | }
15 |
--------------------------------------------------------------------------------
/src/stylesheet/helper/utility.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ademilter/vue-starter-kit/91a22238d3297ed833b81f625830354fa2a8e82b/src/stylesheet/helper/utility.scss
--------------------------------------------------------------------------------
/src/stylesheet/reset/formalize.scss:
--------------------------------------------------------------------------------
1 | /*! formalize.css | MIT License | github.com/interacthings/formalize */
2 |
3 | * {
4 | &,
5 | &:before,
6 | &:after {
7 | box-sizing: inherit;
8 | }
9 | }
10 |
11 | html {
12 | box-sizing: border-box;
13 | text-rendering: optimizeLegibility;
14 | }
15 |
16 | body {
17 | overflow-x: hidden;
18 | -webkit-font-smoothing: antialiased;
19 | -moz-osx-font-smoothing: grayscale;
20 | }
21 |
22 | a {
23 | color: inherit;
24 | text-decoration: none;
25 | }
26 |
27 | img {
28 | vertical-align: middle;
29 | }
30 |
31 | blockquote, dl, dd, h1, h2, h3, h4, h5, h6, figure, p, pre, fieldset, ul, ol, menu, form {
32 | margin: 0;
33 | }
34 |
35 | button, fieldset, iframe {
36 | border: 0;
37 | }
38 |
39 | fieldset, ul, ol, button, menu {
40 | padding: 0;
41 | }
42 |
43 | ol, ul {
44 | list-style: none;
45 | }
46 |
47 | textarea {
48 | resize: vertical;
49 | }
50 |
51 | table {
52 | width: 100%;
53 | border-collapse: collapse;
54 | border-spacing: 0;
55 | }
56 |
57 | td {
58 | padding: 0;
59 | }
60 |
--------------------------------------------------------------------------------
/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/helper.js:
--------------------------------------------------------------------------------
1 | export const isDev = () => process.env.NODE_ENV === 'development'
2 |
--------------------------------------------------------------------------------
/src/utils/http.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios'
2 |
3 | export const HTTP = axios.create({
4 | baseURL: process.env.API_URL
5 | })
6 |
7 | export default HTTP
8 |
--------------------------------------------------------------------------------
/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/global/app-footer/index.vue:
--------------------------------------------------------------------------------
1 |
2 | .AppFooter
3 | select(v-model="siteLang")
4 | option(v-for="(lang, index) in langSupport",
5 | :val="lang",
6 | :key="index") {{ lang }}
7 |
8 |
9 |
39 |
40 |
49 |
--------------------------------------------------------------------------------
/src/view/global/app-header/index.vue:
--------------------------------------------------------------------------------
1 |
2 | {
3 | "en": {
4 | "title": "Example Application"
5 | },
6 | "tr": {
7 | "title": "Örnek Uygulama"
8 | }
9 | }
10 |
11 |
12 |
13 | .AppHeader
14 | h4 {{ $t('title') }}
15 |
16 |
17 |
22 |
23 |
33 |
--------------------------------------------------------------------------------
/src/view/global/app-navigation/index.vue:
--------------------------------------------------------------------------------
1 |
2 | {
3 | "en": {
4 | "home": "Home",
5 | "about": "About",
6 | "contact": "Contact"
7 | },
8 | "tr": {
9 | "home": "Anasayfa",
10 | "about": "Hakkımda",
11 | "contact": "İletişim"
12 | }
13 | }
14 |
15 |
16 |
17 | .AppNavigation
18 | ul
19 | router-link(v-for="(item, index) in mainNav",
20 | tag="li", :to="item.path", :key="index")
21 | a {{ $t(item.name) }}
22 |
23 |
24 |
43 |
44 |
67 |
--------------------------------------------------------------------------------
/src/view/pages/About/i18n/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "en": {
3 | "title": "About"
4 | },
5 | "tr": {
6 | "title": "Hakkımda"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/view/pages/About/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | .Home
5 | h1.title {{ $t('title') }}
6 |
7 |
8 |
9 |
14 |
15 |
20 |
--------------------------------------------------------------------------------
/src/view/pages/About/route/index.js:
--------------------------------------------------------------------------------
1 | import About from '../'
2 |
3 | export default {
4 | path: '/about',
5 | name: 'About',
6 | component: About,
7 | meta: {
8 | main_menu: true
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/view/pages/About/store/index.js:
--------------------------------------------------------------------------------
1 | // import HTTP from '@/utils/http'
2 |
3 | export default {
4 | namespaced: true,
5 | state: {},
6 | getters: {},
7 | actions: {},
8 | mutations: {}
9 | }
10 |
--------------------------------------------------------------------------------
/src/view/pages/Contact/i18n/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "en": {
3 | "title": "Contact",
4 | "email": "Email",
5 | "message": "Message",
6 | "send": "Send"
7 | },
8 | "tr": {
9 | "title": "İletişim",
10 | "email": "Eposta",
11 | "message": "Mesaj",
12 | "send": "Gönder"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/view/pages/Contact/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | .Home
5 | h1.title {{ $t('title') }}
6 |
7 | form.Form(@submit.prevent="submitForm")
8 |
9 | div.Form-item
10 | label.Form-item-label {{ $t('email') }}
11 | .control
12 | input.txt(
13 | name="email",
14 | data-vv-as="Eposta",
15 | v-model="form.email",
16 | v-validate="'required|email'",
17 | :class="{ 'is-danger': errors.has('email') }",
18 | type="email")
19 | p.Form-item-help.is-danger(
20 | v-show="errors.has('email')"
21 | ) {{ errors.first('email') }}
22 |
23 | div.Form-item
24 | label.Form-item-label {{ $t('message') }}
25 | .control
26 | textarea.txt(
27 | rows="3",
28 | name="message",
29 | data-vv-as="Mesaj",
30 | v-model="form.message",
31 | v-validate="'required'",
32 | :class="{ 'is-danger': errors.has('message') }")
33 | p.Form-item-help.is-danger(
34 | v-show="errors.has('message')"
35 | ) {{ errors.first('message') }}
36 |
37 | div.Form-item
38 | button.btn(
39 | type="submit",
40 | :disabled="$loading.isLoading('sending message')"
41 | ) {{ $t('send') }}
42 |
43 | .Notes
44 | template(v-if="$loading.isLoading('loading messages')")
45 | h5 Loading...
46 | template(v-else)
47 | .Item(
48 | v-for="message in messages",
49 | :key="message.id")
50 | p.email {{ message.email }}
51 | p.message {{ message.message }}
52 | time.date {{ message.humanTime }}
53 |
54 |
55 |
56 |
87 |
88 |
113 |
--------------------------------------------------------------------------------
/src/view/pages/Contact/model/index.js:
--------------------------------------------------------------------------------
1 | import _findIndex from 'lodash/findIndex'
2 | import moment from 'moment'
3 |
4 | export default class Messages {
5 | constructor (messages = []) {
6 | this.list = messages
7 | }
8 |
9 | addMessages (messages) {
10 | this.list = []
11 | messages.forEach(message => this.addMessage(message))
12 | }
13 |
14 | addMessage (message) {
15 | let newMessage = new Message(message)
16 | this.list.unshift(newMessage)
17 | }
18 |
19 | deleteMessage (id) {
20 | let index = this.findIndex(id)
21 | if (index > -1) {
22 | this.list.splice(index, 1)
23 | }
24 | }
25 |
26 | findIndex (Id) {
27 | return _findIndex(this.list, ['id', Id])
28 | }
29 | }
30 |
31 | export class Message {
32 | constructor (message) {
33 | this.createdAt = message.createdAt
34 | this.email = message.email
35 | this.id = message.id
36 | this.message = message.message
37 | }
38 |
39 | get humanTime () {
40 | return moment.unix(this.createdAt).fromNow()
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/view/pages/Contact/route/index.js:
--------------------------------------------------------------------------------
1 | import Contact from '../'
2 |
3 | export default {
4 | path: '/contact',
5 | name: 'Contact',
6 | component: Contact,
7 | meta: {
8 | main_menu: true
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/view/pages/Contact/store/index.js:
--------------------------------------------------------------------------------
1 | import HTTP from '@/utils/http'
2 | import Messages from '../model'
3 | import { startLoading, endLoading } from '@/utils/loader'
4 |
5 | export default {
6 | namespaced: true,
7 | state: {
8 | messages: new Messages()
9 | },
10 | getters: {
11 | messages: state => state.messages.list
12 | },
13 | actions: {
14 | async getMessages ({ commit, dispatch }) {
15 | try {
16 | startLoading(dispatch, 'loading messages')
17 | const RES = await HTTP.get('contact')
18 | commit('GET_MESSAGES', RES.data)
19 | return RES
20 | } catch (err) {
21 | throw Error(err)
22 | } finally {
23 | endLoading(dispatch, 'loading messages')
24 | }
25 | },
26 | async sendMessage ({ commit, dispatch }, newMessage) {
27 | try {
28 | startLoading(dispatch, 'sending message')
29 | const RES = await HTTP.post('contact', newMessage)
30 | commit('SEND_MESSAGE', RES.data)
31 | return RES
32 | } catch (err) {
33 | throw Error(err)
34 | } finally {
35 | endLoading(dispatch, 'sending message')
36 | }
37 | }
38 | },
39 | mutations: {
40 | GET_MESSAGES (state, data) {
41 | state.messages.addMessages(data)
42 | },
43 | SEND_MESSAGE (state, data) {
44 | state.messages.addMessage(data)
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/view/pages/Home/i18n/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "en": {
3 | "title": "Welcome!"
4 | },
5 | "tr": {
6 | "title": "Hoş geldin!"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/view/pages/Home/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | .Home
5 | h1.title {{ $t('title') }}
6 |
7 |
8 |
9 |
14 |
15 |
21 |
--------------------------------------------------------------------------------
/src/view/pages/Home/route/index.js:
--------------------------------------------------------------------------------
1 | import Home from '../'
2 |
3 | export default {
4 | path: '/',
5 | name: 'Home',
6 | component: Home,
7 | meta: {
8 | main_menu: true
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/view/pages/Home/store/index.js:
--------------------------------------------------------------------------------
1 | // import HTTP from '@/utils/http'
2 |
3 | export default {
4 | namespaced: true,
5 | state: {},
6 | getters: {},
7 | actions: {},
8 | mutations: {}
9 | }
10 |
--------------------------------------------------------------------------------
/static/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ademilter/vue-starter-kit/91a22238d3297ed833b81f625830354fa2a8e82b/static/.gitkeep
--------------------------------------------------------------------------------