A WhatsApp bot that allows users to browse and purchase products from a Wix store.
Before you begin, ensure you have met the following requirements:
- You have a Wix account and a Wix store with some products.
- You have a WhatsApp account.
- You have installed Node.js (version 14 or higher).
To set up the WhatsApp Store Bot, follow these steps:
-
Clone this repository:
git clone https://github.com/YitziG/wa-store.git cd wa-store
-
Install the dependencies:
npm install
-
Create a
.env
file in the root directory with the following content:WIX_CLIENT_ID=your_wix_client_id
Replace
your_wix_client_id
with your actual Wix client ID. -
Run the bot:
npm start
-
Scan the QR code that appears in the terminal with your WhatsApp account.
This repository is configured to auto-deploy your changes to your EC2 instance with each push to the master
branch. To set up the required GitHub secrets for auto-deployment, follow these steps:
- Navigate to your GitHub repository and click the
Settings
tab. - In the left sidebar, click on
Secrets
. - Click the
New repository secret
button. - Add the following secrets:
- ENV_FILE: This should contain WIX_CLIENT_ID=your_wix_client_id, where your_wix_client_id is your actual Wix client ID.
- EC2_SSH_PRIVATE_KEY: Your EC2 SSH private key.
- EC2_HOST: Your EC2 instance host.
- EC2_USER: Your EC2 instance user.
- Save each secret by clicking the Add secret button.
These secrets will now be accessible in the deploy.yml
file as shown:
env:
ENV_FILE: ${{ secrets.ENV_FILE }}
PRIVATE_KEY: ${{ secrets.EC2_SSH_PRIVATE_KEY }}
HOST: ${{ secrets.EC2_HOST }}
USER: ${{ secrets.EC2_USER }}
Big thanks to Pedro López, whose whatsapp-web.js
was a lifesaver for this project. Pedro's work stands as a testament to the power of open source - it's been a great learning resource for me, and the backbone of my WhatsApp chatbot. Do check it out, it's worth it. Cheers, Pedro!