Add admin dashboard page with usage stats, user breakdown, admin-only nav

This commit is contained in:
root
2026-03-31 15:43:58 -05:00
parent cc8bb0dd09
commit 40322e8861
4 changed files with 216 additions and 2 deletions

View File

@@ -299,4 +299,15 @@ export const fixPlaylist = (playlistId: string) =>
export const getTasteProfile = () =>
api.get<TasteProfileResponse>('/profile/taste').then((r) => r.data)
// Admin
export interface AdminStats {
users: { total: number; pro: number; free: number }
playlists: { total: number; total_tracks: number }
recommendations: { total: number; today: number; this_week: number; this_month: number; saved: number; disliked: number }
user_breakdown: { id: number; name: string; email: string; is_pro: boolean; created_at: string; recommendation_count: number }[]
}
export const getAdminStats = () =>
api.get<AdminStats>('/admin/stats').then((r) => r.data)
export default api