Headless Admin Panel
Decoupled Developer Console
Monitor API payloads, toggle between the Local mock data and the Live WordPress REST API, and review future checkout architecture plans.
Data Source Selection
Toggle between **Local Mock DB** (scraped content from live Astra site) and the **Live WordPress REST API**. When Live mode is active, the React frontend issues requests to:https://pcbrepair.ezyspare.in/wp-json/wp/v2/pages
Warning: Live WP endpoints must support CORS headers. If they do not, requests will fail.
Real-time Fetch logs
// Waiting for data requests...
Headless WordPress Configurations
Once we decide to connect the live WordPress dashboard, configure the following in WordPress:
- ✔CORS Setup: Install the plugin WP REST API CORS to allow the React app to pull data without CORS blocks.
- ✔Custom Fields: Install Advanced Custom Fields (ACF) to define fields for Hero title, phone numbers, and counter widgets.
- ✔Permalinks: Ensure custom Permalinks are set to 'Post name' in WordPress Settings so that REST endpoints are clean.
Future HDFC Payment Gateway planning
For integrating the HDFC Bank Payment Gateway in the future, we have planned a decoupled service block:
- ➔Shopping Cart: An in-memory cart hook (`useCart`) to manage products selected for purchase.
- ➔Secure Node Gateway: HDFC PG requires HMAC hashing and checksum verification. This will run securely on a Vercel Serverless Function backend.
- ➔Receipt webhook callback: Secure HDFC callback listener to mark orders as paid and trigger SMS/Email notifications.