File: /var/www/exnova-telegram-bot-v2/README.md
# Exnova Telegram Bot v2
## Requirements:
* php 8.2
* node v22.12.0
* mysql 8.0.41
## Installation:
This is Laravel project, show nginx configuration should be similar for any php project.
Root directory: `/public`
```
chmod -R 777 public/storage/uploads
cp .env.example .env
composer install
npm install
php artisan key:generate
php artisan config:cache
php artisan twill:build
# for running queue worker
apt install supervisor
# modify path to project in exnova-tgbot2.conf if needed
cp exnova-tgbot2.conf /etc/supervisor/conf.d/
cp exnova-tgbot2-autotrading.conf /etc/supervisor/conf.d/
cp exnova-tgbot2-cron.conf /etc/supervisor/conf.d/
supervisorctl reread
supervisorctl update
supervisorctl start exnova-tgbot2
supervisorctl start exnova-tgbot2-autotrading
supervisorctl start exnova-tgbot2-cron
# connect first bot to pannel
curl -F "url=https://exnova-tgbot2.foach.site/wh/whsecret?bot_id=1" "https://api.telegram.org/bot7712124120:AAHoxAMlMQ23ixM0Ig5ro-UflgPZWNBMkac/setwebhook"
# "whsecret" - value set at WEBHOOK_CLIENT_SECRET in .env
# "7712124120:AAHoxAMlMQ23ixM0Ig5ro-UflgPZWNBMkac" token provided by https://t.me/botfather
# "1" - bot id in database
```
## On release deployment
```
composer install --no-interaction --prefer-dist --optimize-autoloader --no-dev
php artisan migrate --force
php artisan config:cache
php artisan route:cache
php artisan view:cache
php artisan twill:build
cp exnova-tgbot2.conf /etc/supervisor/conf.d/
cp exnova-tgbot2-autotrading.conf /etc/supervisor/conf.d/
cp exnova-tgbot2-cron.conf /etc/supervisor/conf.d/
supervisorctl reread
supervisorctl update
supervisorctl restart exnova-tgbot2
supervisorctl restart exnova-tgbot2-autotrading
supervisorctl restart exnova-tgbot2-cron
```
## Access
### Test server
Admin panel: https://exnova-tgbot2.foach.site/botadm
TestBot: https://t.me/testnewnovabot
```