Files
ladill-link/DEPLOY.md
T
isaaccladandCursor 344bf76391
Deploy Ladill Link / deploy (push) Successful in 39s
Add GeoIP country fallback for link click analytics.
Resolve countries from CDN headers first, then MaxMind GeoLite2 via visitor IP, with an artisan command to download and refresh the database.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 23:36:01 +00:00

76 lines
2.1 KiB
Markdown

# Ladill Link — deployment
Ladill Link is the platform URL shortener. Public short URLs live on **ladl.link**; the management app runs at **link.ladill.com**.
## Domains
| Host | Purpose |
|------|---------|
| `ladl.link` | Public short-link resolution (`/{slug}`) |
| `link.ladill.com` | SSO management UI (create/edit links) |
Both vhosts point at the same Laravel app. Set `LINK_PUBLIC_DOMAIN=ladl.link` in `.env`.
## Pricing
GHS **0.05** per link created (`LINK_PRICE_PER_LINK_GHS`). Debited from the central UserWallet via the Billing API.
## Platform onboarding
From the monolith:
```bash
php artisan ladill:onboard-app link --run-dns
php artisan ladill:launcher:sync --propagate --push
```
Register the Passport OIDC client:
```bash
php artisan passport:client \
--name="Ladill Link" \
--redirect_uri="https://link.ladill.com/sso/callback"
```
Set `BILLING_API_KEY_LINK` and `IDENTITY_API_KEY_LINK` on both monolith and this app.
Grant read access to platform AI settings:
```bash
sudo mysql -e "GRANT SELECT ON ladilldb.platform_settings TO 'ladill_link'@'127.0.0.1'; FLUSH PRIVILEGES;"
```
Afia reads `ai_*` keys from `platform_settings` (same as ladill.com admin). Optional `AFIA_API_KEY` in `.env` overrides for local dev.
## Legacy URLs
`https://ladill.com/q/{code}` continues to work for existing QR and storefront codes. New links use `https://ladl.link/{code}`. Unknown slugs on ladl.link fall back to the legacy resolver.
## Database
```bash
php artisan migrate --force
```
Database name: `ladill_link`.
## Country analytics (GeoIP)
Click countries are resolved from CDN headers when present (`CF-IPCountry`, etc.), then from the visitor IP using a local MaxMind GeoLite2 Country database.
1. Create a free MaxMind account and generate a license key.
2. Set in `.env`:
```env
MAXMIND_ACCOUNT_ID=
MAXMIND_LICENSE_KEY=
```
3. Download the database:
```bash
php artisan link:geoip-update
```
The file is stored at `storage/app/geoip/GeoLite2-Country.mmdb` by default. The command is scheduled weekly via the app scheduler — ensure cron runs `php artisan schedule:run` for link.ladill.com.