Skip to content

feat: Add comprehensive analytics API with OpenTelemetry observability #1639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
✨ Regenerate frontend client for analytics endpoints
  • Loading branch information
alvidofaisal committed May 24, 2025
commit 0544978180143f94d047a72be2e2f82b83e374dd
28 changes: 28 additions & 0 deletions frontend/src/client/sdk.gen.ts
Original file line number Diff line number Diff line change
@@ -4,6 +4,8 @@ import type { CancelablePromise } from "./core/CancelablePromise"
import { OpenAPI } from "./core/OpenAPI"
import { request as __request } from "./core/request"
import type {
AnalyticsGetUserSummaryResponse,
AnalyticsGetItemTrendsResponse,
ItemsReadItemsData,
ItemsReadItemsResponse,
ItemsCreateItemData,
@@ -48,6 +50,32 @@ import type {
UtilsHealthCheckResponse,
} from "./types.gen"

export class AnalyticsService {
/**
* Get User Summary
* @returns UserAnalyticsSummary Successful Response
* @throws ApiError
*/
public static getUserSummary(): CancelablePromise<AnalyticsGetUserSummaryResponse> {
return __request(OpenAPI, {
method: "GET",
url: "/api/v1/analytics/user-summary",
})
}

/**
* Get Item Trends
* @returns ItemAnalyticsTrends Successful Response
* @throws ApiError
*/
public static getItemTrends(): CancelablePromise<AnalyticsGetItemTrendsResponse> {
return __request(OpenAPI, {
method: "GET",
url: "/api/v1/analytics/item-trends",
})
}
}

export class ItemsService {
/**
* Read Items
30 changes: 30 additions & 0 deletions frontend/src/client/types.gen.ts
Original file line number Diff line number Diff line change
@@ -13,11 +13,21 @@ export type HTTPValidationError = {
detail?: Array<ValidationError>
}

export type ItemAnalyticsTrends = {
total_items: number
creation_trends: Array<ItemCreationTrend>
}

export type ItemCreate = {
title: string
description?: string | null
}

export type ItemCreationTrend = {
creation_date: string
count: number
}

export type ItemPublic = {
title: string
description?: string | null
@@ -61,6 +71,17 @@ export type UpdatePassword = {
new_password: string
}

export type UserActivity = {
active_users: number
inactive_users: number
}

export type UserAnalyticsSummary = {
total_users: number
signup_trends: Array<UserSignupTrend>
activity_summary: UserActivity
}

export type UserCreate = {
email: string
is_active?: boolean
@@ -83,6 +104,11 @@ export type UserRegister = {
full_name?: string | null
}

export type UserSignupTrend = {
signup_date: string
count: number
}

export type UsersPublic = {
data: Array<UserPublic>
count: number
@@ -107,6 +133,10 @@ export type ValidationError = {
type: string
}

export type AnalyticsGetUserSummaryResponse = UserAnalyticsSummary

export type AnalyticsGetItemTrendsResponse = ItemAnalyticsTrends

export type ItemsReadItemsData = {
limit?: number
skip?: number