Conversation
Connect the initial Next.js shell to the local Convex health path so the app can prove the stack works end to end before schema and auth work land.
Greptile SummaryThis PR mounts a minimal Convex provider in the Next.js app and wires the homepage to the
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant Bootstrap as run-convex-local.mjs
participant RepoEnv as .env.local (repo root)
participant WebEnv as apps/web/.env.local
participant ConvexDev as Convex Dev Server
participant Browser as Browser
participant Provider as ConvexClientProvider
participant Card as BackendStatusCard / useQuery
participant Backend as convex/health.ts
Dev->>Bootstrap: pnpm dev:backend:local
Bootstrap->>ConvexDev: spawn convex dev --local
ConvexDev-->>RepoEnv: write CONVEX_URL=http://localhost:…
Bootstrap->>Bootstrap: syncPublicConvexUrl() (initial)
Bootstrap->>WebEnv: write NEXT_PUBLIC_CONVEX_URL=http://localhost:…
Bootstrap->>RepoEnv: fs.watch (file watcher)
RepoEnv-->>Bootstrap: change event
Bootstrap->>WebEnv: syncPublicConvexUrl() (on change)
Dev->>Browser: pnpm dev:web → open homepage
Browser->>Provider: mount ConvexClientProvider
Provider->>Provider: new ConvexReactClient(NEXT_PUBLIC_CONVEX_URL)
Provider->>ConvexDev: open WebSocket
Browser->>Card: render BackendStatusCard
Card->>Provider: useQuery(api.health.status, {})
Provider->>Backend: subscribe health:status
Backend-->>Provider: { status: "ok", … }
Provider-->>Card: result
Card-->>Browser: display live status
Reviews (10): Last reviewed commit: "fix: reduce Convex bootstrap path brittl..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f6d140b19e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Align the web bootstrap with Next.js public env conventions, use the mounted Convex provider for the live status card, and harden the local bootstrap/typecheck helpers around the review findings.
Keep the Convex bootstrap helper from overwriting unrelated entries in apps/web/.env.local while still syncing NEXT_PUBLIC_CONVEX_URL for the web app.
Handle local web env syncing more conservatively and add a defensive runtime fallback around the live status card so review-driven edge cases do not degrade the whole page.
Preserve direct web typecheck behavior, restore generated API typing for the status card, and reduce bootstrap helper churn while keeping safer failure handling around the live runtime panel.
Allow the live backend status card to recover after transient Convex failures instead of staying stuck behind the fallback state until a full page refresh.
Watch the repo .env.local file directly for Convex URL mirroring and only fall back to directory watching when necessary, so null filenames do not trigger unrelated syncs.
Guard the first NEXT_PUBLIC_CONVEX_URL mirror attempt so bootstrap errors do not leave a spawned Convex child process running after the parent exits.
Keep the local Convex bootstrap logs honest by reporting both the file-watch and fallback directory-watch errors when env mirroring watcher setup fails.
Replace the fragile cross-workspace relative API import with a tsconfig alias and avoid introducing an extra blank line when syncing NEXT_PUBLIC_CONVEX_URL into the web env file.
Summary
health:statusTesting
okin a browser smoke check