Documentation

Family Shopping Bot

A WhatsApp bot that turns your family group into a live, shared shopping list — with voice support, categories, and a web dashboard.

TypeScript Node.js WhatsApp Web Supabase Groq Whisper Express Hebrew RTL

How it works

The bot connects to WhatsApp using your personal number, listens for messages in one specific group, and syncs a shared list to a cloud database — accessible from both WhatsApp and the web.

💬
WhatsApp Group
Text or voice message
🤖
whatsapp-web.js
Listens via Puppeteer
🎤
Groq Whisper
Transcribes voice to text
🌐
Web Dashboard
http://localhost:3001
Express API
REST endpoints
🗄️
Supabase
PostgreSQL cloud DB

Steps to activate the bot

1
Clone the repository

Get the code on your machine.

Terminal
git clone https://github.com/shali-mor/shopping.git
cd shopping
npm install
2
Create a Supabase project

The bot uses Supabase (free tier) as its database. Go to supabase.com, create a project, then run the schema in the SQL Editor.

supabase/schema.sql — run this in Supabase SQL Editor
-- Creates the shopping_items table with RLS
CREATE TABLE shopping_items ( ... );

-- Also run migration files:
-- supabase/migration_add_done_at.sql
-- supabase/migration_add_history.sql
Free tier is enough
3
Get a Groq API key (free)

Groq provides free Whisper transcription for voice messages. Sign up at console.groq.com and create an API key.

Free · no credit card needed
4
Configure the .env file

Copy .env.example to .env and fill in your credentials.

.env
# From Supabase → Project Settings → API
SUPABASE_URL=https://xxxx.supabase.co
SUPABASE_ANON_KEY=eyJ...

# From Groq console
GROQ_API_KEY=gsk_...

# Optional display name
BOT_NAME=Family Shopping Bot

# Filled in step 6 below
ALLOWED_GROUP_ID=
WEB_PORT=3001
5
Start the bot — scan the QR code

Run the dev server. On first launch a QR code appears in the terminal. Scan it with WhatsApp (Linked Devices → Link a Device) to authenticate. The session is saved — you only scan once.

Terminal
npm run dev

# → QR code appears in terminal
# → Also saved as qr.png if hard to scan
Keep the terminal running — the bot needs to stay alive
6
Find your group ID (discovery mode)

With ALLOWED_GROUP_ID left empty, the bot runs in discovery mode: it prints the group ID and sender ID of every message to the terminal without responding. Send a message from your family group, then copy the Group ID shown.

Terminal output — discovery mode
🔍 DISCOVERY MODE
   Group ID : 120363423180798897@g.us
   Sender   : 972501234567@c.us
   Message  : שלום
7
Set the group ID and restart

Paste the Group ID into .env, save, and the bot restarts automatically (nodemon watches .env).

.env
ALLOWED_GROUP_ID=120363423180798897@g.us,24167915200514@lid
# Both @g.us and @lid formats for same group
The bot is now active ✓
8
Open the web dashboard

The Express server starts alongside the bot. Open your browser to see the live shopping list and history — synced with WhatsApp in real time.

Browser
http://localhost:3001

WhatsApp commands

All commands work in Hebrew or English, by text or voice message.

חלב / add milk

Add an item — just type it (1–3 words auto-add)

3 חלב / חלב *3

Add with quantity (prefix number or *N suffix)

רשימה / list

Show the full list grouped by category

קניתי 1 / done milk

Mark an item as purchased by number or name

קניתי 1,2,3 / done 1-4

Mark multiple items done at once

הסר 2 / remove bread

Remove an item from the list

סיימתי קניות

End of trip — clears done items, shows summary

נקה הכל / clear all

Wipe the entire list and start fresh

עזרה / help

Show all available commands

🎤 Voice message

Say any command or item name — transcribed automatically


Technology used

💬
whatsapp-web.js
WhatsApp client via Puppeteer
🗄️
Supabase
PostgreSQL cloud database
🎤
Groq Whisper
Free Hebrew voice transcription
Express
REST API + static file server
🔷
TypeScript
Type-safe Node.js backend
🧪
Jest
298 unit + integration tests