Flesh out dd0c/alert: webhook routes, incident API, notification config, data layer

- Webhook routes: Datadog, PagerDuty, OpsGenie, Grafana with per-tenant HMAC/token auth
- Incident API: list (filtered), detail with alerts, acknowledge/resolve/suppress, dashboard summary
- Notification config: CRUD with upsert, test endpoint, Slack/email/webhook channels
- Grafana normalizer: severity mapping (critical/warning/info)
- Data layer: withTenant() RLS wrapper, Zod config validation
- Fastify server entry point with cors/helmet
This commit is contained in:
2026-03-01 03:04:57 +00:00
parent 57e7083986
commit d85cdaa3e7
6 changed files with 383 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
import { z } from 'zod';
const envSchema = z.object({
PORT: z.coerce.number().default(3000),
DATABASE_URL: z.string().default('postgresql://localhost:5432/dd0c_alert'),
REDIS_URL: z.string().default('redis://localhost:6379'),
JWT_SECRET: z.string().min(32).default('dev-secret-change-me-in-production!!'),
CORS_ORIGIN: z.string().default('*'),
LOG_LEVEL: z.string().default('info'),
});
export const config = envSchema.parse(process.env);
export type Config = z.infer<typeof envSchema>;