feat: complete CMS v2 with Docker, Fischerei, Meetings, Verband modules + UX audit fixes
Some checks failed
Workflow / ʦ TypeScript (push) Failing after 6m26s
Workflow / ⚫️ Test (push) Has been skipped

Major changes:
- Docker Compose: full Supabase stack (11 services) equivalent to supabase CLI
- Fischerei module: 16 DB tables, waters/species/stocking/catch books/competitions
- Sitzungsprotokolle module: meeting protocols, agenda items, task tracking
- Verbandsverwaltung module: federation management, member clubs, contacts, fees
- Per-account module activation via Modules page toggle
- Site Builder: live CMS data in Puck blocks (courses, events, membership registration)
- Public registration APIs: course signup, event registration, membership application
- Document generation: PDF member cards, Excel reports, HTML labels
- Landing page: real Com.BISS content (no filler text)
- UX audit fixes: AccountNotFound component, shared status badges, confirm dialog,
  pagination, duplicate heading removal, emoji→badge replacement, a11y fixes
- QA: healthcheck fix, API auth fix, enum mismatch fix, password required attribute
This commit is contained in:
Zaid Marzguioui
2026-03-31 16:35:46 +02:00
parent 16648c92eb
commit ebd0fd4638
176 changed files with 17133 additions and 981 deletions

View File

