[Unit] Description=POC product-ai-automation frontend (Next.js) — served at /product-ai-automation After=network.target [Service] Type=simple User=__USER__ WorkingDirectory=__ROOT__/product-ai-automation/frontend Environment=NODE_ENV=production Environment=PORT=3001 Environment=HOSTNAME=127.0.0.1 # basePath is baked at BUILD time (server-setup.sh builds with BASE_PATH set); these # are the runtime values the app + OAuth callback need. Environment=BASE_PATH=/product-ai-automation Environment=NEXT_PUBLIC_BASE_PATH=/product-ai-automation Environment=APP_URL=https://__HOST__/product-ai-automation Environment=BACKEND_INTERNAL_URL=http://127.0.0.1:8000 # Secrets (ADMIN_API_TOKEN, AUTH_SECRET, GOOGLE_CLIENT_ID/SECRET, ADMIN_ALLOWED_EMAILS) # come from frontend/.env.local, which server-setup.sh symlinks to # data/secrets/product-ai-frontend.env (kept in data/ so rsync can't wipe it). ExecStart=__ROOT__/product-ai-automation/frontend/node_modules/.bin/next start -p 3001 -H 127.0.0.1 Restart=on-failure RestartSec=3 [Install] WantedBy=multi-user.target