Files
ladill-mini/DEPLOY.md
T
isaaccladandCursor 8f9fc426c3
Deploy Ladill Mini / deploy (push) Failing after 1m15s
Read Paystack keys from platform admin settings.
Add a platform DB connection and PlatformSetting model so Mini uses the same admin-panel Paystack credentials as the monolith and other extracted apps.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 19:06:23 +00:00

88 lines
2.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Ladill Mini — deploy & cutover runbook
Standalone app for **trader payment QRs** at `mini.ladill.com` — static scan-to-pay
codes with amount entry, no catalog. Takings settle into the one platform
UserWallet (5% fee), then withdraw via `account.ladill.com`.
Public scans stay at `ladill.com/q/<code>` (blueprint decision — printed codes
never migrate). During cutover, nginx can proxy payment-type codes to this app.
---
## 0. Prerequisites
| Secret | Where |
|---|---|
| `LADILL_SSO_CLIENT_ID` / `LADILL_SSO_CLIENT_SECRET` | `passport:client` on platform |
| `BILLING_API_KEY_MINI` | platform `.env` + this app |
| `IDENTITY_API_KEY_MINI` | platform `.env` + this app |
| `PLATFORM_DB_*` | read `ladilldb.platform_settings` (Paystack keys from admin → Billing) |
Paystack credentials are **not** duplicated in this apps `.env`. They are
configured in the platform admin panel (`/admin/settings` → Billing) and read
at runtime from `platform_settings` via the `platform` DB connection.
Grant the app DB user `SELECT` on `ladilldb.platform_settings` only.
## 1. Gitea repo + CI
1. Repo: **ladill-mini** (create on Gitea)
2. Push to `main` triggers `.gitea/workflows/deploy.yml`.
3. App root: `/var/www/ladill-mini`
## 2. Server app-slot + database
```bash
sudo install -d -o deploy -g www-data /var/www/ladill-mini
sudo mysql -e "CREATE DATABASE ladill_mini CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
sudo mysql -e "CREATE USER 'ladill_mini'@'127.0.0.1' IDENTIFIED BY '<pw>';"
sudo mysql -e "GRANT ALL ON ladill_mini.* TO 'ladill_mini'@'127.0.0.1'; FLUSH PRIVILEGES;"
```
## 3. Register OIDC client (platform)
```bash
php artisan passport:client \
--name="Ladill Mini" \
--redirect_uri="https://mini.ladill.com/sso/callback"
```
## 4. Platform integration
```env
BILLING_API_KEY_MINI=<same>
IDENTITY_API_KEY_MINI=<same>
RP_MINI_FRONTCHANNEL_LOGOUT=https://mini.ladill.com/sso/logout-frontchannel
LADILL_MINI_APP_URL=https://mini.ladill.com
```
Add `mini` to `config/pdns.php` service subdomains (done in monolith).
## 5. nginx + TLS
```bash
sudo deployment/setup-service-subdomain-nginx.sh mini --app /var/www/ladill-mini/current
```
## 6. First deploy
```bash
cd /var/www/ladill-mini/current
php artisan migrate --force
php artisan config:cache route:cache view:cache
```
## 7. Verify
- SSO login at `mini.ladill.com`
- Create a payment QR, download PNG
- Scan `/q/<code>`, pay test amount, confirm wallet credit (net of 5%)
- Withdraw from `account.ladill.com/wallet`
## Product IA (blueprint)
- **Overview** — today's takings, payment count, wallet balance
- **My Payment QR** — print/display static QRs (one per till/branch)
- **Payments** — incoming payment feed
- **Payouts** — wallet-first settlement, withdraw to bank/MoMo
- **Settings** — business branding (no Developers by default)