corejam dershop app - Serverless Jamstack Webshop
npm install @corejam/plugin-dershop
Open Source Serverless Webhop |
hello@corejam.io
DerShop is a serverless webshop built with Corejam.
To start the development shop under examples/nextjs:
``bash`
$ cd examples/nextjs
$ yarn dev
Visit: http://localhost:3000
GraphQL Playground: http://localhost:3000/api/graphql
Coming soon
We currently offer a bootstrap script to launch a new FaunaDB and have it bootstrapped with the schema & sample products.
Head over to FaunaDB and under Account settings generate a new Admin Key. We will use this to bootstrap a new db, generate a new key and add data.
`bash
$ cd packages/dershop
$ node tests/bootstrap.js --help
Usage: bootstrap.js [options] [command]
Commands:
fauna Bootstrap a new faunaDB
help Display help
version Display version
Options:
-d, --dbSecret Your DB Secret key (FaunaDB)
-f, --faker Add faker data to the database (disabled by default)
-h, --help Output usage information
-v, --version Output the version number
`
`bash`
$ node tests/bootstrap.js --dbSecret
Created DB
secret:
waiting on index
Done in 12.30s.
Copy the into your for the SECRET_KEY
Your .env should have the following values:
`bash`
DB_DRIVER=DB_FAUNA
SECRET_KEY=
Your local development instance should now connect to faunadB.
To deploy the development shop to vercel we need to move our compiled dist/ folders from various packages into our
next shop to be uploaded with the deployment. (This step is only required for dev setup)
`bash`
$ cd
$ node ./utils/hoistPackagesForDeployment.js
This will move packages into /examples/nextjs to allow us to deploy everything in one go.
We still have some manual steps for zeit, first run vercel inside your example shop to get a custom my.project.now.sh domain assigned. We will then use this to give the deployment environment variables for graphql:
`bash``
$ vercel --build-env SECRET_KEY=