A production-grade, highly-optimized headless e-commerce storefront built with Next.js and integrated with WooCommerce. The storefront is designed to serve a large catalog of over 25,000 products with near-instant load times, featuring secure checkout integrations and real-time inventory updates.
Live Storefront: www.discountproducts.co.uk
This storefront operates as a decoupled frontend client interacting with a WordPress/WooCommerce backend through APIs:
- Headless Catalog: Fetches product listings, categories, attributes, and inventory dynamically via the WooCommerce REST API.
- High-Performance Rendering: Utilizes Incremental Static Regeneration (ISR) and cache-tag invalidation. Pages are rendered statically for speed and SEO, with cache updates triggered instantly when product data changes.
- Secure Transactions: Features server-side Stripe and PayPal payment gateway integrations, processing orders and customer information securely.
- Order Synchronisation: Receives real-time payment notifications via webhooks, completing checkouts and updating store inventory automatically.
| Layer | Technology |
|---|---|
| Framework | Next.js (App Router) |
| Styling | TailwindCSS, CSS Variables |
| Payment Gateways | Stripe API, PayPal Checkout SDK |
| Backend CMS | Headless WordPress / WooCommerce REST API |
| Deployment | Vercel (Frontend), Apache/Linux (Backend) |
- Dynamic Navigation: Categorized catalog browsing with automatic filtering options derived from WooCommerce attributes.
- Dynamic Search: High-speed keyword search with debounced inputs and pagination.
- Unified Shopping Cart: Secure, persistent client-side shopping cart with real-time stock availability verification.
- Stripe & PayPal Checkout: Direct gateway checkout processing with client/server validation.
- Technical SEO: Optimized page load times, structural HTML5 elements, automated XML sitemap generation, and dynamic metadata/JSON-LD structured data.
- Node.js 18+
- A running WordPress site with WooCommerce activated
Create a .env.local file in the project root:
# Store API Configuration
WORDPRESS_URL=https://your-wordpress-backend.com
WOOCOMMERCE_CONSUMER_KEY=ck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
WOOCOMMERCE_CONSUMER_SECRET=cs_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# Payment Gateways
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_live_...
STRIPE_SECRET_KEY=sk_live_...
STRIPE_WEBHOOK_SECRET=whsec_...
NEXT_PUBLIC_PAYPAL_CLIENT_ID=...
PAYPAL_CLIENT_SECRET=...
# Store URLs
NEXT_PUBLIC_SITE_URL=https://www.discountproducts.co.uknpm installnpm run devnpm run build
npm run startThis project is private and all rights are reserved. Not licensed for public redistribution or commercial use.