feat: implement advanced analytics for mobile admin dashboard
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit includes:
- Backend EventAnalyticsService and Controller
- API endpoint for event analytics
- Frontend EventAnalyticsPage with custom bar charts and top contributor lists
- Analytics shortcut on the dashboard
- Feature-lock upsell UI for non-premium users
This commit is contained in:
Codex Agent
2026-01-06 16:17:23 +01:00
parent 322cafa3c2
commit ee3e9737c4
10 changed files with 425 additions and 2 deletions

View File

@@ -2856,6 +2856,35 @@ export async function removeEventMember(eventIdentifier: number | string, member
throw new Error('Failed to remove member');
}
}
export type AnalyticsTimelinePoint = {
timestamp: string;
count: number;
};
export type AnalyticsContributor = {
name: string;
count: number;
likes: number;
};
export type AnalyticsTaskStat = {
task_id: number;
task_name: string;
count: number;
};
export type EventAnalytics = {
timeline: AnalyticsTimelinePoint[];
contributors: AnalyticsContributor[];
tasks: AnalyticsTaskStat[];
};
export async function getEventAnalytics(slug: string): Promise<EventAnalytics> {
const response = await authorizedFetch(`${eventEndpoint(slug)}/analytics`);
const data = await jsonOrThrow<EventAnalytics>(response, 'Failed to load analytics');
return data;
}
type CacheEntry<T> = {
value?: T;
expiresAt: number;