├── static
└── .gitkeep
├── .eslintignore
├── config
├── prod.env.js
├── dev.env.js
└── index.js
├── src
├── assets
│ └── logo.png
├── main.js
├── lib
│ └── API.js
├── components
│ ├── Landing.vue
│ ├── Create.vue
│ ├── Edit.vue
│ ├── Products.vue
│ ├── Product.vue
│ └── ProductForm.vue
├── router
│ └── index.js
└── App.vue
├── .editorconfig
├── .gitignore
├── .babelrc
├── .postcssrc.js
├── index.html
├── README.md
├── .eslintrc.js
└── package.json
/static/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | /build/
2 | /config/
3 | /dist/
4 | /*.js
5 |
--------------------------------------------------------------------------------
/config/prod.env.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | module.exports = {
3 | NODE_ENV: '"production"'
4 | }
5 |
--------------------------------------------------------------------------------
/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/w3cj/intro-vuetify-crud/HEAD/src/assets/logo.png
--------------------------------------------------------------------------------
/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 | NODE_ENV: '"development"'
7 | })
8 |
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | /dist/
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Editor directories and files
9 | .idea
10 | .vscode
11 | *.suo
12 | *.ntvs*
13 | *.njsproj
14 | *.sln
15 |
--------------------------------------------------------------------------------
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | ["env", {
4 | "modules": false,
5 | "targets": {
6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7 | }
8 | }],
9 | "stage-2"
10 | ],
11 | "plugins": ["transform-vue-jsx", "transform-runtime"]
12 | }
13 |
--------------------------------------------------------------------------------
/.postcssrc.js:
--------------------------------------------------------------------------------
1 | // https://github.com/michael-ciniawsky/postcss-load-config
2 |
3 | module.exports = {
4 | "plugins": {
5 | "postcss-import": {},
6 | "postcss-url": {},
7 | // to edit target browsers: use "browserslist" field in package.json
8 | "autoprefixer": {}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Intro to Vuetify
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | // The Vue build version to load with the `import` command
2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
3 | import Vue from 'vue';
4 | import Vuetify from 'vuetify';
5 | import 'vuetify/dist/vuetify.min.css';
6 |
7 | import App from './App';
8 | import router from './router';
9 |
10 | Vue.config.productionTip = false;
11 |
12 | Vue.use(Vuetify);
13 |
14 | /* eslint-disable no-new */
15 | new Vue({
16 | el: '#app',
17 | router,
18 | components: { App },
19 | template: '',
20 | });
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # intro-vuetify
2 |
3 | > Intro to Vuetify.js
4 |
5 | ## Build Setup
6 |
7 | ``` bash
8 | # install dependencies
9 | npm install
10 |
11 | # serve with hot reload at localhost:8080
12 | npm run dev
13 |
14 | # build for production with minification
15 | npm run build
16 |
17 | # build for production and view the bundle analyzer report
18 | npm run build --report
19 | ```
20 |
21 | For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
22 |
--------------------------------------------------------------------------------
/src/lib/API.js:
--------------------------------------------------------------------------------
1 | import ezFetch from 'ez-fetch';
2 |
3 | const API_URL = 'http://localhost:3000/api/v1/products';
4 |
5 | export default {
6 | getProducts() {
7 | return ezFetch.get(API_URL);
8 | },
9 | getProduct(id) {
10 | return ezFetch.get(`${API_URL}/${id}`);
11 | },
12 | createProduct(product) {
13 | return ezFetch.post(API_URL, product);
14 | },
15 | updateProduct(id, product) {
16 | return ezFetch.put(`${API_URL}/${id}`, product);
17 | },
18 | deleteProduct(id) {
19 | return ezFetch.delete(`${API_URL}/${id}`);
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/src/components/Landing.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | Products
4 |
5 |
6 |
7 |
12 |
13 |
14 |
30 |
--------------------------------------------------------------------------------
/src/router/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import Router from 'vue-router';
3 | import Landing from '@/components/Landing';
4 | import Products from '@/components/Products';
5 | import Product from '@/components/Product';
6 | import Create from '@/components/Create';
7 | import Edit from '@/components/Edit';
8 |
9 | Vue.use(Router);
10 |
11 | export default new Router({
12 | routes: [
13 | {
14 | path: '/',
15 | name: 'Landing',
16 | component: Landing,
17 | },
18 | {
19 | path: '/products',
20 | name: 'Products',
21 | component: Products,
22 | },
23 | {
24 | path: '/products/create',
25 | name: 'Create',
26 | component: Create,
27 | },
28 | {
29 | path: '/products/:id',
30 | name: 'Product',
31 | component: Product,
32 | },
33 | {
34 | path: '/products/:id/edit',
35 | name: 'Edit',
36 | component: Edit,
37 | },
38 | ],
39 | });
40 |
--------------------------------------------------------------------------------
/src/components/Create.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
40 |
41 |
43 |
--------------------------------------------------------------------------------
/src/components/Edit.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
50 |
51 |
53 |
--------------------------------------------------------------------------------
/src/components/Products.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
{{product.title}}
10 |
{{product.description}}
11 |
${{product.price}}
12 |
{{product.quantity}} in stock
13 |
14 |
15 |
16 | View
25 |
26 |
27 |
28 |
29 |
30 |
31 |
53 |
54 |
56 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | // https://eslint.org/docs/user-guide/configuring
2 |
3 | module.exports = {
4 | root: true,
5 | parserOptions: {
6 | parser: 'babel-eslint'
7 | },
8 | env: {
9 | browser: true,
10 | },
11 | // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
12 | // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
13 | extends: ['plugin:vue/essential', 'airbnb-base'],
14 | // required to lint *.vue files
15 | plugins: [
16 | 'vue'
17 | ],
18 | // check if imports actually resolve
19 | settings: {
20 | 'import/resolver': {
21 | webpack: {
22 | config: 'build/webpack.base.conf.js'
23 | }
24 | }
25 | },
26 | // add your custom rules here
27 | rules: {
28 | // don't require .vue extension when importing
29 | 'import/extensions': ['error', 'always', {
30 | js: 'never',
31 | vue: 'never'
32 | }],
33 | // disallow reassignment of function parameters
34 | // disallow parameter object manipulation except for specific exclusions
35 | 'no-param-reassign': ['error', {
36 | props: true,
37 | ignorePropertyModificationsFor: [
38 | 'state', // for vuex state
39 | 'acc', // for reduce accumulators
40 | 'e' // for e.returnvalue
41 | ]
42 | }],
43 | // allow optionalDependencies
44 | 'import/no-extraneous-dependencies': ['error', {
45 | optionalDependencies: ['test/unit/index.js']
46 | }],
47 | // allow debugger during development
48 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/components/Product.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
{{product.title}}
10 |
{{product.description}}
11 |
${{product.price}}
12 |
{{product.quantity}} in stock
13 |
14 |
15 |
16 | Edit
24 | Delete
25 |
26 |
27 |
28 |
29 |
30 |
31 |
67 |
68 |
70 |
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 | view_list
11 |
12 |
13 |
14 | Products
15 |
16 |
17 |
18 |
19 |
20 | view_list
21 |
22 |
23 |
24 | Create Product
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | CJs Products
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | © 2018
43 |
44 |
45 |
46 |
47 |
57 |
58 |
68 |
--------------------------------------------------------------------------------
/src/components/ProductForm.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
11 |
16 |
23 |
29 |
35 | submit
36 | clear
37 |
38 |
39 |
40 |
41 |
42 |
80 |
81 |
83 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "intro-vuetify",
3 | "version": "1.0.0",
4 | "description": "Intro to Vuetify.js",
5 | "author": "CJ R ",
6 | "private": true,
7 | "scripts": {
8 | "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
9 | "start": "npm run dev",
10 | "lint": "eslint --ext .js,.vue src",
11 | "build": "node build/build.js"
12 | },
13 | "dependencies": {
14 | "ez-fetch": "^1.2.0",
15 | "vue": "^2.5.2",
16 | "vue-router": "^3.0.1",
17 | "vuetify": "^1.0.6"
18 | },
19 | "devDependencies": {
20 | "autoprefixer": "^7.1.2",
21 | "babel-core": "^6.22.1",
22 | "babel-eslint": "^8.2.1",
23 | "babel-helper-vue-jsx-merge-props": "^2.0.3",
24 | "babel-loader": "^7.1.1",
25 | "babel-plugin-syntax-jsx": "^6.18.0",
26 | "babel-plugin-transform-runtime": "^6.22.0",
27 | "babel-plugin-transform-vue-jsx": "^3.5.0",
28 | "babel-preset-env": "^1.3.2",
29 | "babel-preset-stage-2": "^6.22.0",
30 | "chalk": "^2.0.1",
31 | "copy-webpack-plugin": "^4.0.1",
32 | "css-loader": "^0.28.0",
33 | "eslint": "^4.15.0",
34 | "eslint-config-airbnb-base": "^11.3.0",
35 | "eslint-friendly-formatter": "^3.0.0",
36 | "eslint-import-resolver-webpack": "^0.8.3",
37 | "eslint-loader": "^1.7.1",
38 | "eslint-plugin-import": "^2.7.0",
39 | "eslint-plugin-vue": "^4.0.0",
40 | "extract-text-webpack-plugin": "^3.0.0",
41 | "file-loader": "^1.1.4",
42 | "friendly-errors-webpack-plugin": "^1.6.1",
43 | "html-webpack-plugin": "^2.30.1",
44 | "node-notifier": "^5.1.2",
45 | "optimize-css-assets-webpack-plugin": "^3.2.0",
46 | "ora": "^1.2.0",
47 | "portfinder": "^1.0.13",
48 | "postcss-import": "^11.0.0",
49 | "postcss-loader": "^2.0.8",
50 | "postcss-url": "^7.2.1",
51 | "rimraf": "^2.6.0",
52 | "semver": "^5.3.0",
53 | "shelljs": "^0.7.6",
54 | "uglifyjs-webpack-plugin": "^1.1.1",
55 | "url-loader": "^0.5.8",
56 | "vue-loader": "^13.3.0",
57 | "vue-style-loader": "^3.0.1",
58 | "vue-template-compiler": "^2.5.2",
59 | "webpack": "^3.6.0",
60 | "webpack-bundle-analyzer": "^2.9.0",
61 | "webpack-dev-server": "^2.9.1",
62 | "webpack-merge": "^4.1.0"
63 | },
64 | "engines": {
65 | "node": ">= 6.0.0",
66 | "npm": ">= 3.0.0"
67 | },
68 | "browserslist": [
69 | "> 1%",
70 | "last 2 versions",
71 | "not ie <= 8"
72 | ]
73 | }
74 |
--------------------------------------------------------------------------------
/config/index.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | // Template version: 1.3.1
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: false,
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: 'cheap-module-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 | cssSourceMap: true
44 | },
45 |
46 | build: {
47 | // Template for index.html
48 | index: path.resolve(__dirname, '../dist/index.html'),
49 |
50 | // Paths
51 | assetsRoot: path.resolve(__dirname, '../dist'),
52 | assetsSubDirectory: 'static',
53 | assetsPublicPath: '/',
54 |
55 | /**
56 | * Source Maps
57 | */
58 |
59 | productionSourceMap: true,
60 | // https://webpack.js.org/configuration/devtool/#production
61 | devtool: '#source-map',
62 |
63 | // Gzip off by default as many popular static hosts such as
64 | // Surge or Netlify already gzip all static assets for you.
65 | // Before setting to `true`, make sure to:
66 | // npm install --save-dev compression-webpack-plugin
67 | productionGzip: false,
68 | productionGzipExtensions: ['js', 'css'],
69 |
70 | // Run the build command with an extra argument to
71 | // View the bundle analyzer report after build finishes:
72 | // `npm run build --report`
73 | // Set to `true` or `false` to always turn it on or off
74 | bundleAnalyzerReport: process.env.npm_config_report
75 | }
76 | }
77 |
--------------------------------------------------------------------------------