4.3 KiB
4.3 KiB
Dewemoji Live Deployment Walkthrough
This is the production rollout checklist for the dewemoji app.
Use this in order:
- Prepare env
- Deploy code
- Run post-deploy commands
- Ensure admin access
- Verify billing/webhooks/search/auth
1) Pre-Deploy (Env + Infra)
Set these in live environment first:
APP_ENV=production
APP_DEBUG=false
APP_URL=https://your-live-domain.com
Core requirements:
- Database points to live DB (
DB_*). APP_KEYis set and stable.SESSION_DRIVER,CACHE_STORE,QUEUE_CONNECTIONconfigured.- Billing provider secrets are set (PayPal/Pakasir).
- Allowed origins include live domain.
Recommended billing cooldown config:
DEWEMOJI_BILLING_PENDING_COOLDOWN_SECONDS=120
Webhook URLs:
- PayPal webhook:
https://your-live-domain.com/v1/paypal/webhook - Pakasir webhook:
https://your-live-domain.com/webhooks/pakasir
2) Deploy Code
From your server app directory (example /var/www/html):
git fetch --all
git checkout main
git pull origin main
Install dependencies if needed:
composer install --no-dev --optimize-autoloader
3) Post-Deploy Commands (Required)
Run in this exact sequence:
php artisan optimize:clear
php artisan migrate --force
php artisan config:cache
Optional but recommended:
php artisan route:cache
php artisan view:cache
If you use queue workers:
php artisan queue:restart
Check migration status:
php artisan migrate:status
4) Ensure Admin User
Admin access is role-based (users.role = admin).
Option A: Promote existing user (recommended)
php artisan tinker --execute="\App\Models\User::where('email','dewemoji@gmail.com')->update(['role'=>'admin']);"
Option B: Create admin user if missing
php artisan tinker --execute="
\$u=\App\Models\User::firstOrCreate(
['email'=>'dewemoji@gmail.com'],
['name'=>'Dewemoji Admin','password'=>\Illuminate\Support\Facades\Hash::make('ChangeMeNow123!'),'tier'=>'free','email_verified_at'=>now()]
);
\$u->role='admin';
\$u->save();
"
Verify:
php artisan tinker --execute="dump(\App\Models\User::where('email','dewemoji@gmail.com')->first(['id','email','role','tier']));"
5) Smoke Test Checklist (Live)
A. Core App
- Login/register works over HTTPS with no insecure form warnings.
- Dashboard loads.
- Discover search returns emojis.
- Emoji detail page loads.
B. Skin Tone
- Discover: change skin tone selector and verify toneable emoji changes.
- Detail: tone chips update hero emoji and copy behavior.
- Refresh page: tone preference persists.
C. Account + Keywords
- Free account can create up to active limit.
- Active/inactive keyword behavior reflected in search.
- Private keyword search appears in Discover after creation.
D. Billing
- PayPal checkout starts and returns.
- Pakasir QRIS starts and modal polls.
- Pending payment can be resumed.
- Cooldown prevents immediate repeated checkout spam.
E. Webhooks
- PayPal event recorded and payment status updates.
- Pakasir event recorded and payment status updates.
Useful checks:
tail -n 200 storage/logs/laravel.log
php artisan tinker --execute="dump(\App\Models\WebhookEvent::latest()->take(10)->get(['id','provider','event_type','status','created_at'])->toArray());"
php artisan tinker --execute="dump(\App\Models\Payment::latest()->take(10)->get(['id','provider','plan_code','status','created_at'])->toArray());"
6) Optional: PayPal Plan Sync (Admin)
From admin dashboard:
- Open pricing admin page.
- Click sync PayPal plans.
- Confirm plan IDs are written and no 500.
If there is failure, check:
tail -n 300 storage/logs/laravel.log | grep -Ei "paypal|sync|webhook|error|exception"
7) Extension Release Order
Release order:
- Site/backend live first.
- Verify API/auth on live domain.
- Update extension default API base to live.
- Publish extension update.
This avoids extension users hitting endpoints that are not ready.
8) Rollback Strategy
If release is broken:
- Re-deploy previous known-good git commit.
- Run:
php artisan optimize:clear
php artisan config:cache
php artisan queue:restart
- If issue is emoji dataset, use snapshot activation in admin catalog.