# New App Checklist (Vite + Bun + PM2) ## 1) Local Repo Changes - Add `serve` script: - `"serve": "serve -s dist -l tcp://0.0.0.0:$PORT"` - Add dependency: - `serve` (run `bun add serve`) ## 2) CI Workflow - Use the template file in `ci-template.yaml`. - Replace placeholders: - `` - `` - `` ## 3) Server One-Time Setup - Create deploy directory: - `mkdir -p ` - First PM2 start: - `cd ` - `PORT= pm2 start "bun run serve" --name ` - `pm2 save` ## 4) Deploy + Restart (CI will do this) - Files copied to server: - `dist/`, `package.json`, `bun.lock` (or `bun.lockb`) - On server: - `bun install --production` - `PORT= pm2 restart --update-env` ## 5) Verification - PM2 process: - `pm2 show ` - Port: - `pm2 env | grep PORT` - Bind: - `pm2 logs --lines 20` - Expect: `Accepting connections at http://0.0.0.0:` - Files: - `ls -la ` - `ls -la /dist | head -20` - HTTP: - `curl -I http://:`