fix: serve the website dist so Coolify answers GET /
All checks were successful
CI — Website / Website — typecheck, build (pull_request) Successful in 1m1s

Nixpacks built Vite but had no production start command, so Coolify returned Cannot GET /.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john kevin asprec
2026-08-17 22:27:25 +08:00
parent 5a79f1a2eb
commit efdae32ae1
16 changed files with 193 additions and 38 deletions

View File

@@ -4,7 +4,15 @@ This file contains small, repeatable checks derived from verified failures. Pref
## Active failure-derived checks
_No failure-derived checks yet._
### E-2026-08-17-01 — Website production server answers GET /
- **Prevents:** L-2026-08-17-01 (`Cannot GET /` on Coolify)
- **Type:** command
- **How to run:** `npm run website:build`; then from `packages/website` `PORT=34567 node server.mjs` and GET `http://127.0.0.1:34567/`
- **Pass condition:** HTTP 200 and body contains `LexAI`; `/healthz` returns `ok`
- **Failure signal:** `Cannot GET /`, connection refused, or 500 `dist/ missing`
- **Cost:** fast
- **Last verified:** 2026-08-17 pass (status 200, title present)
## Eval template

View File

@@ -4,8 +4,8 @@
## Current state
- **Outcome:** `packages/website` now uses the four-page structure: Home, Docs, Contribute, Community.
- **Home:** hero + features + Getting started (Chrome / VS Code / CLI) + privacy.
- **Routes:** `/` `/docs` `/contribute` `/community` (HashRouter).
- **Verified:** `website:typecheck` + `website:build` passed.
- **Next smallest action:** Deploy `packages/website` on Coolify (base `/packages/website`, static, publish `/dist`).
- **Outcome:** Coolify `Cannot GET /` fixed — website now has a production static server and a Dockerfile.
- **Cause:** Nixpacks built Vite `dist/` but had no `start` command; README also told Coolify to publish `/dist` (absolute empty path).
- **Shipped:** `packages/website/server.mjs` (`npm start` on `0.0.0.0:$PORT`); `Dockerfile` + `nginx.conf`; `nixpacks.toml` `[start]`; Vite `base` is `/`.
- **Verified:** `website:typecheck` + `website:build`; local `node server.mjs` → GET `/` 200 (LexAI HTML), `/healthz` 200, JS asset `text/javascript`.
- **Next smallest action:** Redeploy the Coolify app with Base Directory `packages/website` (no leading slash), static site **off**, Dockerfile port 80 or Nixpacks port 3000.

View File

@@ -6,7 +6,15 @@ This is the project’s shared, evidence-backed memory of mistakes worth prevent
`AGENTS.md` → `## Lessons` is the canonical active rule list loaded every session. Keep supporting evidence here; mirror an active rule here only when its detail is useful for maintenance. Keep at most 12 active rules, each short and imperative.
_No active guardrails yet._
### L-2026-08-17-01 — Serve website `dist/` on `0.0.0.0:$PORT`; do not use Vite preview in production
- **Status:** active
- **Trigger:** Coolify deploy of `packages/website` returned Express/Connect `Cannot GET /`.
- **Root cause / failure boundary:** No `start` script; Nixpacks built `dist/` then started a Node process that did not serve it. README Publish Directory `/dist` is an absolute empty path.
- **Prevention:** `packages/website/server.mjs` + `npm start`, or `packages/website/Dockerfile`. Coolify: Base Directory `packages/website`, static site off.
- **Evidence:** Local `node server.mjs` GET `/` → 200 with LexAI HTML; `/healthz` → 200.
- **Eval:** E-2026-08-17-01
- **Owner / review:** lead / after first successful Coolify deploy
## Recording policy

View File

