Repository: strapi/strapi-starter-nuxt-e-commerce Branch: master Commit: 27aebc53d41d Files: 23 Total size: 21.8 KB Directory structure: gitextract_fb3yuxxp/ ├── .gitignore ├── LICENSE.txt ├── README.md ├── starter/ │ ├── .gitignore │ ├── assets/ │ │ ├── README.md │ │ └── css/ │ │ └── tailwind.css │ ├── components/ │ │ ├── Buttons.vue │ │ ├── Footer.vue │ │ ├── Navbar.vue │ │ ├── Products.vue │ │ └── icons/ │ │ ├── cart.vue │ │ ├── facebook.vue │ │ ├── github.vue │ │ └── twitter.vue │ ├── layouts/ │ │ └── default.vue │ ├── nuxt.config.js │ ├── package.json │ ├── pages/ │ │ ├── categories/ │ │ │ └── _id.vue │ │ ├── index.vue │ │ └── products/ │ │ └── _id.vue │ ├── tailwind.config.js │ └── utils/ │ └── medias.js └── starter.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ # Created by https://www.toptal.com/developers/gitignore/api/macos,visualstudiocode,windows # Edit at https://www.toptal.com/developers/gitignore?templates=macos,visualstudiocode,windows ### macOS ### # General .DS_Store .AppleDouble .LSOverride # Icon must end with two \r Icon # Thumbnails ._* # Files that might appear in the root of a volume .DocumentRevisions-V100 .fseventsd .Spotlight-V100 .TemporaryItems .Trashes .VolumeIcon.icns .com.apple.timemachine.donotpresent # Directories potentially created on remote AFP share .AppleDB .AppleDesktop Network Trash Folder Temporary Items .apdisk ### VisualStudioCode ### .vscode/* !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json *.code-workspace ### VisualStudioCode Patch ### # Ignore all local history of files .history ### Windows ### # Windows thumbnail cache files Thumbs.db Thumbs.db:encryptable ehthumbs.db ehthumbs_vista.db # Dump file *.stackdump # Folder config file [Dd]esktop.ini # Recycle Bin used on file shares $RECYCLE.BIN/ # Windows Installer files *.cab *.msi *.msix *.msm *.msp # Windows shortcuts *.lnk # End of https://www.toptal.com/developers/gitignore/api/macos,visualstudiocode,windows ================================================ FILE: LICENSE.txt ================================================ MIT License Copyright (c) [year] [fullname] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ **:no_entry: Deprecated** This repository is no longer maintained and only works for Strapi v3. To find the newest Strapi v4 starters, check out the [starters-and-templates monorepo](https://github.com/strapi/starters-and-templates/). --- # Strapi Starter Nuxt.js E-commerce Nuxt.js starter for creating a simple e-commerce website with Strapi. ![screenshot image](/screenshot.png) This starter allows you to try Strapi with Nuxt.js with the example of a simple e-commerce website where you can buy dev stickers. It is fully customizable and due to the fact that it is open source, fully open to contributions. So do not hesitate to add new features and report bugs! This starter uses the [Strapi corporate template](https://github.com/strapi/strapi-template-ecommerce) Check out all of our starters [here](https://strapi.io/starters) ## Features - 1 Component - 2 Collection types: Product, Category - 27 Created products - 6 Created categories - Permissions set to `true` for product and category - Responsive design using Tailwind css - Slug system - Publication system (draft & published) - Role based access controls - [@nuxt/strapi](https://strapi.nuxtjs.org/) module on the frontend - Payments handled with Snipcart This starter is using [Snipcart](https://snipcart.com/) which allows you setup a shopping cart on any website. They wrote a [tutorial](https://snipcart.com/blog/strapi-nuxt-ecommerce-tutorial) teaching you how to create this website but selling cupcakes! Payment will not work on localhost, we are redirecting you to this [tutorial](https://snipcart.com/blog/develop-a-snipcart-powered-website-locally-using-ngrok) if you want to test payment locally. ## Getting started Use our `create-strapi-starter` CLI to create your project. ```sh npx create-strapi-starter@3 my-site nuxt-e-commerce ``` The CLI will create a monorepo, install dependencies, and run your project automatically. The Nuxt frontend server will run here => [http://localhost:3000](http://localhost:3000) The Strapi backend server will run here => [http://localhost:1337](http://localhost:1337) ## Deploying to production You will need to deploy the `frontend` and `backend` projects separately. Here are the docs to deploy each one: - [Deploy Strapi](https://strapi.io/documentation/developer-docs/latest/setup-deployment-guides/deployment.html#hosting-provider-guides) - [Deploy Nuxt](https://nuxtjs.org/docs/2.x/deployment/deploying-to-21yunbox) Don't forget to setup the environment variables on your production app: For the frontend the following environment variable is required: - `API_URL`: URL of your Strapi backend, without trailing slash Enjoy this starter! ================================================ FILE: starter/.gitignore ================================================ ### Node template # Logs logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* # Runtime data pids *.pid *.seed *.pid.lock # Directory for instrumented libs generated by jscoverage/JSCover lib-cov # Coverage directory used by tools like istanbul coverage # nyc test coverage .nyc_output # test snapshots test/**/__snapshots__ # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) .grunt # Bower dependency directory (https://bower.io/) bower_components # node-waf configuration .lock-wscript # Compiled binary addons (https://nodejs.org/api/addons.html) build/Release # Dependency directories node_modules/ jspm_packages/ # TypeScript v1 declaration files typings/ # Optional npm cache directory .npm # Optional eslint cache .eslintcache # Optional REPL history .node_repl_history # Output of 'npm pack' *.tgz # Yarn Integrity file .yarn-integrity # dotenv environment variables file .env # parcel-bundler cache (https://parceljs.org/) .cache # next.js build output .next # nuxt.js build output .nuxt # Nuxt generate dist # vuepress build output .vuepress/dist # Serverless directories .serverless # IDE .idea # Service worker sw.* .DS_Store ================================================ FILE: starter/assets/README.md ================================================ # ASSETS **This directory is not required, you can delete it if you don't want to use it.** This directory contains your un-compiled assets such as LESS, SASS, or JavaScript. More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked). ================================================ FILE: starter/assets/css/tailwind.css ================================================ @import 'tailwindcss/base'; @import 'tailwindcss/components'; @import 'tailwindcss/utilities'; ================================================ FILE: starter/components/Buttons.vue ================================================ ================================================ FILE: starter/components/Footer.vue ================================================ ================================================ FILE: starter/components/Navbar.vue ================================================ ================================================ FILE: starter/components/Products.vue ================================================ ================================================ FILE: starter/components/icons/cart.vue ================================================ ================================================ FILE: starter/components/icons/facebook.vue ================================================ ================================================ FILE: starter/components/icons/github.vue ================================================ ================================================ FILE: starter/components/icons/twitter.vue ================================================ ================================================ FILE: starter/layouts/default.vue ================================================ ================================================ FILE: starter/nuxt.config.js ================================================ export default { /* ** Nuxt target ** See https://nuxtjs.org/api/configuration-target */ target: 'static', /* ** Headers of the page ** See https://nuxtjs.org/api/configuration-head */ // head: { title: "Buy stickers with Strapi, Nuxt.js and Snipcart", meta: [{ charset: 'utf-8' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' }, { hid: 'description', name: 'description', content: "e-commerce starter using Strapi, Nuxt.js and Snipcart" } ], link: [{ rel: 'preconnect', href: "https://app.snipcart.com" }, { rel: 'preconnect', href: "https://cdn.snipcart.com" }, { rel: 'stylesheet', href: "https://cdn.snipcart.com/themes/v3.0.16/default/snipcart.css" }, { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' } ], script: [{ src: 'https://cdn.snipcart.com/themes/v3.0.16/default/snipcart.js' }] }, /* ** Global CSS */ css: [], /* ** Plugins to load before mounting the App ** https://nuxtjs.org/guide/plugins */ plugins: [], /* ** Auto import components ** See https://nuxtjs.org/api/configuration-components */ components: true, /* ** Nuxt.js dev-modules */ buildModules: [ // Doc: https://github.com/nuxt-community/nuxt-tailwindcss '@nuxtjs/tailwindcss', ], /* ** Nuxt.js modules */ modules: ['@nuxtjs/strapi'], strapi: { url: process.env.API_URL || "http://localhost:1337", entities: [ 'products', 'categories' ], }, env: { storeUrl: process.env.STORE_URL || "http://localhost:1337" }, /* ** Build configuration ** See https://nuxtjs.org/api/configuration-build/ */ build: {} } ================================================ FILE: starter/package.json ================================================ { "name": "nuxt-strapi-snipcart", "version": "1.0.0", "private": true, "scripts": { "develop": "nuxt", "start": "nuxt start", "serve": "nuxt serve", "generate": "nuxt generate" }, "dependencies": { "@nuxtjs/strapi": "^0.1.3", "core-js": "^2.6.5", "nuxt": "^2.14.6", "vue-meta": "^2.4.0" }, "devDependencies": { "@nuxtjs/tailwindcss": "^2.0.0" } } ================================================ FILE: starter/pages/categories/_id.vue ================================================ ================================================ FILE: starter/pages/index.vue ================================================ ================================================ FILE: starter/pages/products/_id.vue ================================================ ================================================ FILE: starter/tailwind.config.js ================================================ /* ** TailwindCSS Configuration File ** ** Docs: https://tailwindcss.com/docs/configuration ** Default: https://github.com/tailwindcss/tailwindcss/blob/master/stubs/defaultConfig.stub.js */ module.exports = { theme: {}, variants: {}, plugins: [], purge: { // Learn more on https://tailwindcss.com/docs/controlling-file-size/#removing-unused-css enabled: process.env.NODE_ENV === 'production', content: [ 'components/**/*.vue', 'layouts/**/*.vue', 'pages/**/*.vue', 'plugins/**/*.js', 'nuxt.config.js' ] } } ================================================ FILE: starter/utils/medias.js ================================================ export function getStrapiMedia(url) { // Check if URL is a local path if (url.startsWith('/')) { // Prepend Strapi address return `http://localhost:1337${url}` } // Otherwise return full URL return url } ================================================ FILE: starter.json ================================================ { "template": "https://github.com/strapi/strapi-template-ecommerce" }