Template
Yardlog
A usage page for a data API that lists every request a workspace makes, with status, endpoint path, latency and credits charged. Developers use it to debug integrations and see where their credits go, filtering by tag, key, API or status.
API request log and usage screen · App screen: usage · Small tools and apps · full-stack app (auth + DB)
A mock-up of the screen, drawn from its layout, palette and typefaces. A build follows the full prompt below.
Start from this screenRead the build prompt
Typefaces
The catalog's own faces. A screen composed into a template is drawn in that template's typefaces.
- InterHeadings: Inter 500, 32px centred page title, -0.02em
- InterBody: Inter 400 16px / 1.5 for prose; table rows 15px / 1.5
Patterns
- persistent left sidebar with grouped nav
- centred page header with segmented view switch
- filter bar with dropdown chips
- dense log table with status dots
- credits counter in top bar
- free-plan upsell card pinned to sidebar bottom
States it is designed for
- Loading: 10 skeleton rows with shimmer
- Empty (no requests yet): illustration-free message with a code snippet for a first call and link to API keys
- Empty after filtering: 'No requests match' with Clear filters button
- Error: inline banner above table with Retry
- Streaming paused while the drawer is open
- Non-2xx rows: red dot and code, drawer shows error body
- Very long input strings truncate with ellipsis and full value in the drawer
- Credits running low: counter turns amber and sidebar card copy changes to a top-up nudge
Who it is for
- backend developers integrating an API
- technical founders monitoring spend
- support engineers debugging customer calls
Layout
- Top bar: home/workspace switcher and search icon on the left; remaining-credits counter on the right
- Left sidebar (220px): Overview, a 'Products' group label chip with product links, a 'Workspace' group with API keys, Usage (active, filled pill), Team; bottom: free-plan card with Upgrade button, Help, Documentation, account row
- Main: centred title and subtitle, a segmented control (All / Logs), then a filter bar (search input left, Tags / API key / API / Status dropdowns right)
- Log table: Request method, Status (dot + code), Path (monospace), Input, Latency, Credits, Time with timezone, row action icon; table card lifts with a soft shadow
- Below 1024px sidebar becomes a drawer; below 640px the table turns into stacked cards showing method, path, status and time
Palette
Neutral, technical, trustworthy. A clean log viewer that stays out of the way and lets status colours and paths carry the information.
- canvas
#f7f7f7 - surface
#ffffff - text
#1a1a1a - muted
#656565 - border
#e6e6e6 - input-border
#8c8c8c - primary
#1f6fe0 - on-primary
#ffffff - success
#1a7f45 - error
#c2352b - focus
#1f6fe0
Every checked pair, measured again
| Sample | Where | Ratio | Needs |
|---|---|---|---|
| Aa | body text | 17.40:1 | 4.5:1 |
| Aa | muted header on canvas | 5.44:1 | 4.5:1 |
| Aa | upgrade button label | 4.76:1 | 4.5:1 |
| Aa | success status text | 5.04:1 | 4.5:1 |
| Aa | error status text | 5.47:1 | 4.5:1 |
| input border | 3.36:1 | 3:1 | |
| focus ring on canvas | 4.45:1 | 3:1 |
As vibld’s tokens
The palette on the fifteen colour tokens vibld styles a project with, each text colour on the fill it is read on.
- background
- card
- muted
- primary
- secondary
- accent
- destructive
Type scale
- Display
- Inter 500, 32px centred page title, -0.02em
- Body
- Inter 400 16px / 1.5 for prose; table rows 15px / 1.5
Paths and timestamps in JetBrains Mono 14px. Group labels are small uppercase chips (12px, 0.06em tracking).
Spacing and imagery
Dense table, airy header; 4px base; sidebar 220px; table max width 960px centred; rows 44px; radius 10px on table card and filter buttons, 6px on sidebar pills; shadow 0 4px 16px rgba(0,0,0,0.06) on the table card only.
No imagery. Small lucide line icons beside nav items and filter chips; status shown as 8px dots paired with the numeric code.
Components
- WorkspaceSwitcher
- CreditsCounter
- Sidebar with group label chips
- PlanCard with Upgrade button
- SegmentedControl (All / Logs)
- LogSearchInput
- FilterDropdown x4 with multi-select and counts
- LogTable with sticky header
- StatusDot + code
- LatencyCell
- RowDetailsDrawer
- Infinite scroll loader
Interactions
- Clicking a row or its gear icon opens a right drawer with request/response headers, body preview and a copy-as-cURL button
- Filters apply instantly and sync to the URL; an active filter shows a count badge and a clear (x) control
- Search is debounced 300ms and matches the input field
- New requests stream in at the top with a 'N new requests' pill instead of shifting rows under the pointer
- Keyboard: J/K move between rows, Enter opens the drawer, Escape closes it
Data
Workspace{id, name, plan (free|pro|scale), credits_remaining}ApiKey{id, workspace_id, label, prefix, created_at, revoked_at}RequestLog{id, workspace_id, api_key_id, method (GET|POST|BATCH), path, status_code, input_preview, latency_ms, credits, tags[], created_at}Tag{id, workspace_id, name}
Guardrails
Experience
- Always show the timezone in the time column header and let users switch it
- Keep status as dot plus numeric code so it survives colour blindness
- Never reflow rows while the user is reading; queue new rows behind a pill
- Filters must be combinable and shareable via URL
- Show credits charged per row so spend is traceable to a request
- Keep the upgrade card small and dismissible for the session
Accessibility
- Table uses real table semantics with column headers; the row action button is labelled 'View request details'
- Status dots are aria-hidden; the code and word ('200 OK') are read
- Segmented control is a radiogroup with arrow-key support
- Drawer traps focus, returns focus to the originating row on close
- Live 'new requests' pill uses aria-live='polite' and never steals focus
- Focus ring 2px #1f6fe0 visible on rows, chips and sidebar links
Security
- RLS on request_logs, api_keys and tags scoped to workspace membership
- Log previews redact headers such as authorization and any field matching secret patterns before storage
- Show only the API key prefix and label, never the full key
- Limit retention (e.g. 30 days on free plan) and purge with a scheduled job
- Rate-limit the search endpoint and cap page size server-side
Build prompt
The baseline every prompt in the catalog assumes, then this design’s own ten sections, from goal to guardrails.
The baseline
### How to use these prompts Paste an entry's build prompt into your coding agent as the first message. Each prompt names its own stack, tokens and acceptance criteria; the rules below apply to all of them and can be prepended once per project. ### Engineering baseline - TypeScript strict mode, no `any`, small typed components, feature folders, and one source of truth for design tokens (CSS variables consumed by Tailwind). - Validate every input with a shared zod schema on the client and again on the server or edge function. Never trust client-side checks alone. - Show loading, empty and error states for every async view. Surface errors in plain language with a retry, and log details to the console in development only. - Keep secrets out of the bundle. Only publishable keys (for example a Supabase anon key) belong in client code; service-role keys, API keys and webhooks live in server or edge-function environment variables. ### Data and auth baseline (full-stack entries) - Enable Row Level Security on every table before inserting data. Default-deny, then add owner-scoped policies (`auth.uid() = user_id`) and explicit role checks for admin views. - Store roles in a separate table checked by a security-definer function, never in a user-editable profile field. - Upload files to private storage buckets with size and MIME limits, and serve them through signed URLs. - Rate-limit public endpoints (forms, auth, AI calls) and add a honeypot field or captcha to anonymous forms. - Take payments through a hosted checkout and verify webhooks by signature. Never handle raw card data. ### Accessibility and UX baseline - Target WCAG 2.2 AA: 4.5:1 contrast for normal text and 3:1 for large text, input borders, focus rings and meaningful icons or chart lines. Every palette in this catalog lists its verified pairs; re-check with a contrast tool after any colour change. - Keep body text at 16px or larger with 1.5 line height, nothing below 12px, no light weights under 24px, and uppercase only for short labels. - Give every interactive element a visible focus ring, full keyboard support, semantic landmarks, labelled form fields, and alt text on meaningful images. - Respect `prefers-reduced-motion` for every animation. Give drag-and-drop and carousels keyboard and button alternatives. - Build mobile-first and test at 375px, 768px and 1280px. ### Content guardrails - Use original copy, fictional sample data and placeholder or licensed imagery. Do not reuse another product's name, logo, screenshots or marketing text. - Label demo testimonials and metrics as samples. Collect the minimum personal data the feature needs. ### SaaS screen baseline - Design every screen for its full set of states: first-run empty, loading skeleton, partial data, error with retry, permission-denied, and success feedback. Each entry lists the states its screen needs. - Keep destructive actions (delete, revoke, downgrade, remove member) behind a confirmation that names the object, and prefer undo over a second dialog where the action is reversible. - Enforce authorisation on the server for every action a screen exposes. Hiding a button is not access control; check the role again in the API or RLS policy. - Never show secrets (API keys, tokens) in full after creation. Show them once, then mask them, and offer rotate and revoke. - Keep the app shell (navigation, workspace switcher, account menu) consistent across screens, and preserve filters, sort and scroll position when the user navigates back.
### Goal Build **Yardlog**, the Usage screen of a developer data-API console: a filterable, live-updating log of every request a workspace makes, with status, path, latency and credits, plus a remaining-credits counter and an upgrade nudge for free-plan users. ### Stack React 18 + TypeScript + Vite, Tailwind CSS, shadcn/ui (Radix), lucide-react. TanStack Table for the log grid and TanStack Query (infinite queries) for paging, zod for filter params, date-fns (with timezone formatting) for timestamps. Supabase Auth, Postgres and a realtime channel for new log rows. ### Pages & layout 1. **Shell**: slim top bar (workspace switcher + search icon left, credits counter right). Left sidebar with Overview, a 'Products' group, a 'Workspace' group (API keys, Usage, Team); bottom-pinned free-plan card with Upgrade, then Help, Documentation and the account row. 2. **Usage page**: centred H1 'Usage' and one-line subtitle, segmented control (All / Logs), filter bar (search input; Tags, API key, API, Status dropdowns), then the log table in a raised white card. 3. **Request drawer** (right, 480px): method, path, status, latency, credits, tags, redacted request and response previews, copy-as-cURL. 4. Responsive: sidebar becomes a drawer below 1024px; rows become stacked cards below 640px. ### Design system - Colors: `--canvas: #f7f7f7`, `--surface: #ffffff`, `--text: #1a1a1a`, `--muted: #656565`, `--border: #e6e6e6`, `--input-border: #8c8c8c`, `--primary: #1f6fe0`, `--on-primary: #ffffff`, `--success: #1a7f45`, `--error: #c2352b`, `--focus: #1f6fe0`. - Fonts: Inter 400/500 (UI 16px/1.5, table 15px, H1 32px); JetBrains Mono 14px for paths and times. - Spacing: 4px scale; rows 44px; filter bar gap 12px; card padding 0 with 16px cell padding. - Radius: 10px table card and dropdown buttons, 6px sidebar pills, 999px status dots. - Shadows: table card 0 4px 16px rgba(0,0,0,.06); everything else flat. - Motion: 120ms hover tint; drawer slides in 200ms ease-out; new rows fade in 150ms. ### Components & interactions Sidebar (active item as filled #ebebeb pill), PlanCard, CreditsCounter, SegmentedControl, SearchInput (debounced), FilterDropdown (checkbox list, count badge, clear), LogTable (sticky header, J/K navigation, row click), StatusCell (dot + code), MonoCell, TimeCell (timezone in header), RequestDrawer, NewRowsPill (appears when realtime rows arrive), InfiniteLoader, EmptyState and ErrorBanner. ### Data & state Tables `workspaces`, `api_keys(id, workspace_id, label, prefix, revoked_at)`, `request_logs(id, workspace_id, api_key_id, method, path, status_code, input_preview, latency_ms, credits, tags text[], created_at)` indexed on (workspace_id, created_at desc). Keyset pagination by created_at + id, 50 rows per page. Filters and search live in URL params parsed by zod. Realtime inserts go to a buffer and render only when the user clicks the pill. Seed 300 mock rows over two days across four paths, including 4xx and 5xx rows and one batch call with 4s latency. ### Accessibility Real table markup with captions and scoped headers; status announced as text; segmented control as radiogroup; drawer as a modal dialog with focus trap and restore; the new-rows pill is a polite live region. Keyboard shortcuts are listed in a help popover and never override typing in inputs. Verified contrast: body text: #1a1a1a on #ffffff = 17.4:1; muted header on canvas: #656565 on #f7f7f7 = 5.44:1; upgrade button label: #ffffff on #1f6fe0 = 4.76:1; success status text: #1a7f45 on #ffffff = 5.04:1; error status text: #c2352b on #ffffff = 5.47:1; input border: #8c8c8c on #ffffff = 3.36:1; focus ring on canvas: #1f6fe0 on #f7f7f7 = 4.45:1. ### Security RLS: members of a workspace may select its `request_logs`, `api_keys` and `tags`; no client inserts into `request_logs` (written by the API gateway with the service role). Redact authorization headers and secret-looking values before storage. Show only key prefixes. Enforce retention by plan with a scheduled purge. Cap page size and rate-limit search per user. ### Performance & SEO Virtualise the table beyond 200 rows. Lazy-load the drawer. Index filter columns. Console routes are noindex; no public SEO surface. ### Guardrails - Invented endpoints, tags and data only. - Do not hide failed requests or round latency to look better. - Keep the upgrade card informative, not blocking. - Acceptance criteria: (1) filters combine and persist in the URL; (2) new rows never shift content without consent; (3) drawer shows redacted previews; (4) empty, filtered-empty, loading and error states all render; (5) every row reachable and openable by keyboard.