Skip to content

Commit bddf249

Browse files
committed
feat: added installation guide ro Readme file
1 parent 47e4b68 commit bddf249

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed

README.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,83 @@ If your product stocks and prices are not changeable, and you are not continuous
3333
- Dark Mode
3434
- UI Lab
3535

36+
## Installation
37+
38+
To get started with NuxtCommerce, follow these steps:
39+
40+
1. **Clone the repository:**
41+
42+
```sh
43+
git clone https://github.com/your-username/nuxtcommerce.git
44+
cd nuxtcommerce
45+
```
46+
47+
2. **Install dependencies:**
48+
49+
Make sure you have [Node.js](https://nodejs.org/) installed. Then run:
50+
51+
```sh
52+
pnpm install
53+
```
54+
55+
3. **Set up environment variables:**
56+
57+
Create a [.env](http://_vscodecontentref_/0) file in the root directory and add the following variables:
58+
59+
```sh
60+
WP_GRAPHQL_URL=https://your-woocommerce-site.com/graphql
61+
```
62+
63+
4. **Run the development server:**
64+
65+
```sh
66+
pnpm run dev
67+
```
68+
69+
Your application should now be running on [http://localhost:3000](http://localhost:3000).
70+
71+
## WordPress Setup Guide
72+
73+
This guide will help you set up your WordPress site with WooCommerce and GraphQL for seamless integration. Follow the steps below carefully to ensure a successful configuration.
74+
75+
### Step 1: Install Required Plugins
76+
77+
To begin, make sure the following plugins are installed and activated on your WordPress site:
78+
79+
- [**WooCommerce**](https://woocommerce.com/): The essential plugin for creating an e-commerce store.
80+
- [**WPGraphQL**](https://www.wpgraphql.com/): Enables GraphQL support for WordPress.
81+
- [**WPGraphQL CORS**](https://github.com/funkhaus/wp-graphql-cors): Allows Cross-Origin Resource Sharing for WPGraphQL.
82+
- [**WPGraphQL WooCommerce (WooGraphQL)**](https://github.com/wp-graphql/wp-graphql-woocommerce): Adds WooCommerce-specific GraphQL functionalities.
83+
84+
> **Tip:** You can install these plugins directly from the WordPress Plugin Repository or upload them manually if you have the plugin files.
85+
86+
### Step 2: Upload Product Data
87+
88+
To populate your WooCommerce store with product data, follow these steps:
89+
90+
1. Download the product data files from [this link](https://github.com/zackha/nuxtcommerce/blob/master/public/products.zip). The zip file contains both variable and variation product CSV files.
91+
2. Navigate to the WooCommerce admin panel.
92+
3. Go to **Products > Import**, then upload the CSV files from the downloaded zip.
93+
4. Follow the on-screen instructions to map the CSV columns to WooCommerce fields and complete the import.
94+
95+
> **Note:** Ensure your CSV files are properly formatted to avoid errors during the import process.
96+
97+
### Step 3: Configure WPGraphQL
98+
99+
1. Navigate to **WPGraphQL > Settings** in the WordPress admin dashboard.
100+
2. Locate the **GraphQL Endpoint URL** and copy it. The default endpoint is typically `/graphql`.
101+
3. Open your project’s `.env` file and add the following line:
102+
103+
```env
104+
GQL_HOST=<your_graphql_endpoint_url>
105+
```
106+
107+
Replace `<your_graphql_endpoint_url>` with the copied URL from WPGraphQL settings.
108+
109+
> **Important:** Make sure your server allows CORS (Cross-Origin Resource Sharing) to enable communication between your WordPress backend and frontend application.
110+
111+
By following these steps, your WordPress site will be ready to integrate WooCommerce with GraphQL. For additional troubleshooting or advanced customization, refer to the official documentation of each plugin.
112+
36113
## Contributing
37114

38115
Contributions of any kind are welcome! You can open an issue for requests, bug reports, or general feedback, or you can directly create a pull request(PR).

public/products.zip

8.13 KB
Binary file not shown.

0 commit comments

Comments
 (0)