Course lesson 57 · Wrapping Up

Completing the User Application Dashboard

One study unit · Read, recall, then practice · Original video 00:09:19

The dashboard’s placeholder statistics are replaced with account-filtered database queries exposed through existing tRPC routes. The queries calculate recently active links, click counts over several windows, and country breakdowns. The final UI cleanup supplies the frontend build variable used to construct clickable short-link URLs.

Primary source: course video 57 · Supplied English subtitles · 00:09:19.

Understand the idea

What the course does

  1. Add an active-links query filtered by time and account, then connect it to the corresponding tRPC handler.
  2. Click a real short link and verify that the dashboard shows its count and recent activity time.
  3. Add total counts for the last hour, 24/48 hours, and 30 days.
  4. Add the 30-day country grouping and replace remaining mock endpoint responses.
  5. Pass authenticated user identity from tRPC context into every new query.
  6. Set the frontend backend-host variable locally and in stage and production build settings to replace undefined displayed URLs.

Watch for

Recall before revealing

Why must analytics queries use the user ID from tRPC context?

Reveal the explanation

That context contains the authenticated identity, allowing results to be restricted to the requesting user’s account.

Try it

Define expected dashboard results for two users whose links receive different clicks in the last hour.

Check your result

Your expected counts, active links, and country breakdowns remain separated by account.

Practice prompts and answer checks are added teaching material. Answer from memory first, then compare and explain any difference.

Rewatch only what you need

Open this lesson in your original course library and seek to the times below. Videos are not hosted on this site.

Companion primary documentation: Cloudflare Workers Vitest integration. For recorded API names, commands, limits, and prices, check the version you use.

← Previous   Next →