# In-App Dashboards

> Real-time dashboards for your customers. Creators want their views, sellers their sales, players their stats. Build those pages from the events you already collect.

A use case for [Real-Time Metrics](https://aggregations.io/real-time-metrics.md).

## The problem

A customer-facing dashboard needs fast answers for every customer at once. That usually means rollup jobs, a cache and a warehouse table to maintain, with costs that grow with high-cardinality IDs like creator or account.

Aggregations.io maintains those rollups as events arrive. Your app requests one customer's results in a single call.

## Example: a video platform

One filter covers every creator:

- **Filter:** `@.eventName == 'videoView'`
- **Groupings:** `@.creator.id`, `@.geo.region`
- **Interval:** 1 hour
- **Aggregations:** watch time (sum of `@.watchSeconds`), unique viewers (distinct count of `@.viewerId`)

There's no limit on the number of creators in a grouping. For monthly unique viewers, roll the same filter up to a month at query time; distinct counts merge correctly.

## Serving each customer's numbers

Save the question as a [Data Endpoint](https://aggregations.io/real-time-metrics/data-endpoints.md) with `@.creator.id` set to query time. Each page load passes one creator and gets back only their rows:

```bash
curl -X POST https://app.aggregations.io/api/v1/data/{id} \
  -H "x-api-token: $READ_KEY" \
  -d '{"groupingFilters": {"@.creator.id": ["cr_2841"]}}'
```

Typical pages: views and watch time over the last 30 days, a time series chart, top regions or top videos (sorted and limited in the Endpoint).

For options an Endpoint doesn't cover, such as a different percentile or a custom time range, use the [Metrics API](https://aggregations.io/real-time-metrics/api.md) with the same filter.
