diff --git a/backend/docker-compose.yml b/backend/docker-compose.yml index 24a286f..b5fa65b 100644 --- a/backend/docker-compose.yml +++ b/backend/docker-compose.yml @@ -1,6 +1,6 @@ services: psql_bp: - image: postgres:latest + image: postgres:16 restart: unless-stopped environment: POSTGRES_DB: ${BLUEPRINT_DB_DATABASE} diff --git a/backend/internal/infrastructure/database/postgres/health_repository_test.go b/backend/internal/infrastructure/database/postgres/health_repository_test.go index 3d402d5..e92c5be 100644 --- a/backend/internal/infrastructure/database/postgres/health_repository_test.go +++ b/backend/internal/infrastructure/database/postgres/health_repository_test.go @@ -23,7 +23,7 @@ func mustStartPostgresContainer() (func(context.Context, ...testcontainers.Termi container, err := tcpostgres.Run( context.Background(), - "postgres:latest", + "postgres:16", tcpostgres.WithDatabase(dbName), tcpostgres.WithUsername(dbUser), tcpostgres.WithPassword(dbPwd), diff --git a/web/AGENTS.md b/web/AGENTS.md index 3033cd6..aedba6e 100644 --- a/web/AGENTS.md +++ b/web/AGENTS.md @@ -56,6 +56,7 @@ Read the relevant doc before implementing. These are kept in sync with the code |---|---| | App Router, route files, layouts, navigation | [`docs/routing.md`](docs/routing.md) | | Server Components, data fetching, Server Actions | [`docs/data-fetching.md`](docs/data-fetching.md) | +| tRPC routers, React Query, client/server usage | [`docs/trpc.md`](docs/trpc.md) | | Tailwind CSS v4, theme tokens, dark mode | [`docs/styling.md`](docs/styling.md) | | Component conventions, TypeScript rules | [`docs/components.md`](docs/components.md) | | Testing setup, patterns, what to test | [`docs/testing.md`](docs/testing.md) | diff --git a/web/app/api/trpc/[trpc]/route.ts b/web/app/api/trpc/[trpc]/route.ts new file mode 100644 index 0000000..4e7a37b --- /dev/null +++ b/web/app/api/trpc/[trpc]/route.ts @@ -0,0 +1,14 @@ +import { fetchRequestHandler } from '@trpc/server/adapters/fetch' +import { type NextRequest } from 'next/server' +import { createTRPCContext } from '@/server/trpc' +import { appRouter } from '@/server/routers/_app' + +const handler = (req: NextRequest) => + fetchRequestHandler({ + endpoint: '/api/trpc', + req, + router: appRouter, + createContext: () => createTRPCContext({ req }), + }) + +export { handler as GET, handler as POST } diff --git a/web/app/layout.tsx b/web/app/layout.tsx index 976eb90..5068e0a 100644 --- a/web/app/layout.tsx +++ b/web/app/layout.tsx @@ -1,6 +1,7 @@ import type { Metadata } from "next"; import { Geist, Geist_Mono } from "next/font/google"; import "./globals.css"; +import { Providers } from "./providers"; const geistSans = Geist({ variable: "--font-geist-sans", @@ -27,7 +28,9 @@ export default function RootLayout({ lang="en" className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`} > -
{children} + +