jamstack-cms / jamstack-ecommerce
- суббота, 15 февраля 2020 г. в 00:20:50
JavaScript
A starter project for building performant ECommerce applications with Gatsby and React
JAMstack ECommerce Professional provides a way to quickly get up and running with a fully configurable JAMstack E Commerce site.
Out of the box, the site uses completely static data coming from a provider at providers/inventoryProvider.js. You can update this provider to fetch data from any real API by changing the call in the getInventory function.
This project is still in Beta.
$ git clone https://github.com/jamstack-cms/jamstack-ecommerce.git$ yarn
# or
$ npm install$ gatsby develop
# or to build
$ gatsby buildUpdate providers/inventoryProvider.js with your own inventory provider.
Update src/pages/admin.js with sign up, sign, in, sign out, and confirm sign in methods.
Update src/templates/ViewInventory.js with methods to interact with the actual inventory API.
Update src/components/formComponents/AddInventory.js with methods to add item to actual inventory API.
If you're using dynamic images over http, you can add a build step into exports.createPages in gatsby-node.esm.js to download the images locally to improve the user experience. You can also add a placeholder image in src/components/Image.js or make some adjustments in that component for other image loading enhancements.
To see an example of how to process payments server-side with stripe, check out the Lambda function in the snippets folder.