@@ -2,6 +2,7 @@ import { getSupabaseServerClient } from '@kit/supabase/server-client';
import { createMemberManagementApi } from '@kit/member-management/api';
import { EditMemberForm } from '@kit/member-management/components';
import { CmsPageShell } from '~/components/cms-page-shell';
import { AccountNotFound } from '~/components/account-not-found';
interface Props {
params: Promise<{ account: string; memberId: string }>;
@@ -11,7 +12,7 @@ export default async function EditMemberPage({ params }: Props) {
const { account, memberId } = await params;
const client = getSupabaseServerClient();
const { data: acct } = await client.from('accounts').select('id').eq('slug', account).single();
if (!acct) return <div>Konto nicht gefunden</div>;
if (!acct) return <AccountNotFound />;
const api = createMemberManagementApi(client);
const member = await api.getMember(memberId);

View File

@@ -2,6 +2,7 @@ import { getSupabaseServerClient } from '@kit/supabase/server-client';
import { createMemberManagementApi } from '@kit/member-management/api';
import { MemberDetailView } from '@kit/member-management/components';
import { CmsPageShell } from '~/components/cms-page-shell';
import { AccountNotFound } from '~/components/account-not-found';
interface Props {
params: Promise<{ account: string; memberId: string }>;
@@ -11,7 +12,7 @@ export default async function MemberDetailPage({ params }: Props) {
const { account, memberId } = await params;
const client = getSupabaseServerClient();
const { data: acct } = await client.from('accounts').select('id').eq('slug', account).single();
if (!acct) return <div>Konto nicht gefunden</div>;
if (!acct) return <AccountNotFound />;
const api = createMemberManagementApi(client);
const member = await api.getMember(memberId);

View File

@@ -2,6 +2,7 @@ import { getSupabaseServerClient } from '@kit/supabase/server-client';
import { createMemberManagementApi } from '@kit/member-management/api';
import { ApplicationWorkflow } from '@kit/member-management/components';
import { CmsPageShell } from '~/components/cms-page-shell';
import { AccountNotFound } from '~/components/account-not-found';
interface Props {
params: Promise<{ account: string }>;
@@ -11,7 +12,7 @@ export default async function ApplicationsPage({ params }: Props) {
const { account } = await params;
const client = getSupabaseServerClient();
const { data: acct } = await client.from('accounts').select('id').eq('slug', account).single();
if (!acct) return <div>Konto nicht gefunden</div>;
if (!acct) return <AccountNotFound />;
const api = createMemberManagementApi(client);
const applications = await api.listApplications(acct.id);

View File

@@ -1,11 +1,12 @@
import { getSupabaseServerClient } from '@kit/supabase/server-client';
import { createMemberManagementApi } from '@kit/member-management/api';
import { Card, CardContent, CardHeader, CardTitle } from '@kit/ui/card';
import { Button } from '@kit/ui/button';
import { Badge } from '@kit/ui/badge';
import { CreditCard, Download } from 'lucide-react';
import { CreditCard } from 'lucide-react';
import { CmsPageShell } from '~/components/cms-page-shell';
import { EmptyState } from '~/components/empty-state';
import { AccountNotFound } from '~/components/account-not-found';
/** All active members are fetched for the card overview. */
const CARDS_PAGE_SIZE = 100;
interface Props {
params: Promise<{ account: string }>;
@@ -15,67 +16,31 @@ export default async function MemberCardsPage({ params }: Props) {
const { account } = await params;
const client = getSupabaseServerClient();
const { data: acct } = await client.from('accounts').select('id').eq('slug', account).single();
if (!acct) return <div>Konto nicht gefunden</div>;
if (!acct) return <AccountNotFound />;
const api = createMemberManagementApi(client);
const result = await api.listMembers(acct.id, { status: 'active', pageSize: 100 });
const result = await api.listMembers(acct.id, { status: 'active', pageSize: CARDS_PAGE_SIZE });
const members = result.data;
return (
<CmsPageShell account={account} title="Mitgliedsausweise" description="Ausweise erstellen und verwalten">
<div className="space-y-6">
<div className="flex items-center justify-between">
<p className="text-sm text-muted-foreground">{members.length} aktive Mitglieder</p>
<Button disabled>
<Download className="mr-2 h-4 w-4" />
Alle Ausweise generieren (PDF)
</Button>
</div>
{members.length === 0 ? (
<EmptyState
icon={<CreditCard className="h-8 w-8" />}
title="Keine aktiven Mitglieder"
description="Erstellen Sie zuerst Mitglieder, um Ausweise zu generieren."
actionLabel="Mitglieder verwalten"
actionHref={`/home/${account}/members-cms`}
/>
) : (
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
{members.map((m: Record<string, unknown>) => (
<Card key={String(m.id)}>
<CardContent className="p-4">
<div className="flex items-center justify-between">
<div>
<p className="font-semibold">{String(m.last_name)}, {String(m.first_name)}</p>
<p className="text-xs text-muted-foreground">Nr. {String(m.member_number ?? '—')}</p>
</div>
<Badge variant="default">Aktiv</Badge>
</div>
<div className="mt-3 flex gap-2">
<Button size="sm" variant="outline" disabled>
<CreditCard className="mr-1 h-3 w-3" />
Ausweis
</Button>
</div>
</CardContent>
</Card>
))}
</div>
)}
<Card>
<CardHeader>
<CardTitle>PDF-Generierung</CardTitle>
</CardHeader>
<CardContent>
<p className="text-sm text-muted-foreground">
Die PDF-Generierung erfordert die Installation von <code>@react-pdf/renderer</code>.
Nach der Installation können Mitgliedsausweise einzeln oder als Stapel erstellt werden.
</p>
</CardContent>
</Card>
</div>
{members.length === 0 ? (
<EmptyState
icon={<CreditCard className="h-8 w-8" />}
title="Keine aktiven Mitglieder"
description="Erstellen Sie zuerst Mitglieder, um Ausweise zu generieren."
actionLabel="Mitglieder verwalten"
actionHref={`/home/${account}/members-cms`}
/>
) : (
<EmptyState
icon={<CreditCard className="h-8 w-8" />}
title="Feature in Entwicklung"
description={`Die Ausweiserstellung für ${members.length} aktive Mitglieder wird derzeit entwickelt. Diese Funktion wird in einem kommenden Update verfügbar sein.`}
actionLabel="Mitglieder verwalten"
actionHref={`/home/${account}/members-cms`}
/>
)}
</CmsPageShell>
);
}

View File

@@ -0,0 +1,103 @@
'use client';
import { useCallback, useState } from 'react';
import { useAction } from 'next-safe-action/hooks';
import { useRouter } from 'next/navigation';
import { toast } from '@kit/ui/sonner';
import { Button } from '@kit/ui/button';
import { Input } from '@kit/ui/input';
import { Label } from '@kit/ui/label';
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from '@kit/ui/dialog';
import { Plus } from 'lucide-react';
import { createDepartment } from '@kit/member-management/actions/member-actions';
interface CreateDepartmentDialogProps {
accountId: string;
}
export function CreateDepartmentDialog({ accountId }: CreateDepartmentDialogProps) {
const router = useRouter();
const [open, setOpen] = useState(false);
const [name, setName] = useState('');
const [description, setDescription] = useState('');
const { execute, isPending } = useAction(createDepartment, {
onSuccess: ({ data }) => {
if (data?.success) {
toast.success('Abteilung erstellt');
setOpen(false);
setName('');
setDescription('');
router.refresh();
}
},
onError: ({ error }) => {
toast.error(error.serverError ?? 'Fehler beim Erstellen der Abteilung');
},
});
const handleSubmit = useCallback(
(e: React.FormEvent) => {
e.preventDefault();
if (!name.trim()) return;
execute({ accountId, name: name.trim(), description: description.trim() || undefined });
},
[execute, accountId, name, description],
);
return (
<Dialog open={open} onOpenChange={setOpen}>
<DialogTrigger render={<Button size="sm" />}>
<Plus className="mr-1 h-4 w-4" />
Neue Abteilung
</DialogTrigger>
<DialogContent>
<form onSubmit={handleSubmit}>
<DialogHeader>
<DialogTitle>Neue Abteilung</DialogTitle>
<DialogDescription>
Erstellen Sie eine neue Abteilung oder Sparte für Ihren Verein.
</DialogDescription>
</DialogHeader>
<div className="mt-4 space-y-4">
<div className="space-y-2">
<Label htmlFor="dept-name">Name</Label>
<Input
id="dept-name"
value={name}
onChange={(e) => setName(e.target.value)}
placeholder="z. B. Jugendabteilung"
required
minLength={1}
maxLength={128}
/>
</div>
<div className="space-y-2">
<Label htmlFor="dept-description">Beschreibung (optional)</Label>
<Input
id="dept-description"
value={description}
onChange={(e) => setDescription(e.target.value)}
placeholder="Kurze Beschreibung"
/>
</div>
</div>
<DialogFooter className="mt-4">
<Button type="submit" disabled={isPending || !name.trim()}>
{isPending ? 'Wird erstellt…' : 'Erstellen'}
</Button>
</DialogFooter>
</form>
</DialogContent>
</Dialog>
);
}

View File

@@ -1,11 +1,11 @@
import { getSupabaseServerClient } from '@kit/supabase/server-client';
import { createMemberManagementApi } from '@kit/member-management/api';
import { Card, CardContent, CardHeader, CardTitle } from '@kit/ui/card';
import { Badge } from '@kit/ui/badge';
import { Button } from '@kit/ui/button';
import { CmsPageShell } from '~/components/cms-page-shell';
import { EmptyState } from '~/components/empty-state';
import { Users } from 'lucide-react';
import { AccountNotFound } from '~/components/account-not-found';
import { CreateDepartmentDialog } from './create-department-dialog';
interface Props {
params: Promise<{ account: string }>;
@@ -15,40 +15,45 @@ export default async function DepartmentsPage({ params }: Props) {
const { account } = await params;
const client = getSupabaseServerClient();
const { data: acct } = await client.from('accounts').select('id').eq('slug', account).single();
if (!acct) return <div>Konto nicht gefunden</div>;
if (!acct) return <AccountNotFound />;
const api = createMemberManagementApi(client);
const departments = await api.listDepartments(acct.id);
return (
<CmsPageShell account={account} title="Abteilungen" description="Sparten und Abteilungen verwalten">
{departments.length === 0 ? (
<EmptyState
icon={<Users className="h-8 w-8" />}
title="Keine Abteilungen vorhanden"
description="Erstellen Sie Ihre erste Abteilung."
actionLabel="Neue Abteilung"
/>
) : (
<div className="rounded-md border">
<table className="w-full text-sm">
<thead>
<tr className="border-b bg-muted/50">
<th className="p-3 text-left font-medium">Name</th>
<th className="p-3 text-left font-medium">Beschreibung</th>
</tr>
</thead>
<tbody>
{departments.map((dept: Record<string, unknown>) => (
<tr key={String(dept.id)} className="border-b hover:bg-muted/30">
<td className="p-3 font-medium">{String(dept.name)}</td>
<td className="p-3 text-muted-foreground">{String(dept.description ?? '—')}</td>
</tr>
))}
</tbody>
</table>
<div className="space-y-4">
<div className="flex items-center justify-end">
<CreateDepartmentDialog accountId={acct.id} />
</div>
)}
{departments.length === 0 ? (
<EmptyState
icon={<Users className="h-8 w-8" />}
title="Keine Abteilungen vorhanden"
description="Erstellen Sie Ihre erste Abteilung."
/>
) : (
<div className="rounded-md border">
<table className="w-full text-sm">
<thead>
<tr className="border-b bg-muted/50">
<th className="p-3 text-left font-medium">Name</th>
<th className="p-3 text-left font-medium">Beschreibung</th>
</tr>
</thead>
<tbody>
{departments.map((dept: Record<string, unknown>) => (
<tr key={String(dept.id)} className="border-b hover:bg-muted/30">
<td className="p-3 font-medium">{String(dept.name)}</td>
<td className="p-3 text-muted-foreground">{String(dept.description ?? '—')}</td>
</tr>
))}
</tbody>
</table>
</div>
)}
</div>
</CmsPageShell>
);
}

View File

@@ -2,6 +2,7 @@ import { getSupabaseServerClient } from '@kit/supabase/server-client';
import { createMemberManagementApi } from '@kit/member-management/api';
import { DuesCategoryManager } from '@kit/member-management/components';
import { CmsPageShell } from '~/components/cms-page-shell';
import { AccountNotFound } from '~/components/account-not-found';
interface Props {
params: Promise<{ account: string }>;
@@ -11,7 +12,7 @@ export default async function DuesPage({ params }: Props) {
const { account } = await params;
const client = getSupabaseServerClient();
const { data: acct } = await client.from('accounts').select('id').eq('slug', account).single();
if (!acct) return <div>Konto nicht gefunden</div>;
if (!acct) return <AccountNotFound />;
const api = createMemberManagementApi(client);
const categories = await api.listDuesCategories(acct.id);

View File

@@ -1,6 +1,7 @@
import { getSupabaseServerClient } from '@kit/supabase/server-client';
import { MemberImportWizard } from '@kit/member-management/components';
import { CmsPageShell } from '~/components/cms-page-shell';
import { AccountNotFound } from '~/components/account-not-found';
interface Props {
params: Promise<{ account: string }>;
@@ -10,7 +11,7 @@ export default async function MemberImportPage({ params }: Props) {
const { account } = await params;
const client = getSupabaseServerClient();
const { data: acct } = await client.from('accounts').select('id').eq('slug', account).single();
if (!acct) return <div>Konto nicht gefunden</div>;
if (!acct) return <AccountNotFound />;
return (
<CmsPageShell account={account} title="Mitglieder importieren" description="CSV-Datei importieren">

View File

@@ -2,6 +2,7 @@ import { getSupabaseServerClient } from '@kit/supabase/server-client';
import { createMemberManagementApi } from '@kit/member-management/api';
import { CreateMemberForm } from '@kit/member-management/components';
import { CmsPageShell } from '~/components/cms-page-shell';
import { AccountNotFound } from '~/components/account-not-found';
interface Props { params: Promise<{ account: string }> }
@@ -9,7 +10,7 @@ export default async function NewMemberPage({ params }: Props) {
const { account } = await params;
const client = getSupabaseServerClient();
const { data: acct } = await client.from('accounts').select('id').eq('slug', account).single();
if (!acct) return <div>Konto nicht gefunden</div>;
if (!acct) return <AccountNotFound />;
const api = createMemberManagementApi(client);
const duesCategories = await api.listDuesCategories(acct.id);

View File

@@ -2,6 +2,9 @@ import { getSupabaseServerClient } from '@kit/supabase/server-client';
import { createMemberManagementApi } from '@kit/member-management/api';
import { MembersDataTable } from '@kit/member-management/components';
import { CmsPageShell } from '~/components/cms-page-shell';
import { AccountNotFound } from '~/components/account-not-found';
const PAGE_SIZE = 25;
interface Props {
params: Promise<{ account: string }>;
@@ -13,7 +16,7 @@ export default async function MembersPage({ params, searchParams }: Props) {
const search = await searchParams;
const client = getSupabaseServerClient();
const { data: acct } = await client.from('accounts').select('id').eq('slug', account).single();
if (!acct) return <div>Konto nicht gefunden</div>;
if (!acct) return <AccountNotFound />;
const api = createMemberManagementApi(client);
const page = Number(search.page) || 1;
@@ -21,7 +24,7 @@ export default async function MembersPage({ params, searchParams }: Props) {
search: search.q as string,
status: search.status as string,
page,
pageSize: 25,
pageSize: PAGE_SIZE,
});
const duesCategories = await api.listDuesCategories(acct.id);
@@ -31,7 +34,7 @@ export default async function MembersPage({ params, searchParams }: Props) {
data={result.data}
total={result.total}
page={page}
pageSize={25}
pageSize={PAGE_SIZE}
account={account}
duesCategories={(duesCategories ?? []).map((c: Record<string, unknown>) => ({
id: String(c.id), name: String(c.name),

View File

@@ -8,6 +8,7 @@ import { createMemberManagementApi } from '@kit/member-management/api';
import { CmsPageShell } from '~/components/cms-page-shell';
import { StatsCard } from '~/components/stats-card';
import { StatsBarChart, StatsPieChart } from '~/components/stats-charts';
import { AccountNotFound } from '~/components/account-not-found';
interface PageProps {
params: Promise<{ account: string }>;
@@ -23,7 +24,7 @@ export default async function MemberStatisticsPage({ params }: PageProps) {
.eq('slug', account)
.single();
if (!acct) return <div>Konto nicht gefunden</div>;
if (!acct) return <AccountNotFound />;
const api = createMemberManagementApi(client);
const stats = await api.getMemberStatistics(acct.id);