Long form storytelling eCommerce in NextJS
This boilerplate implements long form storytelling for super rich eCommerce experiences. This boilerplate is using NextJS with incremental builds for a fast JAMStack webshop.
Check out our live demo of the long form storytelling boilerplate.
To get started with your own long form storytelling run the following command.
npx @crystallize/cli <your-project-name>
Running this command will allow you to add in the following:
- The preferred boilerplate, which will be ‘NextJS - Content and commerce’ in this case.
- The tenant: you can either enter your own tenant or go with the demo tenant to test everything out
Running the Project
Running the project in development is very straightforward. Running the following command will start up the development server:
npm run dev
Accessing the Development Site
Once the development server is running, you will be able to browse to http://localhost:3000.
Configuring Tokens and Environment Variables for Deployment
There are two ways of deploying to Vercel.
The easiest is through the Vercel Github integration. Follow that guide to get automatic deployments for each git push.
Alternatively, you can also deploy manually from the command line. In order to enable that you need to install Vercel and login via the CLI:
There is one environment variable you need to set:
We recommend that you set this using the Vercel dashboard.
Deploying the Project
Deploying your Crystallize project with Vercel is easy. If you have used the github integration, you simply push to GitHub and that’s it. A deployment will be initiated.
If you want to do it with the CLI, you execute a deployment with this command:
This will build the website and deploy it to Vercel. The terminal will say whether the deployment was successful or not. If it has succeeded, you will be given a URL where your site has been deployed.
If you are deploying to production, you can also use the following command to deploy your website to a production domain if you have configured one for your project within the dashboard of Vercel: