From 21771623005fc96fe64762c996d0e4681f2b4873 Mon Sep 17 00:00:00 2001 From: josh Date: Tue, 21 Apr 2026 20:45:46 -0400 Subject: [PATCH] Config and housekeeping cleanup - .gitignore: add coverage/, .vscode/, .idea/ - .env.example files: add header comments clarifying production vs dev, add SMTP vars to server dev template - Validate SavedView filters on load with safeParse fallback Co-Authored-By: Claude Opus 4.6 --- .env.example | 2 ++ .gitignore | 7 +++++++ client/src/api/queries.ts | 9 ++++++++- server/.env.example | 9 +++++++++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 56c8feb..91460d4 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,5 @@ +# Production — used with docker-compose (see server/.env.example for local dev) + # ── Registry ────────────────────────────────────────────────────────────────── # Hostname of your container registry (no trailing slash) REGISTRY=gitea.thewrightserver.net diff --git a/.gitignore b/.gitignore index d5c4f8c..8218533 100644 --- a/.gitignore +++ b/.gitignore @@ -15,5 +15,12 @@ dist/ .DS_Store Thumbs.db +# IDE +.vscode/ +.idea/ + +# Test coverage +coverage/ + # Claude Code .claude/ diff --git a/client/src/api/queries.ts b/client/src/api/queries.ts index be3bfd4..a81a241 100644 --- a/client/src/api/queries.ts +++ b/client/src/api/queries.ts @@ -11,6 +11,7 @@ import type { CreateTicketInput, UpdateTicketInput } from '../../../shared/schem import type { CreateUserInput, UpdateUserInput } from '../../../shared/schemas/user'; import type { UpdateWebhookInput } from '../../../shared/schemas/notification'; import type { CreateSavedViewInput } from '../../../shared/schemas/savedView'; +import { savedViewFiltersSchema } from '../../../shared/schemas/savedView'; // ── Keys ───────────────────────────────────────────────────────────────────── @@ -378,7 +379,13 @@ export function useRotateWebhookSecret() { export function useSavedViews() { return useQuery({ queryKey: qk.savedViews(), - queryFn: async () => (await api.get('/saved-views')).data, + queryFn: async () => { + const views = (await api.get('/saved-views')).data; + return views.map((v) => ({ + ...v, + filters: savedViewFiltersSchema.catch({}).parse(v.filters), + })); + }, staleTime: 60_000, }); } diff --git a/server/.env.example b/server/.env.example index 57e314b..2aee1dd 100644 --- a/server/.env.example +++ b/server/.env.example @@ -1,4 +1,13 @@ +# Development — used with 'npm run dev' (see root .env.example for Docker/production) DATABASE_URL="postgresql://postgres:postgres@localhost:5432/ticketing" JWT_SECRET="change-this-to-a-long-random-secret" CLIENT_URL="http://localhost:5173" PORT=3000 + +# Email notifications (optional) — leave SMTP_HOST empty to disable +SMTP_HOST= +SMTP_PORT=587 +SMTP_USER= +SMTP_PASS= +SMTP_FROM=noreply@localhost +SMTP_SECURE=false