From e9ba8d292d88a440f7622d0b7cea1c1115741098 Mon Sep 17 00:00:00 2001 From: lila Date: Fri, 24 Apr 2026 10:21:06 +0200 Subject: [PATCH 1/7] updating tasks --- documentation/backlog.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/documentation/backlog.md b/documentation/backlog.md index 127ee05..5e8f28d 100644 --- a/documentation/backlog.md +++ b/documentation/backlog.md @@ -29,9 +29,6 @@ Things that are actively in progress or should be picked up immediately. Mostly - **Conditionally register OAuth providers** `[debt]` Better Auth logs warnings when social providers are registered without credentials (`Social provider google is missing clientId or clientSecret`). Instead of registering all providers unconditionally, only add a provider to the config when its credentials are present in the environment. Keeps local dev clean for contributors who don't have OAuth apps set up. -- **Multiplayer GameService unit tests** `[debt]` - round evaluation, scoring, tie-breaking, timeout handling - --- ## next @@ -117,6 +114,7 @@ Directionally right, timing is unclear. Revisit when the next/now work is done. Shipped milestones, newest first. +- **04 - 2026 - Multiplayer GameService unit tests** - round evaluation, scoring, tie-breaking, timeout handling - **04 - 2026 - Security headers with helmet** - Add helmet middleware to set secure HTTP response headers. - **04 - 2026 - Rate limiting on API endpoints** - At minimum: auth endpoints (brute force prevention) and game endpoints (spam prevention) - **04 - 2026 — Migrations in deploy pipeline** — Drizzle migrate runs as a CI/CD step before the API container restarts From 4fabde57bd95ceff6e914c5bb34a00779000f56e Mon Sep 17 00:00:00 2001 From: lila Date: Fri, 24 Apr 2026 10:27:54 +0200 Subject: [PATCH 2/7] adding prompt --- documentation/notes.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/documentation/notes.md b/documentation/notes.md index 2da500d..eb25e7a 100644 --- a/documentation/notes.md +++ b/documentation/notes.md @@ -1,5 +1,19 @@ # notes + +## prompt + +ive attached the readme of my project. this is my current task: + +task description. + +1. tell me which files you need to see to get the full context of the problem +2. walk me text-only through the problem and the solution +3. if we need to update multiple files: lets go through them one by one, no matter how many files +4. if we go through a file, we'll do it slowly section by section, no matter how many sections +5. how to name the current feature branch? also tell me when its time to git commit and provide a commit message +6. if we have multiple options to do something, also always provide options that reflect current industry standards and best practices + ## tasks - **IMPORTANT** db migrations have to be part of the deployment pipeline!!!!!!!!!!!!!!!!!! From 4de2c404823fdf4a550a5846199783c674bea41b Mon Sep 17 00:00:00 2001 From: lila Date: Fri, 24 Apr 2026 18:28:22 +0200 Subject: [PATCH 3/7] feat: add 404 catch-all route and NotFound page --- apps/web/src/components/NotFound.tsx | 43 ++++++++++++++++++++++++ apps/web/src/components/landing/Hero.tsx | 12 ++++--- apps/web/src/routes/__root.tsx | 6 +++- 3 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 apps/web/src/components/NotFound.tsx diff --git a/apps/web/src/components/NotFound.tsx b/apps/web/src/components/NotFound.tsx new file mode 100644 index 0000000..be4219d --- /dev/null +++ b/apps/web/src/components/NotFound.tsx @@ -0,0 +1,43 @@ +import { Link } from "@tanstack/react-router"; + +export default function NotFound() { + return ( +
+
+
+
+
+ +
+ + lost in translation + +
+ +

+ 4 + + 0 + + 4 +

+ +

+ This page doesn't exist. Maybe it never did - or maybe you{" "} + + just guessed wrong + + . +

