Files
ladill-woo-manager/DEPLOY.md
T
isaaccladandCursor ffe0b9d877
Deploy Ladill Woo Manager / deploy (push) Failing after 2s
Scaffold Ladill Woo Manager for WooCommerce order fulfillment.
Standalone app with SSO shell, WordPress plugin connect flow, webhook ingest,
fulfillment inbox, and plugin activation API — no payment processing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 22:39:38 +00:00

75 lines
2.6 KiB
Markdown

# Ladill Woo Manager — deploy runbook
Standalone app for **WooCommerce order fulfillment** at `woo.ladill.com`.
Merchants connect stores via the Ladill WordPress plugin (Sign in with Ladill).
Payments stay in WooCommerce — this app only syncs orders and fulfillment status.
---
## 0. Prerequisites
| Secret | Where |
|---|---|
| `LADILL_SSO_CLIENT_ID` / `LADILL_SSO_CLIENT_SECRET` | `passport:client` on platform |
| `BILLING_API_KEY_WOO_MANAGER` | platform `.env` + this app |
| `IDENTITY_API_KEY_WOO_MANAGER` | platform `.env` + this app |
| `WOO_MANAGER_PLUGIN_CLIENT_ID` / `WOO_MANAGER_PLUGIN_CLIENT_SECRET` | OAuth client for WP plugin (future) |
## 1. Gitea repo + CI
1. Repo: **ladill-woo-manager**
2. Push to `main` triggers `.gitea/workflows/deploy.yml`.
3. App root: `/var/www/ladill-woo-manager`
## 2. Server app-slot + database
```bash
sudo install -d -o deploy -g www-data /var/www/ladill-woo-manager
sudo install -d -o deploy -g www-data /var/www/ladill-woo-manager/{releases,shared}
sudo mysql -e "CREATE DATABASE ladill_woo_manager CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
sudo mysql -e "CREATE USER 'ladill_woo_manager'@'127.0.0.1' IDENTIFIED BY '<pw>';"
sudo mysql -e "GRANT ALL ON ladill_woo_manager.* TO 'ladill_woo_manager'@'127.0.0.1'; FLUSH PRIVILEGES;"
```
## 3. Register OIDC client (platform)
```bash
php artisan passport:client \
--name="Ladill Woo Manager" \
--redirect_uri="https://woo.ladill.com/sso/callback"
```
## 4. Platform integration
```env
BILLING_API_KEY_WOO_MANAGER=<same>
IDENTITY_API_KEY_WOO_MANAGER=<same>
RP_WOO_MANAGER_FRONTCHANNEL_LOGOUT=https://woo.ladill.com/sso/logout-frontchannel
LADILL_WOO_MANAGER_APP_URL=https://woo.ladill.com
```
Add `woo` to `config/pdns.php` service subdomains via `php artisan ladill:onboard-app woo --run-dns`.
## 5. nginx + TLS
```bash
sudo deployment/setup-service-subdomain-nginx.sh woo --app /var/www/ladill-woo-manager/current
```
## 6. First deploy
```bash
cd /var/www/ladill-woo-manager/current
php artisan migrate --force
php artisan config:cache route:cache view:cache
```
## WordPress plugin flow
1. Merchant installs **Ladill Woo Manager** plugin on their WooCommerce store.
2. Plugin redirects to `https://woo.ladill.com/connect/wordpress?site_url=…&return_url=…`
3. Merchant signs in with Ladill; store is registered and an install token is returned.
4. Plugin calls `POST /api/v1/stores/activate` with the install token.
5. Plugin registers WooCommerce webhooks to `https://woo.ladill.com/webhooks/woocommerce/{store_id}`.
6. Orders appear in Woo Manager; fulfillment updates push back to the plugin REST API.