A comprehensive client work management system with automated WhatsApp reminders.
- Client Management - Store client info, industry, and contact details
- Task Tracking - Assign recurring tasks (daily, weekly, monthly)
- WhatsApp Reminders - Automatic notifications at set times
- Completion Tracking - Mark tasks complete, view history
- Dashboard - Overview of pending, overdue, and due-today tasks
Run this SQL in your Supabase SQL Editor:
-- Run the complete setup script
\i SETUP_CLIENT_SECRETARY.sqlOr manually copy the SQL from SETUP_CLIENT_SECRETARY.sql and execute it.
Add these to your .env.local:
# WhatsApp Business API (required for reminders)
WHATSAPP_ACCESS_TOKEN=your_whatsapp_token
WHATSAPP_PHONE_NUMBER_ID=your_phone_number_id
WHATSAPP_API_VERSION=v18.0
NEXT_PUBLIC_BASE_URL=https://thebreed.co.zaFor automated reminders, set up a cron job to call:
GET https://thebreed.co.za/api/reminders/cron
Options:
Add to vercel.json:
{
"crons": [
{
"path": "/api/reminders/cron",
"schedule": "0 9 * * *"
}
]
}This runs daily at 9 AM. Adjust the schedule as needed.
Use cron-job.org or similar to ping the endpoint every hour.
Visit /api/reminders/cron in your browser to trigger manually.
- Apply for WhatsApp Business API at Meta Business Suite
- Create templates for reminders (see below)
- Add your phone number as the recipient
- Configure the environment variables
Go to: https://thebreed.co.za/admin/secretary
Create these templates in WhatsApp Manager:
📋 *SECRETARY REMINDER*
Hi! This is your work reminder.
*Client:* {{1}}
*Task:* {{2}}
*Frequency:* {{3}}
⏰ This task is due today. Please complete and update the system.
Reply DONE when complete.
Variables:
- {{1}} = Client name
- {{2}} = Task name
- {{3}} = Frequency (daily/weekly/monthly)
- Click "Add Client"
- Enter name, company, industry, phone
- Save
- Click "Add Task"
- Select client
- Choose a service or enter custom task name
- Set reminder frequency (daily/weekly/monthly)
- Set reminder time
- Enable WhatsApp reminders
- Save
Click the 📤 (send) icon next to any task to manually trigger a WhatsApp reminder.
Click the ✅ (check) icon to mark a task complete. The system will:
- Log the completion
- Calculate next due date based on frequency
- Update the task
clients- Client informationservices- Services you offerclient_tasks- Tasks assigned to clientstask_completion_log- History of completed taskswhatsapp_reminders- Log of sent reminderssecretary_settings- User preferences
tasks_due_today- Tasks due today with client infoclient_work_summary- Aggregated stats per client
- Check WhatsApp API credentials
- Verify template is approved
- Check
/admin/secretarydashboard for errors - Test manually via API:
POST /api/reminders/send
- Verify Supabase credentials
- Check that tables were created by running the SQL
- Check RLS policies are configured
- Check Vercel dashboard for cron execution logs
- Verify the endpoint returns 200
- Test the endpoint manually in browser
| Endpoint | Method | Description |
|---|---|---|
/api/clients |
GET, POST | List/create clients |
/api/clients/[id] |
GET, PUT, DELETE | Manage single client |
/api/client-tasks |
GET, POST | List/create tasks |
/api/client-tasks/[id] |
GET, PUT, PATCH, DELETE | Manage single task |
/api/services |
GET, POST | List services |
/api/reminders/send |
POST | Send WhatsApp reminder |
/api/reminders/cron |
GET, POST | Check due tasks & send reminders |
For issues:
- Check browser console for errors
- Check Vercel function logs
- Verify all environment variables are set
- Ensure WhatsApp templates are approved