feat(api): integrate Prisma client with /db/health endpoint

- Add @ketopath/db and fastify-plugin to apps/api
- prismaPlugin decorates the Fastify instance with prisma and disconnects
  on app close, with FastifyInstance type augmented in src/types/fastify.d.ts
- DATABASE_URL is now required by env validation
- New module modules/db with GET /db/health running SELECT 1 via Prisma
- dev script switched to tsx --env-file=.env for env loading

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
lucianoandClaude Opus 4.7 committed 2026-04-29 12:38:04 +02:00
1 parent d309d06970
commit 72d47da453
8 files changed
+40 -3

No files matched your search

+3 -1
View File
@@ -4,7 +4,7 @@
"private": true,
"type": "module",
"scripts": {
"dev": "tsx watch src/server.ts",
"dev": "tsx watch --env-file=.env src/server.ts",
"build": "tsc",
"start": "node dist/server.js",
"typecheck": "tsc --noEmit",
@@ -15,8 +15,10 @@
"@fastify/helmet": "^11.1.1",
"@fastify/rate-limit": "^9.1.0",
"@fastify/sensible": "^5.6.0",
"@ketopath/db": "workspace:*",
"@ketopath/shared": "workspace:*",
"fastify": "^4.28.1",
"fastify-plugin": "^4.5.1",
"zod": "^3.23.8"
},
"devDependencies": {