@@ -17,7 +17,7 @@
- Style Chrome UI with inline styles (Tailwind not wired).
- Prefer encrypted Chrome key path; keep plaintext `apiKey` fallback until migration.
- VS Code / CLI must not import `@lib/crypto` or `@lib/messaging`.
- Root scripts: `install:all`, `chrome:*`, `vscode:*`, `cli:*`.
- Root scripts: `install:all`, `chrome:*`, `vscode:*`, `cli:*`, `website:*`.
## Environment quirks
@@ -32,7 +32,7 @@
| Shared lib | `src/lib/` |
| VS Code | `packages/vscode/` |
| CLI | `packages/cli/` |
| Website | `packages/website/` (Vite React; Home, Docs, Contribute, Community) |
| Website | `packages/website/` (Vite React; Home, Docs, Contribute, Community). Production: `npm start` → `server.mjs`, or `Dockerfile` (nginx :80). Coolify base `packages/website`, static site off. |
| OSS meta | root `README.md`, `LICENSE`, `CONTRIBUTING.md`, `CODE_OF_CONDUCT.md` |
| Issue/PR templates | `.gitea/ISSUE_TEMPLATE/`, `.gitea/PULL_REQUEST_TEMPLATE.md` |
| CI workflows | `.gitea/workflows/ci-{chrome,vscode,cli,website}.yml` (no deploy/release yet) |

View File

@@ -2,28 +2,32 @@
> For the owner. What works, how to see it, and what's waiting on you — plain language.
**Updated:** 2026-08-13 · **Overall:** Chrome LexAI unchanged; VS Code LexAI v1 ready to try locally
**Updated:** 2026-08-17 · **Overall:** Website Coolify 404 is fixed in the repo; needs a redeploy
## What works now
- Chrome extension (existing): select on any page → AI action → Replace/Copy
- VS Code extension (new): select in editor → LexAI context menu / Command Palette → selection replaced
- Shared LLM core (`src/lib`) used by both; VS Code key lives in Secret Storage
- Chrome extension: select on any page → AI action → Replace/Copy
- VS Code extension: select in editor → LexAI context menu / Command Palette → selection replaced
- Website (`packages/website`): Home, Docs, Contribute, Community — production server answers `GET /` (this was the Coolify `Cannot GET /` failure)
## See it yourself (VS Code) — about five minutes
## See it yourself — website on Coolify
1. From repo root: `npm run vscode:install` then `npm run vscode:build`
2. Open `packages/vscode` in VS Code/Cursor → Run and Debug → **Run LexAI Extension** (F5), or `npm run vscode:package` and Install from VSIX
3. Command Palette → **LexAI: Set API Key** → pick provider → paste key
4. Select ≥10 characters in an editor → right-click → **LexAI** → Fix Grammar (or another action)
1. Pull/push this change, then in Coolify set **Base Directory** to `packages/website` (no leading slash).
2. Turn **Is it a static site?** **off**.
3. Either **Build Pack: Dockerfile** and port **80**, or **Nixpacks** and port **3000**.
4. Redeploy, then open the domain — you should see the LexAI home page, not `Cannot GET /`.
5. Docs live at `https://your-domain/#/docs`.
Local check: `npm run website:build` then `npm run website:start` and visit http://127.0.0.1:3000/
## Waiting on you
| # | Decision | Options (recommended bold) | What it unblocks |
| --- | --- | --- | --- |
| 1 | Confirm Cursor mid/strong model picker IDs | **Keep written IDs** / send exact picker strings | reliable Task dispatch for builders/critics |
| 2 | Grammarly reference screenshots? | **Later** / capture into `docs/reference/` | Chrome UX gauntlet |
| 3 | Publish VS Code extension to Marketplace? | **Stay local for now** / set publisher + publish | public install |
| 1 | Redeploy the Coolify website with the settings above | **Dockerfile + port 80** / Nixpacks + port 3000 | public LexAI site |
| 2 | Confirm Cursor mid/strong model picker IDs | **Keep written IDs** / send exact picker strings | reliable Task dispatch |
| 3 | Grammarly reference screenshots? | **Later** / capture into `docs/reference/` | Chrome UX gauntlet |
| 4 | Publish VS Code extension to Marketplace? | **Stay local for now** / set publisher + publish | public install |
## Next up — proceeds without you