feat: Integrate Directus CMS, add i18n with next-intl, and configure project tooling with pnpm, husky, and commitlint.**

This commit is contained in:
2026-02-05 01:18:06 +01:00
parent 765cfd4c69
commit e80140f7cf
65 changed files with 12793 additions and 5879 deletions

View File

@@ -0,0 +1,44 @@
import type {
NotificationMessage,
NotificationService,
} from "./notification-service";
export interface GotifyConfig {
url: string;
token: string;
enabled: boolean;
}
export class GotifyNotificationService implements NotificationService {
constructor(private readonly config: GotifyConfig) {}
async notify(message: NotificationMessage): Promise<void> {
if (!this.config.enabled) return;
try {
const response = await fetch(
`${this.config.url}/message?token=${this.config.token}`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
title: message.title,
message: message.message,
priority: message.priority ?? 5,
}),
},
);
if (!response.ok) {
console.error(
"Failed to send Gotify notification",
await response.text(),
);
}
} catch (error) {
console.error("Error sending Gotify notification", error);
}
}
}

View File

@@ -0,0 +1,5 @@
import type { NotificationService } from "./notification-service";
export class NoopNotificationService implements NotificationService {
async notify() {}
}

View File

@@ -0,0 +1,9 @@
export interface NotificationMessage {
title: string;
message: string;
priority?: number; // 0-10, Gotify style
}
export interface NotificationService {
notify(message: NotificationMessage): Promise<void>;
}