Files
saleor-core-extensions/LOCAL_DEV.md
T
Unchained ed9561a460 feat: production-ready dashboard with proper auth persistence
- Add dashboard UI showing connection status, webhooks, and email config
- Fix FileAPL to use fileName param for persistent /data volume storage
- Configure production domains and webhooks
- Add dev tunnel script for local testing
- Update Dockerfile and build config for K3s deployment

The app is now successfully installed and running at:
https://core-extensions.manoonoils.com
2026-03-27 20:13:38 +02:00

3.3 KiB

Saleor Core Extensions - Rapid Development Setup

Quick Start for Local Development

Instead of the slow Docker → K8s → Saleor cycle, use this rapid development workflow:

1. Start Local Development Server with Tunnel

cd /home/unchained/saleor-core-extensions
npm run dev:tunnel

This will:

2. Install App in Saleor Dashboard

  1. Go to https://dashboard.manoonoils.com
  2. Navigate to Apps → Install external app
  3. Paste the tunnel manifest URL shown in the terminal (e.g., https://abc123.loca.lt/api/manifest)
  4. Click Install

3. Test Changes Instantly

  • Make code changes in /src/pages/api/
  • Changes auto-reload immediately
  • Saleor sees updates via the tunnel instantly
  • No Docker rebuild needed!

4. When Ready for Production

Once everything works locally:

# Build and push production image
docker build -t ghcr.io/unchainedio/saleor-core-extensions:n8n-webhooks .
docker push ghcr.io/unchainedio/saleor-core-extensions:n8n-webhooks

# Deploy to K8s (Flux will pick it up automatically)

How Tunnels Work

┌─────────────────┐         ┌──────────────────┐         ┌─────────────────┐
│  Your Local App │  ←────  │  Tunnel Service  │  ←────  │  Saleor Cloud   │
│  localhost:3000 │         │  (localtunnel)   │         │  Webhooks       │
└─────────────────┘         └──────────────────┘         └─────────────────┘
         │                            │                            │
         │    Auto-reload on save     │    Public HTTPS URL        │    Triggers webhooks
         └────────────────────────────┴────────────────────────────┘

Environment Variables for Local Dev

Create .env.local:

# Use tunnel URL for Saleor API
APP_IFRAME_BASE_URL=https://YOUR_TUNNEL_URL.loca.lt
APP_API_BASE_URL=https://YOUR_TUNNEL_URL.loca.lt

# Point to your Saleor instance
SALEOR_API_URL=https://api.manoonoils.com/graphql/

# Email settings (optional for testing)
RESEND_API_KEY=test
FROM_EMAIL=support@mail.manoonoils.com

Troubleshooting

Tunnel disconnects

  • Just restart npm run dev:tunnel
  • Update the manifest URL in Saleor with the new tunnel URL

"Invalid manifest" error

  • Check the tunnel URL is accessible: curl https://YOUR_TUNNEL.loca.lt/api/manifest
  • Ensure allowedSaleorApiUrls includes your Saleor URL

Changes not reflecting

  • The dev server has hot reload
  • If stuck, press Ctrl+C and restart npm run dev:tunnel

Why This Is Better

Method Feedback Loop Setup Time
Docker → K8s → Saleor 5-10 minutes per change Complex
Local + Tunnel Instant (seconds) Simple

Current Status

The Docker image is already deployed and working. This tunnel setup is for rapid development and testing before committing changes.