An adaptable eCommerce website boilerplate based on Next.js 🔼, Graphql ⚛ and Stripe 💳
This project is the base I use when creating websites. It is a Next.js project bootstrapped with create-next-app
and using GraphCMS as it underlying headless CMS and Stripe payments for the eCommerce part. It can be adapted to use another CMS, like strapi, contentful, or any other headless CMS providing a multi-language graphql API.
This website tries to focus on best practices in the field of website creation. It focuses on:
next/head
puppeteer
on a serverless functionrobots.txt
and manifest.webmanifest
filesnext-translate
, next.js localized routing, localized content straight from the CMS and native number formatting using Intl.NumberFormat
React.Context
for global state (e.g. loading or cart state)vercel
First, rename the sample.env
file to .env
and adapt the values.
Then, run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying pages/index.js
. The page auto-updates as you edit the file.
API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.js
.
The pages/api
directory is mapped to /api/*
. Files in this directory are treated as API routes instead of React pages.
To learn more about Next.js, take a look at the following resources:
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
Check out our Next.js deployment documentation for more details.