A price monitoring system for Okala grocery stores that tracks price changes and sends notifications via Bale Messenger bot.
- Real-time price monitoring for multiple Okala stores
- Automatic price comparison (before/after)
- Bale Messenger bot notifications for:
- Price changes
- Stock availability changes
- Discount changes
- Admin panel for configuration and monitoring
- Smart caching system (updates every 10 minutes)
- Message queue for rate limiting
- PHP 8.0+
- MySQL 8.0+
- cURL extension
- Bale Bot account (Iranian messenger platform)
-
Clone the repository:
git clone https://github.com/yourusername/okala-price-radar.git cd okala-price-radar -
Copy
.env.exampleto.envand configure:cp .env.example .env
-
Edit
.envwith your credentials:BALE_BOT_TOKEN: Your Bale bot tokenBALE_CHANNEL_ID: Your channel IDBALE_ADMIN_ID: Your admin user IDDB_*: Database credentials
-
Run the installer:
php scripts/install.php
-
Setup the cron job or run master script:
# Option 1: Run master script (recommended) php src/master_cron.php # Option 2: Setup cron jobs # Add to crontab: */10 * * * * php /path/to/src/cron.php * * * * * php /path/to/src/send_messages.php
okala-price-radar/
├── src/ # Main source files
│ ├── config.php # Configuration (reads from .env)
│ ├── cron.php # Price crawling engine
│ ├── master_cron.php # Cron orchestrator
│ ├── api.php # Admin panel backend
│ ├── index.php # Admin panel frontend
│ ├── webhook.php # Bale bot webhook
│ ├── send_messages.php # Message sender
│ └── send_messages_loop.php
├── scripts/ # Utility scripts
│ ├── install.php # Database installer
│ └── cleanup_cache.php # Cache cleanup
├── database/
│ └── schema.sql # Database schema
├── cache/ # Runtime cache (gitignored)
├── docs/
│ └── setup.md # Detailed setup guide
├── .env.example # Environment template
├── .gitignore # Git ignore rules
└── README.md # This file
| Variable | Description |
|---|---|
BALE_BOT_TOKEN |
Bale bot API token |
BALE_CHANNEL_ID |
Channel ID for notifications |
BALE_ADMIN_ID |
Admin user ID |
DB_HOST |
MySQL host (default: localhost) |
DB_NAME |
Database name |
DB_USER |
Database username |
DB_PASS |
Database password |
- Login to admin panel via Bale bot
- Add store with Okala API URL format:
https://apigateway.okala.com/api/Search/v1/Product/Search?StoreIds=STORE_ID
Access the admin panel through Bale bot:
- Send
/startto your bot - Click "Open Admin Panel"
- Configure stores and notification settings
php src/cron.php?manual=1tail -f debug.logMIT License