feat(web+infra): polished front page, app at /, tracker at /status
- apps/web: redesigned landing (Hero/Scanner/HowItWorks/Features/Footer), honest live-vs-coming-soon badges, same-origin /api/scan, ember theme. - ecosystem.config.cjs: runnable — pyre-api/worker via `node --import tsx`, pyre-web via `next start`, fork mode, env wired. pm2 web+api verified online (api /health 200, scan 200, web 200). - infra/nginx/feedthepyre.com.conf: app at / (proxy :3000), API at /api (proxy :4000, prefix preserved), dev tracker at /status (static). - scripts/deploy-web.sh: sudo cutover (install vhost, nginx -t, reload, certbot --nginx --keep-until-expiring). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,74 +1,82 @@
|
||||
// PYRE / Prometheus Protocol — PM2 ecosystem (process manager) config
|
||||
//
|
||||
// ⚠️ INERT / NOT YET RUNNABLE: the apps are NOT implemented yet. This file
|
||||
// defines how the three PYRE processes WILL run once apps/web, apps/api,
|
||||
// and apps/worker are built/deployed. Starting it now will fail because
|
||||
// the apps (and their builds) do not exist yet.
|
||||
// PYRE / Prometheus Protocol — PM2 ecosystem (process manager) config.
|
||||
//
|
||||
// Process names match docs/PYRE_MVP_DESIGN.md §12: pyre-web, pyre-api, pyre-worker.
|
||||
//
|
||||
// Once apps exist, start with:
|
||||
// pm2 start ecosystem.config.cjs
|
||||
// pm2 save # persist process list so `pm2 resurrect` works on boot
|
||||
// Start (from repo root): pm2 start ecosystem.config.cjs --only pyre-api,pyre-web
|
||||
// Persist for boot: pm2 save (systemd unit infra/systemd/pm2-pyre.service
|
||||
// runs `pm2 resurrect` on boot)
|
||||
//
|
||||
// PM2 is installed at user level: ~/.local/share/pnpm/bin/pm2
|
||||
// Logs go to /home/pyre/pyre/logs/ (rotated by infra/logrotate/pyre).
|
||||
// Each process is capped at 400M (8GB VPS shared with postgres/redis/nginx).
|
||||
//
|
||||
// Note on memory: the 8GB VPS is shared with postgres, redis, nginx, etc.,
|
||||
// so each process is capped at 400M via max_memory_restart.
|
||||
// NOTE: api/worker run their TypeScript directly via `node --import tsx` (no
|
||||
// separate build step; tsx resolves the workspace `@pyre/*` source packages).
|
||||
// The web app runs Next.js in production mode and requires a prior `next build`.
|
||||
|
||||
const REPO = __dirname;
|
||||
|
||||
module.exports = {
|
||||
apps: [
|
||||
{
|
||||
// Next.js frontend (production) — port 3000 per .env.example (WEB_PORT).
|
||||
// Requires `pnpm --filter @pyre/web build` first.
|
||||
name: "pyre-web",
|
||||
cwd: "apps/web",
|
||||
script: "pnpm",
|
||||
args: "start", // runs `next start` (requires a prior `pnpm build`)
|
||||
cwd: `${REPO}/apps/web`,
|
||||
script: "node_modules/next/dist/bin/next",
|
||||
args: "start",
|
||||
instances: 1,
|
||||
exec_mode: "fork",
|
||||
autorestart: true,
|
||||
max_memory_restart: "400M",
|
||||
max_memory_restart: "500M",
|
||||
env: {
|
||||
NODE_ENV: "production",
|
||||
PORT: 3000,
|
||||
HOSTNAME: "127.0.0.1",
|
||||
},
|
||||
out_file: "/home/pyre/pyre/logs/pyre-web-out.log",
|
||||
error_file: "/home/pyre/pyre/logs/pyre-web-err.log",
|
||||
out_file: `${REPO}/logs/pyre-web-out.log`,
|
||||
error_file: `${REPO}/logs/pyre-web-err.log`,
|
||||
},
|
||||
{
|
||||
// Fastify HTTP API — port 4000 per .env.example (API_PORT).
|
||||
// Runs the compiled server. Until a build exists you can temporarily
|
||||
// swap to a dev runner: script: "pnpm", args: "dev"
|
||||
// Runs TS directly via tsx (resolves workspace @pyre/* source).
|
||||
name: "pyre-api",
|
||||
cwd: "apps/api",
|
||||
script: "node",
|
||||
args: "dist/index.js",
|
||||
cwd: `${REPO}/apps/api`,
|
||||
script: "src/index.ts",
|
||||
interpreter: "node",
|
||||
interpreter_args: "--import tsx",
|
||||
instances: 1,
|
||||
exec_mode: "fork",
|
||||
autorestart: true,
|
||||
max_memory_restart: "400M",
|
||||
env: {
|
||||
NODE_ENV: "production",
|
||||
PORT: 4000,
|
||||
HOST: "127.0.0.1",
|
||||
WEB_PUBLIC_URL: "https://feedthepyre.com",
|
||||
// Public RPC by default — override with a Helius/Triton/QuickNode URL
|
||||
// (set SOLANA_RPC_URL in the environment) to avoid mainnet rate limits.
|
||||
SOLANA_RPC_URL: "https://api.mainnet-beta.solana.com",
|
||||
},
|
||||
out_file: "/home/pyre/pyre/logs/pyre-api-out.log",
|
||||
error_file: "/home/pyre/pyre/logs/pyre-api-err.log",
|
||||
out_file: `${REPO}/logs/pyre-api-out.log`,
|
||||
error_file: `${REPO}/logs/pyre-api-err.log`,
|
||||
},
|
||||
{
|
||||
// BullMQ background worker (no HTTP port).
|
||||
// Runs the compiled worker. Until a build exists you can temporarily
|
||||
// swap to a dev runner: script: "pnpm", args: "dev"
|
||||
// BullMQ background worker (no HTTP port). Not started by default in
|
||||
// Phase 1 (no jobs implemented yet). Runs TS via tsx when enabled.
|
||||
name: "pyre-worker",
|
||||
cwd: "apps/worker",
|
||||
script: "node",
|
||||
args: "dist/index.js",
|
||||
cwd: `${REPO}/apps/worker`,
|
||||
script: "src/index.ts",
|
||||
interpreter: "node",
|
||||
interpreter_args: "--import tsx",
|
||||
instances: 1,
|
||||
exec_mode: "fork",
|
||||
autorestart: true,
|
||||
max_memory_restart: "400M",
|
||||
env: {
|
||||
NODE_ENV: "production",
|
||||
},
|
||||
out_file: "/home/pyre/pyre/logs/pyre-worker-out.log",
|
||||
error_file: "/home/pyre/pyre/logs/pyre-worker-err.log",
|
||||
out_file: `${REPO}/logs/pyre-worker-out.log`,
|
||||
error_file: `${REPO}/logs/pyre-worker-err.log`,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user