For **Admin panel only** projects, the login is `/`, the home page is `/dashboard`, and other panel pages omit the `/admin` prefix. Components use `@/components` and `@/components/ui`. API endpoints such as `/api/admin/users/export` keep their paths. Examples below use the combined public website + admin panel layout; generated standalone guides use the app's actual paths.

Use tRPC for typed application APIs and TanStack Query to fetch, cache, and refresh data in the browser.

This guide applies to **Public website + admin panel** and **Admin panel only** projects.

The generated project already includes both providers, a working health query, and protected account/admin procedures. No extra installation is needed.

## Read data in client components

Create a Client Component that uses the existing health query:

```tsx
// src/components/api-status.tsx
"use client";

import { useQuery } from "@tanstack/react-query";

import { Skeleton } from "@/components/ui/skeleton";
import { useTRPC } from "@/trpc/client";

export function ApiStatus() {
  const trpc = useTRPC();
  const query = useQuery(trpc.health.queryOptions());

  return (
    <section aria-labelledby="api-status-title">
      <h2 id="api-status-title">API status</h2>
      {query.data ? (
        <output>{query.data.status}</output>
      ) : query.isError ? (
        <p role="alert">API status is unavailable.</p>
      ) : (
        <Skeleton className="h-5 w-16" />
      )}
    </section>
  );
}
```

Render `ApiStatus` from a page. Its heading appears immediately; only the unresolved status has a skeleton. Existing data stays visible during a background refresh.

### Included procedures

| Procedure      | Access                     | Result                    |
| -------------- | -------------------------- | ------------------------- |
| `health`       | Public                     | Status and timestamp      |
| `auth.me`      | Signed-in, non-banned user | Safe profile fields       |
| `admin.status` | Administrator              | Authorization status      |
| `admin.users`  | Administrator              | Paginated, filtered users |
| `admin.user`   | Administrator              | One user's display fields |

SuperJSON preserves dates through HTTP and server hydration, so the health timestamp remains a `Date`.


## In this section

- <span id="add-a-protected-procedure"></span><span id="file-reference"></span>[Protected procedures](/guides/data/procedures): Add validated API operations and choose an authorization level.
- <span id="read-data-on-the-server"></span><span id="prefetch-and-hydrate"></span><span id="1-create-the-query-component"></span><span id="2-prefetch-inside-a-narrow-boundary"></span>[Server rendering](/guides/data/server-rendering): Read on the server or prefetch a query for client hydration.
- <span id="refresh-data-after-changes"></span><span id="freshness-and-revalidation"></span><span id="clear-data-after-identity-changes"></span><span id="build-loading-and-error-states"></span>[Query cache and loading](/guides/data/query-cache): Refresh data, handle identity changes and scope loading states.
- <span id="reusable-admin-tables"></span><span id="reuse-the-existing-pieces"></span><span id="url-behavior"></span><span id="private-query-behavior"></span><span id="export-filtered-csv"></span>[Admin tables and CSV](/guides/data/admin-tables): Reuse table controls, URL filters, pagination and exports.

