Deployment Guide
KaiVox runs on three environments: local development (Laragon on Windows), staging (kaivox-test.omajestic.com), and production (kaivoxai.com). GitHub Actions automates staging and production deploys.
Local Development Setup
Requirements
| Requirement | Version | Notes |
|---|---|---|
| PHP | 8.2 | Use D:\xampp\php82\php.exe — NOT the system PHP (which may be 7.4) |
| MySQL | 8.x | Database: kaivox_ai, user: root, pass: root |
| Composer | 2.x | For PHP dependencies |
| Node.js | 18+ | For Vite asset compilation |
| Laragon | Any | Provides local domain http://kaivox-ai.test/ |
Always use
D:\xampp\php82\php.exe artisan for artisan commands. If your system PATH has an older PHP, plain php artisan will fail with PHP version errors.First-Time Local Setup
-
Clone the repo and install dependencies
composer install npm install -
Copy and configure .env
copy .env.example .env # Then edit .env — set DB credentials, OPENAI_API_KEY, etc. -
Generate app key
D:\xampp\php82\php.exe artisan key:generate -
Run migrations and seeders
D:\xampp\php82\php.exe artisan migrate D:\xampp\php82\php.exe artisan db:seed -
Link storage and build assets
D:\xampp\php82\php.exe artisan storage:link npm run build -
Run the queue worker (for emails/jobs)
D:\xampp\php82\php.exe artisan queue:work
Staging Deploy (kaivox-test.omajestic.com)
Pushing to the test branch triggers GitHub Actions which deploys to the Hostinger staging server.
GitHub Actions workflow files are already built at
.github/workflows/deploy-staging.yml and deploy-production.yml. Only the Hostinger SSH configuration and GitHub Secrets need to be added once.One-Time Staging Setup
-
Create GitHub repository Create a private repo at GitHub. Push local code:
git remote add origin https://github.com/your-user/kaivox-ai.git git push -u origin main git checkout -b test git push origin test -
Add GitHub Secrets In GitHub repo → Settings → Secrets → Actions, add:
Secret Name Value STAGING_SSH_KEYPrivate SSH key for Hostinger STAGING_HOSTkaivox-test.omajestic.comor server IPSTAGING_USERHostinger SSH username STAGING_PATH/home/u123456789/public_html -
Set up staging server (SSH in once)
ssh user@kaivox-test.omajestic.com # Verify PHP 8.2 is set in Hostinger control panel php -v # Create MySQL database in Hostinger control panel # Note the DB name, user, password # Upload .env with staging values (real DB creds, test payment keys, etc.) # Then run first deploy manually: composer install --no-dev --optimize-autoloader php artisan key:generate php artisan migrate --force php artisan config:cache php artisan storage:link -
Set up Laravel scheduler on Hostinger In Hostinger cron jobs, add:
* * * * * php /path/to/public_html/artisan schedule:run >> /dev/null 2>&1
CI/CD Flow
You push to 'test' branch
↓
GitHub Actions: deploy-staging.yml runs
↓
SSH into Hostinger → git pull → composer install → php artisan migrate --force
↓
App live at kaivox-test.omajestic.com
You push to 'main' branch
↓
GitHub Actions: deploy-production.yml runs
↓
SSH into production server → git pull → composer install → php artisan migrate --force
↓
App live at kaivoxai.com
Production Deploy (kaivoxai.com)
Same pattern as staging. Add production secrets (PROD_SSH_KEY, PROD_HOST, PROD_USER, PROD_PATH) to GitHub Secrets. Pushing to main triggers the production workflow.
Never push directly to main in a hurry. Test on staging first. The staging and production databases are separate — a migration error on production could be hard to reverse.
Artisan Commands to Run on Every Deploy
# Required after every code deploy:
composer install --no-dev --optimize-autoloader
php artisan migrate --force
php artisan config:cache
php artisan route:cache
php artisan view:cache
# Required only when new storage files are expected:
php artisan storage:link
# Required only when seeding fresh data:
php artisan db:seed --class=SuperAdminSeeder
# Phone number billing (runs daily via scheduler — no manual trigger needed):
php artisan phone-numbers:bill
Environment-Specific .env Values
| Key | Local | Staging | Production |
|---|---|---|---|
APP_ENV | local | staging | production |
APP_DEBUG | true | false | false |
APP_URL | http://kaivox-ai.test | https://kaivox-test.omajestic.com | https://kaivoxai.com |
STRIPE_KEY | pk_test_... | pk_test_... | pk_live_... |
MAIL_MAILER | log | smtp | smtp |
QUEUE_CONNECTION | database | database | database |
Post-Deploy Verification Checklist
- Visit the app URL — homepage loads
- Log in as Super Admin at
/super-admin/login - Register a test tenant and complete onboarding
- Make a test voice call (Vobiz webhook pointing to deployed URL)
- Book a test appointment — verify it appears in the calendar
- Send a test SMS (check Twilio delivery)
- Top up wallet with a Stripe test card (
4242 4242 4242 4242) - Verify emails send (check Hostinger SMTP — no port blocking on server)
- Check
/p/{slug}public profile loads correctly