This project was created with Create React App. It uses React, Apollo, GraphQL and Fauna.
Demo: https://react-shop-demo.vercel.app/
Clone repository and install npm dependencies
git clone [email protected]:alexanderalmstrom/react-shop-demo.git && cd react-shop-demo && yarn
Create a .env
file in the root directory with your generated Fauna secret.
REACT_APP_FAUNA_SECRET=XXX
Import GraphQL schema in Fauna to create a new Collection in the database. Use the schema.gql
located in the root directory.
Create some products in Fauna GraphQL playground. For example:
mutation CreateProduct {
createProduct(data: { name: "Sneaker", price: 999.95 }) {
name
price
}
}
Run development server
yarn start
Build production files
yarn build
Run production build locally
npx serve build