Giter VIP home page Giter VIP logo

nextjs-woocommerce-restapi's Introduction

๐ŸŽจ Next.js WooCommerce REST API

Project Status: Active. Stars Forks Contributors Follow

  • React WooCommerce Theme, using Decoupled Architecture in Next.js
  • Backend in WordPress
  • Front end in React.
  • Data is Fetched through REST API.

Features

  • Home Page
  • Single Product Page With Gallery Carousel.
  • Cart Page
  • Checkout Page with Stripe Payment Gateway Integration.
  • REST API endpoints.
  • Header and Footer in Next.js fetching from WordPress Menu items.
  • WordPress Widgets displayed on Next.js frontend.
  • Site title, tagline, copyright text, social links sourced from WordPress.
  • Yoast SEO support
  • Next.js Image component, that has image optimization at request time
  • Incremental Static (Re)generation and automatic creation of New Static product pages without having to re-build next.js the application.
  • Gutenberg styles support
  • Blog Page
  • Post Page
  • Post Preview ( Coming Soon )
  • Product Pagination ( Coming Soon )
  • Load More Products ( Coming Soon )
  • Authentication with JWT and Http Only Cookie implementation. ( Coming Soon )
  • Login feature for WP Post Preview in Next.js ( Coming Soon )

Setup

First clone/fork the repo and cd into it.

git clone https://github.com/imranhsayed/nextjs-woocommerce-restapi.git
cd nextjs-woocommerce-restapi
npm ci
npm run dev

Add Headless features for WordPress

  • Install and Activate following WordPress Plugins:

Configuration ๐Ÿ”ง

  1. (Required) Create a .env file taking reference from .env-example and update your WordPressSite URL and Frontend next.js URL.
  • NEXT_PUBLIC_WORDPRESS_URL=https://example.com
  • NEXT_PUBLIC_SITE_URL=http://localhost.com ( This will be your frontend Next.js URL)
  1. Add your WC_CONSUMER_KEY and WC_CONSUMER_SECRET to the .env by following WooCommerce > Settings > Advanced > REST API

  2. In your WordPress Dashboard, Go to Settings > General > Site Address (URL) ( Set this to Frontend URL e.g. http://localhost:3000 during development )

  3. Create the Header and Footer Menus In WordPress Dashboard and set them to HCMS Header menu and HCMS Footer Menu respectively.

Useful Links

Versioning ๐Ÿ“‘

I use Git for versioning.

Author ๐Ÿ‘ค

License ๐Ÿ“ƒ

This project is licensed under the MIT License - see the LICENSE.md file for details

nextjs-woocommerce-restapi's People

Contributors

imranhsayed avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.