Lean control center at mini.ladill.com: payment QR CRUD, Paystack checkout with 5% fee settlement via Billing API, payments feed, and payouts. QR codes use a fixed black-and-white preset only. Co-authored-by: Cursor <cursoragent@cursor.com>
83 lines
2.5 KiB
Markdown
83 lines
2.5 KiB
Markdown
# 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 |
|
|
| `PAYSTACK_PUBLIC_KEY` / `PAYSTACK_SECRET_KEY` | platform Paystack keys (interim until Ladill Pay) |
|
|
|
|
## 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)
|