• Stars
    star
    422
  • Rank 100,451 (Top 3 %)
  • Language
    TypeScript
  • License
    GNU General Publi...
  • Created about 4 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ”ฅ Next.js (React) headless eCommerce site with Typescript, WordPress (WooCommerce) backend and Algolia search

Playwright Tests Codacy Badge CodeFactor Quality Gate Status

Screenshot 1

Star History

Star History Chart

Next.js Ecommerce site with WooCommerce backend

Live URL: https://next-woocommerce.dfweb.no

Table Of Contents (TOC)

Installation

  1. Install and activate the following required plugins, in your WordPress plugin directory:

Optional plugin:

The current release has been tested and is confirmed working with the following versions:

  • WordPress version 6.1.1
  • WooCommerce version 7.4.0
  • WP GraphQL version 1.13.8
  • WooGraphQL version 0.12.0
  • WPGraphQL CORS version 2.1
  1. For debugging and testing, install either:

    https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/ (Firefox)

    https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm (Chrome)

  2. Make sure WooCommerce has some products already

  3. Clone or fork the repo and modify .env.example and rename it to .env

    Then set the environment variables accordingly in Vercel or your preferred hosting solution.

    See https://vercel.com/docs/environment-variables

  4. Modify the values according to your setup

  5. Start the server with npm run dev

  6. Enable COD (Cash On Demand) payment method in WooCommerce

  7. Add a product to the cart

  8. Proceed to checkout (Gรฅ til kasse)

  9. Fill in your details and place the order

Features

  • Next.js version 13.4.7
  • React 18
  • Typescript
  • Tests with Playwright
  • Connect to Woocommerce GraphQL API and list name, price and display image for products
  • Support for simple products and variable products
  • Cart handling and checkout with WooCommerce (Cash On Delivery only for now)
  • Algolia search (requires algolia-woo-indexer)
  • Meets WCAG accessibility standards where possible
  • Placeholder for products without images
  • Apollo Client with GraphQL
  • React Hook Form
  • Native HTML5 form validation
  • Animations with Framer motion, Styled components and Animate.css
  • Loading spinner created with Styled Components
  • Shows page load progress with Nprogress during navigation
  • Fully responsive design
  • Category and product listings
  • Show stock status
  • Pretty URLs with builtin Nextjs functionality
  • Tailwind 3 for styling
  • JSDoc comments

Troubleshooting

I am getting a cart undefined error or other GraphQL errors

Check that you are using the 0.12.0 version of the wp-graphql-woocommerce plugin

The products page isn't loading

Check the attributes of the products. Right now the application requires Size and Color.

Issues

Overall the application is working as intended, but it has not been tested extensively in a production environment. More testing and debugging is required before deploying it in a production environment.

With that said, keep the following in mind:

  • Currently only simple products and variable products work without any issues. Other product types are not known to work.
  • Only Cash On Delivery (COD) is currently supported. More payment methods may be added later.

TODO

  • Add total to cart/checkout page
  • Copy billing address to shipping address
  • Add order dashboard and require login
  • Hide products not in stock
  • Add better SEO
  • Re-add Next/image when it is working better

More Repositories

1

nuxtjs-woocommerce

โšก๏ธ Nuxt 3 and Vue 3 headless eCommerce site with WooCommerce backend and Algolia search
Vue
167
star
2

laravel-vue-ecommerce

Laravel 10 eCommerce site with Vue 3 and Stripe
JavaScript
125
star
3

wp-algolia-woo-indexer

โœ๏ธ WordPress plugin that sends WooCommerce products to Algolia. Used with headless eCommerce.
PHP
29
star
4

Modern-JavaScript-for-the-Impatient

Code for the book Modern JavaScript for the Impatient
JavaScript
27
star
5

headless-wp

Plugin to enable a headless WP experience
PHP
23
star
6

dfweb-v3

๐Ÿก DFWeb personal portfolio version 3 with Next.js, Sanity.io, Framer Motion, Storybook, Tailwind CSS, Cypress, Playwright and more. 98% test coverage.
TypeScript
20
star
7

todo-hooks

React TODO app with Hooks and Ant Design for UI
JavaScript
11
star
8

sveltekit-chatGPT

Web interface for chatGPT with Sveltekit
Svelte
6
star
9

wordpress-resources

A curated list of interesting Wordpress resources
PHP
5
star
10

sanity-ecommerce

Sanity ecommerce
JavaScript
4
star
11

earthdoom

๐ŸŒŽ Full-stack strategy game inspired by Planetarion. Built with T3 stack, Typescript, Prisma, tRPC, mySQL, Tailwind, Next.js, Clerk and more.
TypeScript
4
star
12

astro-woocommerce

Ecommerce with Woocommerce backend and frontend with Astro framework and Vue 3
Vue
3
star
13

stein-saks-papir

โœ‚๏ธ Rock, paper and scissors game implemented in React.
JavaScript
3
star
14

PHP-MVC-Framework

A MVC PHP framework to work as a starting point for an application
PHP
2
star
15

React-themes-tailwind

React themes and components created with Tailwind CSS
JavaScript
2
star
16

firestore-ecommerce

Security rules example for Firestore
2
star
17

Statens-Vegvesen

Display vehicle information from https://www.vegvesen.no. Uses Vite, Typescript, HTML5 and Bootstrap 5..
TypeScript
2
star
18

fullstack-nextjs-typescript

Fullstack application with Strapi, Nextjs, Typescript and Bootstrap
TypeScript
1
star
19

nav-jobs

Showing jobs from https://arbeidsplassen.nav.no
TypeScript
1
star
20

w3bdesign

Secret README for my profile
1
star
21

Codewars-PHP

PHP solutions for Codewars challenges
PHP
1
star
22

express

SaaS App with Node.js, Express, MongoDB and PassportJS for authentication
CSS
1
star
23

vanilla-js-methods

Vanilla JS implementation of Javascript methods
1
star
24

carasent-react-typescript

Kodeรธvelse med React og Typescript
TypeScript
1
star