https://t.me/+DOylgFv1jyJlNzM0
Description
There is no admin endpoint to observe the health and growth of the platform. A GET /admin/metrics endpoint returning aggregate stats (total streams, breakdown by status, total volume streamed) gives operators a quick pulse check and feeds future dashboards or alerting. This is a read-only DB aggregation query making it a well-scoped entry point for new contributors.
Acceptance Criteria
Files to Touch
app/api/routes/v1/admin/metrics.ts — new route handler
app/api/routes/v1/admin/index.ts — register the route
app/repositories/stream.repository.ts — add getMetrics() aggregation query
tests/integration/admin/metrics.test.ts — new test file
https://t.me/+DOylgFv1jyJlNzM0
Description
There is no admin endpoint to observe the health and growth of the platform. A
GET /admin/metricsendpoint returning aggregate stats (total streams, breakdown by status, total volume streamed) gives operators a quick pulse check and feeds future dashboards or alerting. This is a read-only DB aggregation query making it a well-scoped entry point for new contributors.Acceptance Criteria
GET /api/v1/admin/metricsis implemented and registered in the admin router{ "total_streams": 0, "active_streams": 0, "paused_streams": 0, "completed_streams": 0, "cancelled_streams": 0, "total_volume_streamed": "0" }total_volume_streamedis the sum ofwithdrawn_amountacross all streams (as a string to avoid JS number precision loss)Files to Touch
app/api/routes/v1/admin/metrics.ts— new route handlerapp/api/routes/v1/admin/index.ts— register the routeapp/repositories/stream.repository.ts— addgetMetrics()aggregation querytests/integration/admin/metrics.test.ts— new test file