Skip to Content
DeploymentOverview

Deployment

Media Gateway (Express)

The Express server runs on the production machine behind a Cloudflare Tunnel.

# On the server cd media-gateway git pull npm install cd jimeng-sign-service && npm install && cd .. npm run build npm start

npm start launches three processes concurrently:

  1. express — API server on port 3000
  2. jimeng-sign — Sidecar on port 3457
  3. social-worker — Python worker

CF Workers

Deploy individual workers:

export CLOUDFLARE_ACCOUNT_ID=cc323c2ae7f85d59c43320bfc6493e41 cd workers/<name> npx wrangler deploy

Jimeng Login

After a fresh deploy, the sidecar needs a login session:

# Via API curl -X POST https://frai.paradream.info/api/v1/creative/auth/jimeng/qr \ -H "CF-Access-Client-Id: <id>" \ -H "CF-Access-Client-Secret: <secret>" # Returns QR base64 → scan with Douyin # Then poll: GET /auth/jimeng/qr/poll

Session cookies are saved to jimeng-sign-service/cookies.json and valid for 365 days.