Giter Site home page Giter Site logo

sdras / sample-vue-shop Goto Github PK

View Code? Open in Web Editor NEW
1.2K 1.2K 249.0 1.25 MB

See readme for newer repo details! A sample shop that shows how to manage payments with Vue, Stripe, and Serverless Functions

Home Page: https://shoppity.azurewebsites.net/

License: MIT License

JavaScript 2.73% Vue 91.51% CSS 3.72% Batchfile 2.04%
nuxt stripe stripe-checkout stripe-elements stripe-payments vue vue-stripe vue-stripe-payments vuejs

sample-vue-shop's Introduction

Note: This repo is no longer being maintained in favor of a newer, improved version: https://github.com/sdras/ecommerce-netlify

Vue Sample Shop

This small demo shows how to accept payments with stripe with Vue.js using a serverless function. It's actually not that bad to set up! The shop also shows how a number of concepts work in Vue. Server side rendering and routing is done with Nuxt.js. Centralized state management with Vuex for product details. Of note, using computed properties, .sync, CSS Grid, and transition-group.

Live demo at https://shoppity.azurewebsites.net/

Articles explaining the demo will be available soon at https://css-tricks.com/

The serverless function is open source as well, available at this repo https://github.com/sdras/sample-stripe-handler

Vue stripe sample shop

Build Setup

# install dependencies
$ npm install # Or yarn

# serve with hot reload at localhost:3000
$ npm run dev

# generate static project, get ready for launch on app services
$ npm run generate

sample-vue-shop's People

Contributors

afontcu avatar ifyour avatar sdras avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sample-vue-shop's Issues

Improve filterProducts function by using ES6 filter

Hi Sarah,

thanks for this repo, it's a great example and I think It'll come in handy soon enough for me :)

I noticed a couple of lines where you could improve the readability of your code by using ES6 functions such as filter, map and reduce.

For example, you could replace the whole filterProducts with a one-liner:

const filterProducts = (state, filterBy) => {

const filterByCategory = (arr, title) => arr.filter(item => item.category === title)

// and then, in your getters:
women: state => filterByCategory(state.products, 'women'),

I'd be happy to submit a PR if you think it's worth it.

Again, thanks for your work! ๐Ÿ’ช

How to create filter for 10,000 items ?

How to deal with filter widget with items more than 10,000 ? Wouldn't it create memory leakages on my client side ?
Any idea for a situation where you can call API every time a query parameter is added to the url ?
TY for this great repo

Is this all served from one HTTP GET Function?

Hello @sdras !

Just watched your talk today. I've been wanting to learn to use Vue and have been doing some Functions and Logic Apps work so this was right up my alley but by the end of the video I was left asking myself, "When does she start actually using Functions?"

I know you talked about Functions in the beginning, with regards to Stripe, but is that the only place Functions is used? This repo doesn't appear to be ready to be dropped in as a Function app so does that mean it is hosted on a traditional web host?

Thank you!

shop cart error

first of all nice work.
after successful payment cart is cleared up but if you add new item than last bought item is in cart as well, every time you add new item in cart all last bought items stay there

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.