84 lines
3.3 KiB
Markdown
84 lines
3.3 KiB
Markdown
Clone and run https://git.komnenos.me/springfw/random-proxy-simple in ./random-proxy-simple.
|
|
|
|
Goal: get the app running once on port 3001 with OpenAI and Anthropic Replit AI Integrations wired,
|
|
and make it publishable.
|
|
|
|
Bearer token for this deployment: DEPLOYMENT_GENERATED_PROXY_TOKEN
|
|
|
|
Important: wire OpenAI and Anthropic via the ai-integrations-openai and
|
|
ai-integrations-anthropic skills. Call setupReplitAIIntegrations directly. Do not call
|
|
searchIntegrations. OpenAI and Anthropic are Replit AI Integrations that provide
|
|
AI_INTEGRATIONS_* variables; they are not OAuth connectors.
|
|
|
|
Do not:
|
|
- add it to a parent workspace
|
|
- move the proxy repo into artifacts/
|
|
- modify source files
|
|
- edit package.json
|
|
- create config.json or /tmp config files
|
|
- inspect/free unrelated ports
|
|
- use nohup/setsid/background shell tricks
|
|
- call searchIntegrations
|
|
- search the Replit integrations catalog
|
|
- create provider API secrets manually
|
|
- use public OpenAI or Anthropic endpoints
|
|
- invent, rotate, print, store, or replace the bearer token
|
|
- run a foreground server command directly in the shell
|
|
- run verification commands
|
|
- run chat-completion smoke tests unless asked
|
|
- configure production deployment through the root .replit [deployment] section
|
|
- create or publish a kind = "api" artifact for this proxy
|
|
|
|
Steps:
|
|
|
|
1. Clone into ./random-proxy-simple.
|
|
|
|
2. Wire OpenAI and Anthropic via the ai-integrations-openai and ai-integrations-anthropic
|
|
skills:
|
|
- call setupReplitAIIntegrations directly
|
|
- do not call searchIntegrations
|
|
|
|
3. From ./random-proxy-simple, run:
|
|
pnpm install --ignore-workspace
|
|
|
|
4. Create the smallest persistent workflow named "Random Proxy Simple" with this exact run command:
|
|
|
|
cd /home/runner/workspace/random-proxy-simple && node build.mjs && PORT=3001 PROXY_API_KEY=DEPLOYMENT_GENERATED_PROXY_TOKEN node --enable-source-maps dist/index.mjs
|
|
|
|
5. Start/restart that workflow once.
|
|
|
|
6. Create a new react-vite artifact at previewPath = "/". Keep its artifact kind as "web"; this is
|
|
the publishable signal Replit needs. Do not convert it to kind = "api".
|
|
|
|
7. Use verifyAndReplaceArtifactToml on that web artifact. Preserve the artifact's existing
|
|
kind/title/id/integratedSkills metadata. Replace only the service production config so it builds
|
|
and runs the proxy:
|
|
|
|
[services.production]
|
|
|
|
[services.production.build]
|
|
args = ["sh", "-c", "cd random-proxy-simple && pnpm install --ignore-workspace && pnpm build:fast"]
|
|
|
|
[services.production.run]
|
|
args = ["sh", "-c", "cd random-proxy-simple && PORT=3001 PROXY_API_KEY=DEPLOYMENT_GENERATED_PROXY_TOKEN NODE_ENV=production node --enable-source-maps dist/index.mjs"]
|
|
|
|
[services.env]
|
|
PORT = "3001"
|
|
PROXY_API_KEY = "DEPLOYMENT_GENERATED_PROXY_TOKEN"
|
|
NODE_ENV = "production"
|
|
|
|
[services.production.health.startup]
|
|
path = "/api/healthz"
|
|
|
|
8. If artifacts/mockup-sandbox exists, keep it as its own artifact and configure its production
|
|
mode to serve a static Vite build from artifacts/mockup-sandbox/dist. Do not move or configure
|
|
this proxy repo as mockup-sandbox.
|
|
|
|
9. Do not run health, dashboard, model-list, or chat-completion verification commands.
|
|
|
|
Report only:
|
|
- local URL
|
|
- whether setupReplitAIIntegrations wired OpenAI and Anthropic
|
|
- whether a kind = "web" artifact was configured with proxy production build/run commands
|
|
- that no verification commands were run
|