refactor: production-essentials hardening pass
Build and Deploy / Lint, typecheck, test (push) Successful in 30s
Build and Deploy / Build & Push (push) Successful in 1m39s

Backend: structured logger, env-validated config, graceful SIGTERM/SIGINT
shutdown, per-IP rate limiter, per-tier scheduler concurrency latch, error
context on previously-silent catches, compiled-JS Dockerfile stage.

Frontend: lib/api.ts consolidates BACKEND_URL with lazy production-required
check, root + per-segment error.tsx / not-found.tsx / loading.tsx,
generateMetadata on park and ride pages, graceful fallback when backend is
unreachable, Plausible script gated on env vars.

Infra: CI runs lint + typecheck + tests on both packages before docker build,
compose adds healthchecks, log rotation, and memory limits; .env.example
documents every variable.

Cleanup: removed empty app/api/parks/ dir and 0-byte root parks.db, moved
wait-times-urls.txt into docs/, dropped an `as any` cast.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-30 10:17:52 -04:00
parent 6447db3008
commit 5d9daee627
30 changed files with 860 additions and 126 deletions
+10 -5
View File
@@ -2,6 +2,9 @@ import type { Metadata } from "next";
import Script from "next/script";
import "./globals.css";
const PLAUSIBLE_SRC = process.env.NEXT_PUBLIC_PLAUSIBLE_SRC;
const PLAUSIBLE_WEBSITE_ID = process.env.NEXT_PUBLIC_PLAUSIBLE_WEBSITE_ID;
export const metadata: Metadata = {
title: "Thoosie Calendar",
description: "Theme park operating hours and live ride status at a glance",
@@ -12,11 +15,13 @@ export default function RootLayout({ children }: { children: React.ReactNode })
<html lang="en">
<body>
{children}
<Script
src="https://tracking.thewrightserver.net/script.js"
data-website-id="a0d0582a-9bd0-4c0d-8e3c-3e6fcc99ec9a"
strategy="afterInteractive"
/>
{PLAUSIBLE_SRC && PLAUSIBLE_WEBSITE_ID ? (
<Script
src={PLAUSIBLE_SRC}
data-website-id={PLAUSIBLE_WEBSITE_ID}
strategy="afterInteractive"
/>
) : null}
</body>
</html>
);