├── .editorconfig ├── .eslintrc.js ├── .gitignore ├── .prettierrc ├── README.md ├── assets └── README.md ├── components ├── Ads.vue ├── Featured.vue ├── Footer.vue ├── HeroSection.vue ├── Logo.vue ├── Nav.vue ├── NewsLetter.vue ├── Products.vue └── README.md ├── layouts ├── README.md └── default.vue ├── middleware └── README.md ├── nuxt.config.js ├── package.json ├── pages ├── README.md ├── all.vue ├── cart.vue ├── index.vue ├── men.vue ├── products │ └── _products.vue └── women.vue ├── plugins ├── README.md └── vue-swal.js ├── procfile ├── static ├── README.md ├── Repeat_Grid_2.png ├── favicon.ico ├── icon.png └── uriel-soberanes-MxVkWPiJALs-unsplash-removebg-preview.png ├── store ├── README.md └── index.js ├── tailwind.config.js └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | browser: true, 5 | node: true, 6 | }, 7 | parserOptions: { 8 | parser: 'babel-eslint', 9 | }, 10 | extends: [ 11 | '@nuxtjs', 12 | 'prettier', 13 | 'prettier/vue', 14 | 'plugin:prettier/recommended', 15 | 'plugin:nuxt/recommended', 16 | ], 17 | plugins: ['prettier'], 18 | // add your custom rules here 19 | rules: {}, 20 | } 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Node template 3 | # Logs 4 | /logs 5 | *.log 6 | npm-debug.log* 7 | yarn-debug.log* 8 | yarn-error.log* 9 | 10 | # Runtime data 11 | pids 12 | *.pid 13 | *.seed 14 | *.pid.lock 15 | 16 | # Directory for instrumented libs generated by jscoverage/JSCover 17 | lib-cov 18 | 19 | # Coverage directory used by tools like istanbul 20 | coverage 21 | 22 | # nyc test coverage 23 | .nyc_output 24 | 25 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 26 | .grunt 27 | 28 | # Bower dependency directory (https://bower.io/) 29 | bower_components 30 | 31 | # node-waf configuration 32 | .lock-wscript 33 | 34 | # Compiled binary addons (https://nodejs.org/api/addons.html) 35 | build/Release 36 | 37 | # Dependency directories 38 | node_modules/ 39 | jspm_packages/ 40 | 41 | # TypeScript v1 declaration files 42 | typings/ 43 | 44 | # Optional npm cache directory 45 | .npm 46 | 47 | # Optional eslint cache 48 | .eslintcache 49 | 50 | # Optional REPL history 51 | .node_repl_history 52 | 53 | # Output of 'npm pack' 54 | *.tgz 55 | 56 | # Yarn Integrity file 57 | .yarn-integrity 58 | 59 | # dotenv environment variables file 60 | .env 61 | 62 | # parcel-bundler cache (https://parceljs.org/) 63 | .cache 64 | 65 | # next.js build output 66 | .next 67 | 68 | # nuxt.js build output 69 | .nuxt 70 | 71 | # Nuxt generate 72 | dist 73 | 74 | # vuepress build output 75 | .vuepress/dist 76 | 77 | # Serverless directories 78 | .serverless 79 | 80 | # IDE / Editor 81 | .idea 82 | 83 | # Service worker 84 | sw.* 85 | 86 | # macOS 87 | .DS_Store 88 | 89 | # Vim swap files 90 | *.swp 91 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "singleQuote": true 4 | } 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # e-commerce 2 | 3 | ## Build Setup 4 | 5 | ```bash 6 | # install dependencies 7 | $ yarn install 8 | 9 | # serve with hot reload at localhost:3000 10 | $ yarn dev 11 | 12 | # build for production and launch server 13 | $ yarn build 14 | $ yarn start 15 | 16 | # generate static project 17 | $ yarn generate 18 | ``` 19 | 20 | For detailed explanation on how things work, check out [Nuxt.js docs](https://nuxtjs.org). 21 | -------------------------------------------------------------------------------- /assets/README.md: -------------------------------------------------------------------------------- 1 | # ASSETS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your un-compiled assets such as LESS, SASS, or JavaScript. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked). 8 | -------------------------------------------------------------------------------- /components/Ads.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /components/Featured.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 40 | 41 | 46 | -------------------------------------------------------------------------------- /components/Footer.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /components/HeroSection.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 30 | 31 | 62 | -------------------------------------------------------------------------------- /components/Logo.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 36 | -------------------------------------------------------------------------------- /components/Nav.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 32 | 33 | 54 | -------------------------------------------------------------------------------- /components/NewsLetter.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /components/Products.vue: -------------------------------------------------------------------------------- 1 | 31 | 32 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /components/README.md: -------------------------------------------------------------------------------- 1 | # COMPONENTS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | The components directory contains your Vue.js Components. 6 | 7 | _Nuxt.js doesn't supercharge these components._ 8 | -------------------------------------------------------------------------------- /layouts/README.md: -------------------------------------------------------------------------------- 1 | # LAYOUTS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your Application Layouts. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts). 8 | -------------------------------------------------------------------------------- /layouts/default.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 78 | -------------------------------------------------------------------------------- /middleware/README.md: -------------------------------------------------------------------------------- 1 | # MIDDLEWARE 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your application middleware. 6 | Middleware let you define custom functions that can be run before rendering either a page or a group of pages. 7 | 8 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing#middleware). 9 | -------------------------------------------------------------------------------- /nuxt.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | // Global page headers (https://go.nuxtjs.dev/config-head) 3 | head: { 4 | title: 'e-commerce', 5 | meta: [ 6 | { charset: 'utf-8' }, 7 | { name: 'viewport', content: 'width=device-width, initial-scale=1' }, 8 | { hid: 'description', name: 'description', content: '' }, 9 | ], 10 | link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }], 11 | }, 12 | 13 | // Global CSS (https://go.nuxtjs.dev/config-css) 14 | css: [], 15 | 16 | // Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins) 17 | plugins: ['~/plugins/vue-swal'], 18 | 19 | // Auto import components (https://go.nuxtjs.dev/config-components) 20 | components: true, 21 | 22 | // Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules) 23 | buildModules: [ 24 | // https://go.nuxtjs.dev/eslint 25 | '@nuxtjs/eslint-module', 26 | // https://go.nuxtjs.dev/tailwindcss 27 | '@nuxtjs/tailwindcss', 28 | // https://go.nuxtjs.dev/pwa 29 | '@nuxtjs/pwa', 30 | ], 31 | 32 | // Modules (https://go.nuxtjs.dev/config-modules) 33 | modules: [ 34 | // https://go.nuxtjs.dev/axios 35 | '@nuxtjs/axios', 36 | // https://go.nuxtjs.dev/pwa 37 | '@nuxtjs/pwa', 38 | // strapi for nuxt 39 | '@nuxtjs/strapi', 40 | ], 41 | 42 | strapi: { 43 | entities: ['products', 'orders', 'subscribers'], 44 | }, 45 | // Axios module configuration (https://go.nuxtjs.dev/config-axios) 46 | axios: {}, 47 | 48 | // Build Configuration (https://go.nuxtjs.dev/config-build) 49 | build: { 50 | /* 51 | ** Run ESLint on save 52 | */ 53 | extend(config, ctx) { 54 | if (ctx.dev && ctx.isClient) { 55 | config.module.rules.push({ 56 | enforce: 'pre', 57 | test: /\.(js|vue)$/, 58 | loader: 'eslint-loader', 59 | exclude: /(node_modules)/, 60 | }) 61 | } 62 | }, 63 | /* 64 | ** Add vue-swal 65 | */ 66 | vendor: ['vue-swal'], 67 | }, 68 | 69 | env: { 70 | STRAPI_URL: `https://enigmatic-peak-00809.herokuapp.com`, 71 | }, 72 | } 73 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "e-commerce", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "nuxt && yarn lint:js --fix", 7 | "build": "nuxt build", 8 | "start": "nuxt start", 9 | "generate": "nuxt generate", 10 | "lint:js": "eslint --ext .js,.vue --ignore-path .gitignore .", 11 | "lint": "yarn lint:js" 12 | }, 13 | "dependencies": { 14 | "@nuxtjs/axios": "^5.12.2", 15 | "@nuxtjs/pwa": "^3.0.2", 16 | "@nuxtjs/strapi": "^0.1.9", 17 | "@stripe/stripe-js": "^1.11.0", 18 | "core-js": "^3.6.5", 19 | "nuxt": "^2.14.6", 20 | "vue-swal": "^1.0.0" 21 | }, 22 | "devDependencies": { 23 | "@nuxtjs/eslint-config": "^3.1.0", 24 | "@nuxtjs/eslint-module": "^2.0.0", 25 | "@nuxtjs/tailwindcss": "^3.1.0", 26 | "babel-eslint": "^10.1.0", 27 | "eslint": "^7.10.0", 28 | "eslint-config-prettier": "^6.12.0", 29 | "eslint-plugin-nuxt": "^1.0.0", 30 | "eslint-plugin-prettier": "^3.1.4", 31 | "prettier": "^2.1.2" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /pages/README.md: -------------------------------------------------------------------------------- 1 | # PAGES 2 | 3 | This directory contains your Application Views and Routes. 4 | The framework reads all the `*.vue` files inside this directory and creates the router of your application. 5 | 6 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing). 7 | -------------------------------------------------------------------------------- /pages/all.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /pages/cart.vue: -------------------------------------------------------------------------------- 1 | 43 | 44 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /pages/index.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 36 | 37 | 44 | -------------------------------------------------------------------------------- /pages/men.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /pages/products/_products.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /pages/women.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /plugins/README.md: -------------------------------------------------------------------------------- 1 | # PLUGINS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains Javascript plugins that you want to run before mounting the root Vue.js application. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/plugins). 8 | -------------------------------------------------------------------------------- /plugins/vue-swal.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueSwal from 'vue-swal' 3 | 4 | Vue.use(VueSwal) 5 | -------------------------------------------------------------------------------- /procfile: -------------------------------------------------------------------------------- 1 | web: nuxt start -------------------------------------------------------------------------------- /static/README.md: -------------------------------------------------------------------------------- 1 | # STATIC 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your static files. 6 | Each file inside this directory is mapped to `/`. 7 | Thus you'd want to delete this README.md before deploying to production. 8 | 9 | Example: `/static/robots.txt` is mapped as `/robots.txt`. 10 | 11 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#static). 12 | -------------------------------------------------------------------------------- /static/Repeat_Grid_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oviecodes/nuxt-ecommerce/4a5b16d40c54fe4cbe0f1e2d175ed8f6bf18c7af/static/Repeat_Grid_2.png -------------------------------------------------------------------------------- /static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oviecodes/nuxt-ecommerce/4a5b16d40c54fe4cbe0f1e2d175ed8f6bf18c7af/static/favicon.ico -------------------------------------------------------------------------------- /static/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oviecodes/nuxt-ecommerce/4a5b16d40c54fe4cbe0f1e2d175ed8f6bf18c7af/static/icon.png -------------------------------------------------------------------------------- /static/uriel-soberanes-MxVkWPiJALs-unsplash-removebg-preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oviecodes/nuxt-ecommerce/4a5b16d40c54fe4cbe0f1e2d175ed8f6bf18c7af/static/uriel-soberanes-MxVkWPiJALs-unsplash-removebg-preview.png -------------------------------------------------------------------------------- /store/README.md: -------------------------------------------------------------------------------- 1 | # STORE 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your Vuex Store files. 6 | Vuex Store option is implemented in the Nuxt.js framework. 7 | 8 | Creating a file in this directory automatically activates the option in the framework. 9 | 10 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/vuex-store). 11 | -------------------------------------------------------------------------------- /store/index.js: -------------------------------------------------------------------------------- 1 | export const state = () => ({ 2 | allProducts: [], 3 | featuredProducts: [], 4 | menProducts: [], 5 | womenProducts: [], 6 | cartItems: [], 7 | }) 8 | 9 | export const getters = { 10 | /* 11 | return items from store 12 | */ 13 | allProducts: (state) => state.allProducts, 14 | featuredProducts: (state) => state.featuredProducts, 15 | menProducts: (state) => state.menProducts, 16 | womenProducts: (state) => state.womenProducts, 17 | getCart: (state) => state.cartItems, 18 | getCartTotal: (state) => 19 | state.cartItems.length < 1 20 | ? '0' 21 | : state.cartItems 22 | .map((el) => el.price * el.quantity) 23 | .reduce((a, b) => a + b), 24 | } 25 | 26 | export const actions = { 27 | async addItemToCart({ commit }, cartItem) { 28 | await commit('setCartItem', cartItem) 29 | }, 30 | async deleteCartItem({ commit }, id) { 31 | await commit('removeCartItem', id) 32 | }, 33 | } 34 | 35 | export const mutations = { 36 | setProducts: (state, products) => (state.allProducts = products), 37 | setFeaturedProducts: (state, products) => (state.featuredProducts = products), 38 | setMenProducts: (state, products) => (state.menProducts = products), 39 | setWomenProducts: (state, products) => (state.womenProducts = products), 40 | setCartItem: (state, item) => state.cartItems.push(item), 41 | removeCartItem: (state, id) => 42 | state.cartItems.splice( 43 | state.cartItems.findIndex((el) => el.id === id), 44 | 1 45 | ), 46 | } 47 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | theme: { 3 | backgroundColor: (theme) => ({ 4 | ...theme('colors'), 5 | primary: '#9c7474', 6 | button: '#bec1a6', 7 | }), 8 | }, 9 | } 10 | --------------------------------------------------------------------------------