+ +
+ + Back to home + +
+
+ ); +} diff --git a/apps/web/src/components/landing/Hero.tsx b/apps/web/src/components/landing/Hero.tsx index 6a6de87..81f7bba 100644 --- a/apps/web/src/components/landing/Hero.tsx +++ b/apps/web/src/components/landing/Hero.tsx @@ -7,8 +7,8 @@ const Hero = () => { return (
-
-
+
+
@@ -28,9 +28,11 @@ const Hero = () => {

- A word appears. You pick the translation. You score points. - Then you queue up a room and{" "} - beat friends{" "} + A word appears. You pick the translation. You score points. Then you + queue up a room and{" "} + + beat friends + {" "} in real time.

diff --git a/apps/web/src/routes/__root.tsx b/apps/web/src/routes/__root.tsx index 1dc4378..4dcdf3c 100644 --- a/apps/web/src/routes/__root.tsx +++ b/apps/web/src/routes/__root.tsx @@ -1,6 +1,7 @@ import { createRootRoute, Outlet } from "@tanstack/react-router"; import { TanStackRouterDevtools } from "@tanstack/react-router-devtools"; import Navbar from "../components/navbar/NavBar"; +import NotFound from "../components/NotFound"; const RootLayout = () => { return ( @@ -14,4 +15,7 @@ const RootLayout = () => { ); }; -export const Route = createRootRoute({ component: RootLayout }); +export const Route = createRootRoute({ + component: RootLayout, + notFoundComponent: NotFound, +}); From e3d28e41279da0bc0759881e4c9aba7b2d53fc9b Mon Sep 17 00:00:00 2001 From: lila Date: Fri, 24 Apr 2026 18:34:43 +0200 Subject: [PATCH 4/7] updating issues --- documentation/backlog.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/documentation/backlog.md b/documentation/backlog.md index 5e8f28d..82bdf94 100644 --- a/documentation/backlog.md +++ b/documentation/backlog.md @@ -8,9 +8,6 @@ Labels: `[feature]` `[infra]` `[security]` `[ux]` `[debt]` Things that are actively in progress or should be picked up immediately. Mostly operational risk and the remaining phase 7 hardening work. -- **404 and redirect handling** `[ux]` - Unknown routes return raw errors. Add a catch-all route on the frontend for client-side 404s. Consider a Caddy fallback for unrecognized subdomains. - - **React error boundaries** `[ux]` Catch and display runtime errors gracefully instead of crashing the entire app. @@ -114,6 +111,7 @@ Directionally right, timing is unclear. Revisit when the next/now work is done. Shipped milestones, newest first. +- **04 - 2026 - 404 and redirect handling** - Unknown routes return raw errors. Add a catch-all route on the frontend for client-side 404s. - **04 - 2026 - Multiplayer GameService unit tests** - round evaluation, scoring, tie-breaking, timeout handling - **04 - 2026 - Security headers with helmet** - Add helmet middleware to set secure HTTP response headers. - **04 - 2026 - Rate limiting on API endpoints** - At minimum: auth endpoints (brute force prevention) and game endpoints (spam prevention) From 0da839794008cb6b7c67ce838f1687da9d9b3290 Mon Sep 17 00:00:00 2001 From: lila Date: Sun, 26 Apr 2026 08:45:18 +0200 Subject: [PATCH 5/7] feat: add root and route-level error boundaries --- apps/web/src/components/RootError.tsx | 56 ++++++++++++++++++++++++++ apps/web/src/components/RouteError.tsx | 49 ++++++++++++++++++++++ apps/web/src/routes/__root.tsx | 2 + apps/web/src/routes/play.tsx | 2 + 4 files changed, 109 insertions(+) create mode 100644 apps/web/src/components/RootError.tsx create mode 100644 apps/web/src/components/RouteError.tsx diff --git a/apps/web/src/components/RootError.tsx b/apps/web/src/components/RootError.tsx new file mode 100644 index 0000000..e370317 --- /dev/null +++ b/apps/web/src/components/RootError.tsx @@ -0,0 +1,56 @@ +import { Link } from "@tanstack/react-router"; + +interface RootErrorProps { + error: Error; + reset: () => void; +} + +export default function RootError({ error, reset }: RootErrorProps) { + return ( +
+
+
+
+
+ +
+ + something went wrong + +
+ +

+ Unexpected{" "} + + error + +

+ +

+ Something crashed. This has been noted —{" "} + it's not you. +

+ + {import.meta.env.DEV && ( +
+          {error.message}
+        
+ )} + +
+ + + Back to home + +
+
+ ); +} diff --git a/apps/web/src/components/RouteError.tsx b/apps/web/src/components/RouteError.tsx new file mode 100644 index 0000000..d068eb4 --- /dev/null +++ b/apps/web/src/components/RouteError.tsx @@ -0,0 +1,49 @@ +interface RouteErrorProps { + error: Error; + reset: () => void; +} + +export default function RouteError({ error, reset }: RouteErrorProps) { + return ( +
+
+
+
+
+ +
+ + something went wrong + +
+ +

+ This page{" "} + + crashed + +

+ +

+ Something went wrong loading this page.{" "} + Try again or + head back home. +

+ + {import.meta.env.DEV && ( +
+          {error.message}
+        
+ )} + +
+ +
+
+ ); +} diff --git a/apps/web/src/routes/__root.tsx b/apps/web/src/routes/__root.tsx index 4dcdf3c..c672ced 100644 --- a/apps/web/src/routes/__root.tsx +++ b/apps/web/src/routes/__root.tsx @@ -2,6 +2,7 @@ import { createRootRoute, Outlet } from "@tanstack/react-router"; import { TanStackRouterDevtools } from "@tanstack/react-router-devtools"; import Navbar from "../components/navbar/NavBar"; import NotFound from "../components/NotFound"; +import RootError from "../components/RootError"; const RootLayout = () => { return ( @@ -18,4 +19,5 @@ const RootLayout = () => { export const Route = createRootRoute({ component: RootLayout, notFoundComponent: NotFound, + errorComponent: RootError, }); diff --git a/apps/web/src/routes/play.tsx b/apps/web/src/routes/play.tsx index 32db5c4..df4959d 100644 --- a/apps/web/src/routes/play.tsx +++ b/apps/web/src/routes/play.tsx @@ -4,6 +4,7 @@ import type { GameSession, GameRequest, AnswerResult } from "@lila/shared"; import { QuestionCard } from "../components/game/QuestionCard"; import { ScoreScreen } from "../components/game/ScoreScreen"; import { GameSetup } from "../components/game/GameSetup"; +import RouteError from "../components/RouteError"; import { authClient } from "../lib/auth-client"; type GameStartResponse = { success: true; data: GameSession }; @@ -127,6 +128,7 @@ function Play() { export const Route = createFileRoute("/play")({ component: Play, + errorComponent: RouteError, beforeLoad: async () => { const { data: session } = await authClient.getSession(); if (!session) { From 091495c1dbe9fa4a1913b600ba5f68d6fcdb4b79 Mon Sep 17 00:00:00 2001 From: lila Date: Sun, 26 Apr 2026 08:46:54 +0200 Subject: [PATCH 6/7] updating tasks --- documentation/backlog.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/documentation/backlog.md b/documentation/backlog.md index 82bdf94..865c9f2 100644 --- a/documentation/backlog.md +++ b/documentation/backlog.md @@ -8,9 +8,6 @@ Labels: `[feature]` `[infra]` `[security]` `[ux]` `[debt]` Things that are actively in progress or should be picked up immediately. Mostly operational risk and the remaining phase 7 hardening work. -- **React error boundaries** `[ux]` - Catch and display runtime errors gracefully instead of crashing the entire app. - - **Pin dependencies in package.json** `[debt]` `[infra]` Unpinned deps in a CI/CD pipeline are a real risk. Pin all versions to exact values to prevent unexpected breakage on build. @@ -111,6 +108,7 @@ Directionally right, timing is unclear. Revisit when the next/now work is done. Shipped milestones, newest first. +- **04 - 2026 - React error boundaries** - Catch and display runtime errors gracefully instead of crashing the entire app. - **04 - 2026 - 404 and redirect handling** - Unknown routes return raw errors. Add a catch-all route on the frontend for client-side 404s. - **04 - 2026 - Multiplayer GameService unit tests** - round evaluation, scoring, tie-breaking, timeout handling - **04 - 2026 - Security headers with helmet** - Add helmet middleware to set secure HTTP response headers. From 768ca24eb21b1032ae2783d2c045a15bc7c33216 Mon Sep 17 00:00:00 2001 From: lila Date: Sun, 26 Apr 2026 09:03:23 +0200 Subject: [PATCH 7/7] fix: remove unfrozen pnpm install from builder stages --- apps/api/Dockerfile | 7 +++++-- apps/web/Dockerfile | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/api/Dockerfile b/apps/api/Dockerfile index a581eae..9026478 100644 --- a/apps/api/Dockerfile +++ b/apps/api/Dockerfile @@ -22,9 +22,12 @@ CMD ["pnpm", "--filter", "api", "dev"] # 4. build FROM base AS builder WORKDIR /app -COPY --from=deps /app/node_modules ./node_modules +COPY pnpm-lock.yaml pnpm-workspace.yaml package.json ./ +COPY apps/api/package.json ./apps/api/ +COPY packages/shared/package.json ./packages/shared/ +COPY packages/db/package.json ./packages/db/ +RUN pnpm install --frozen-lockfile COPY . . -RUN pnpm install RUN pnpm --filter shared build RUN pnpm --filter db build RUN pnpm --filter api build diff --git a/apps/web/Dockerfile b/apps/web/Dockerfile index bc18ec1..dc4d137 100644 --- a/apps/web/Dockerfile +++ b/apps/web/Dockerfile @@ -21,9 +21,11 @@ CMD ["pnpm", "--filter", "web", "dev", "--host"] # 4. Build FROM base AS builder WORKDIR /app -COPY --from=deps /app/node_modules ./node_modules +COPY pnpm-lock.yaml pnpm-workspace.yaml package.json ./ +COPY apps/web/package.json ./apps/web/ +COPY packages/shared/package.json ./packages/shared/ +RUN pnpm install --frozen-lockfile COPY . . -RUN pnpm install ARG VITE_API_URL ENV VITE_API_URL=$VITE_API_URL RUN pnpm --filter shared build