-
Notifications
You must be signed in to change notification settings - Fork 0
Railway-only deployment docs + document-viewer UX cleanup #511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ca37957
docs: make Railway the sole deployment platform of record
BigSimmo c60bf69
fix(document-viewer): collapse redundant nav chrome and tidy layout
BigSimmo 5c9a02b
fix(accessible-table): stop table cells breaking words mid-character
BigSimmo 7428b4a
Merge origin/main and resolve DocumentViewer merge conflicts
Copilot d7fb7ec
Merge remote-tracking branch 'refs/remotes/origin/main' into claude/p…
Copilot a67d2a1
fix: unblock Railway and document viewer checks
BigSimmo c7c1dc3
merge: update deployment branch with main
BigSimmo 14e3b6f
fix(ci): restore document viewer h1, lint icons, update sitemap
cursoragent 631f0a3
Merge remote-tracking branch 'origin/main' into claude/production-dep…
Copilot 96af452
Merge branch 'main' into claude/production-deployment-setup-d83ef8
BigSimmo 57c2e58
Merge branch 'main' into claude/production-deployment-setup-d83ef8
BigSimmo 7cca301
Merge branch 'main' into claude/production-deployment-setup-d83ef8
BigSimmo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "$schema": "https://railway.com/railway.schema.json", | ||
| "build": { | ||
| "builder": "DOCKERFILE", | ||
| "dockerfilePath": "Dockerfile" | ||
| }, | ||
| "deploy": { | ||
| "healthcheckPath": "/api/health/ready", | ||
| "restartPolicyType": "ON_FAILURE", | ||
| "multiRegionConfig": { | ||
| "asia-southeast1-eqsg3a": { | ||
| "numReplicas": 1 | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "$schema": "https://railway.com/railway.schema.json", | ||
| "build": { | ||
| "builder": "DOCKERFILE", | ||
| "dockerfilePath": "Dockerfile.worker" | ||
| }, | ||
| "deploy": { | ||
| "restartPolicyType": "ON_FAILURE", | ||
| "multiRegionConfig": { | ||
| "asia-southeast1-eqsg3a": { | ||
| "numReplicas": 1 | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import { healthResponse } from "@/lib/health-response"; | ||
|
|
||
| export const runtime = "nodejs"; | ||
| export const dynamic = "force-dynamic"; | ||
|
|
||
| // Railway cannot attach the authenticated deep-probe header. This endpoint is | ||
| // intentionally limited to readiness state and exposes no diagnostic details. | ||
| export async function GET(request: Request) { | ||
| return healthResponse(request, { forceDeep: true, allowUnauthenticatedDeep: true, includeSlo: false }); | ||
| } | ||
|
BigSimmo marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,64 +1,8 @@ | ||
| import { NextResponse } from "next/server"; | ||
| import { env, isDemoMode } from "@/lib/env"; | ||
| import type { AnswerSloSnapshot } from "@/lib/observability/answer-slo"; | ||
| import { allowDeepHealthProbe } from "@/lib/deep-probe-auth"; | ||
| import { healthResponse } from "@/lib/health-response"; | ||
|
|
||
| export const runtime = "nodejs"; | ||
| export const dynamic = "force-dynamic"; | ||
|
|
||
| export async function GET(request: Request) { | ||
| const deep = new URL(request.url).searchParams.get("deep") === "1"; | ||
| const supabaseConfigured = Boolean(env.NEXT_PUBLIC_SUPABASE_URL && env.SUPABASE_SERVICE_ROLE_KEY); | ||
|
|
||
| const checks: Record<string, "ok" | "missing" | "error" | "skipped" | "unauthorized"> = { | ||
| supabaseConfig: supabaseConfigured ? "ok" : "missing", | ||
| openaiConfig: env.OPENAI_API_KEY ? "ok" : "missing", | ||
| }; | ||
|
|
||
| let slo: AnswerSloSnapshot | null = null; | ||
| if (deep) { | ||
| if (!allowDeepHealthProbe(request)) { | ||
| checks.supabase = "unauthorized"; | ||
| } else if (supabaseConfigured && !isDemoMode()) { | ||
| try { | ||
| const [{ createAdminClient }, { probeSupabaseHealth }, { answerSloSnapshot }] = await Promise.all([ | ||
| import("@/lib/supabase/admin"), | ||
| import("@/lib/supabase/health"), | ||
| import("@/lib/observability/answer-slo"), | ||
| ]); | ||
| const admin = createAdminClient(); | ||
| const health = await probeSupabaseHealth(admin); | ||
| checks.supabase = health.ok ? "ok" : "error"; | ||
| if (health.ok) { | ||
| // Reliability telemetry only — a failure here must NOT flip liveness to | ||
| // 503, so it stays out of `checks` (which gates `ready`). | ||
| try { | ||
| slo = await answerSloSnapshot(admin); | ||
| } catch { | ||
| slo = null; | ||
| } | ||
| } | ||
| } catch { | ||
| checks.supabase = "error"; | ||
| } | ||
| } else { | ||
| checks.supabase = "skipped"; | ||
| } | ||
| } | ||
|
|
||
| const ready = !Object.values(checks).some( | ||
| (value) => value === "missing" || value === "error" || value === "unauthorized", | ||
| ); | ||
|
|
||
| return NextResponse.json( | ||
| { | ||
| status: ready ? "ok" : "degraded", | ||
| demoMode: isDemoMode(), | ||
| timestamp: new Date().toISOString(), | ||
| uptimeSeconds: Math.round(process.uptime()), | ||
| checks, | ||
| ...(slo ? { slo } : {}), | ||
| }, | ||
| { status: ready ? 200 : 503, headers: { "Cache-Control": "no-store" } }, | ||
| ); | ||
| return healthResponse(request); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the staging setup runbook, this starts a literal
```dotenvmarker inside the four-backtick bash block opened above, so the following health-check prose is rendered as part of the shell snippet. When an operator copies the “Apply the schema” commands, they can paste the stray fence/prose into a shell before running the health check; close the bash fence aftersupabase db pushand keep the health note as normal text.Useful? React with 👍 / 👎.