Skip to content
Building Frontend Dashboards logo

Building Frontend Dashboards

Build responsive React dashboards with TypeScript, shadcn/ui, TanStack Query, and Supabase for event-studio. Use when user mentions dashboard, metrics, KPI cards, data tables, charts, analytics, admin panel, Recharts, event management UI, booking interface, financial overview, or asks to create p...

mattnigh/skills_collection0installs24stars

SKILL.md

Full skill instructions

Building Frontend Dashboards

Expert in building React dashboards for the event-studio project.

Project Context

Tech Stack: React 18 + TypeScript + Vite + shadcn/​ui + TanStack Query + Supabase

Structure:

src/
├── pages/​Dashboard*.tsx       # Route components
├── features/[feature]/​hooks/  # Custom hooks (useEvents, etc.)
├── components/​ui/             # shadcn/​ui components
└── integrations/​supabase/     # Supabase client & types

Key Patterns:

  • TanStack Query for all data fetching
  • Supabase for backend (use supabase client from @/​integrations/​supabase/​client)
  • shadcn/​ui components (import from @/​components/​ui/)
  • Zustand for state (if needed)
  • React Hook Form + Zod for forms

Standard Dashboard Workflow

Copy this checklist and track your progress:

Dashboard Implementation:
- [ ] 1. Identify data requirements (tables, metrics)
- [ ] 2. Create custom hook in features/[feature]/​hooks/
- [ ] 3. Build page in src/​pages/​Dashboard*.tsx
- [ ] 4. Add metric cards and main content
- [ ] 5. Add route in App.tsx
- [ ] 6. Test loading/​error states

Step 1: Identify Requirements

Ask user to clarify:

  • What data to display?
  • What metrics/​KPIs?
  • What user actions?
  • Filters needed?

Step 2: Create Custom Hook

Pattern: Create in src/​features/[feature]/​hooks/​use*.ts

import { useQuery } from '@tanstack/​react-query';
import { supabase } from '@/​integrations/​supabase/​client';

export function useDashboardMetrics() {
  return useQuery({
    queryKey: ['dashboard-metrics'],
    queryFn: async () => {
      const { data, error } = await supabase
        .from('events')
        .select('*, bookings(count)');
      if (error) throw error;
      return data;
    },
  });
}

For more patterns: See resources/​query-patterns.ts

Step 3: Build Page Structure

Template:

import Sidebar from '@/​components/​Sidebar';
import { Card } from '@/​components/​ui/​card';

const DashboardNew = () => {
  const { data, isLoading, error } = useYourHook();

  if (isLoading) return <PageLoader />;
  if (error) return <ErrorAlert error={error} />;

  return (
    <div className="flex min-h-screen bg-gray-50">
      <Sidebar />
      <main className="flex-1 p-8">
        <h1 className="text-3xl font-bold mb-6">Dashboard Title</​h1>

        {/​* Metrics Grid */​}
        <div className="grid grid-cols-1 md:grid-cols-4 gap-6 mb-8">
          {/​* MetricCard components */​}
        </​div>

        {/​* Main Content */​}
        <Card className="p-6">
          {/​* DataTable or Charts */​}
        </​Card>
      </​main>
    </​div>
  );
};

export default DashboardNew;

Step 4: Use Reusable Components

Import from resources:

import {
  MetricCard,
  DataTable,
  StatusBadge,
  EmptyState,
  ErrorAlert
} from '../​skills/​frontend-dashboard/​resources/​component-patterns';

See complete examples: resources/​component-patterns.tsx

Quick Reference

Supabase Queries

// Simple query
const { data } = await supabase.from('events').select('*');

// With joins
const { data } = await supabase
  .from('events')
  .select('*, bookings(*), organizer:users(full_name)');

// With filters
const { data } = await supabase
  .from('events')
  .select('*')
  .eq('status', 'active')
  .gte('start_date', date);

More patterns: See resources/​supabase-patterns.ts

Common Components

// Metric Card
<MetricCard
  title="Total Revenue"
  value="$125,000"
  change={12.5}
  icon={<DollarSign />}
/>

// Data Table
<DataTable
  data={events}
  columns={[
    { key: 'title', label: 'Event' },
    { key: 'status', label: 'Status', render: (v) => <StatusBadge status={v} /> }
  ]}
  onEdit={(row) => handleEdit(row)}
/>

// Empty State
<EmptyState
  title="No events yet"
  description="Get started by creating your first event"
  action={{ label: "Create Event", onClick: () => navigate('/​new') }}
/>

Layouts

7 layout patterns in resources/​layout-examples.tsx:

  • StandardDashboardLayout (sidebar + content)
  • DashboardWithActionsBar (search + filters)
  • TabbedDashboard (multi-tab analytics)
  • SplitViewDashboard (list + detail)
  • GridViewDashboard (grid/​list toggle)
  • ResponsiveDashboard (mobile-first)
  • StickyHeaderDashboard (fixed header)

Examples

Example 1: Events Dashboard

User: "Create a dashboard page showing all events with metrics"

Your Process:

  1. Create hook (src/​features/​events/​hooks/​useEventsDashboard.ts):
export function useEventsDashboard() {
  return useQuery({
    queryKey: ['events-dashboard'],
    queryFn: async () => {
      const { data, error } = await supabase
        .from('events')
        .select('*, bookings(count, total_amount.sum())')
        .order('created_at', { ascending: false });
      if (error) throw error;
      return data;
    },
  });
}
  1. Create page (src/​pages/​DashboardEvents.tsx) with:

    • Header with "Create Event" button
    • 4 metric cards (total events, active events, revenue, bookings)
    • Search bar and filters
    • DataTable with events
    • Actions: edit, delete, view details
  2. Add route in App.tsx:

<Route path="/​dashboard/​events" element={<DashboardEvents />} />

Example 2: Analytics Dashboard with Charts

User: "Add a revenue analytics page with charts"

Your Response:

  1. Create useRevenueAnalytics hook fetching bookings with date grouping
  2. Build page with:
    • Revenue metrics cards
    • Line chart (Recharts) showing revenue over time
    • Pie chart for revenue by category
  3. Use Recharts components from recharts package
  4. Add date range filter

Example 3: Bookings Management

User: "Create a bookings dashboard with search and filters"

Your Implementation:

  • Search by attendee name
  • Filter by status (pending, confirmed, cancelled)
  • DataTable with booking details
  • Actions: view ticket, refund, send email
  • Export to CSV button

Best Practices

Always:

  • Show loading states (skeleton or spinner)
  • Handle errors with user-friendly messages
  • Make responsive (use md:, lg: prefixes)
  • Use TypeScript strictly (no any)
  • Validate permissions before showing data

Performance:

  • Implement pagination for large datasets
  • Use proper TanStack Query caching (queryKey)
  • Optimize with React.memo if needed

UX:

  • Provide empty states
  • Use toast notifications (from sonner)
  • Make actions reversible
  • Show success feedback

Resources

Complete examples and patterns:

  • resources/​component-patterns.tsx - Reusable components (MetricCard, DataTable, etc.)
  • resources/​query-patterns.ts - TanStack Query hooks and patterns
  • resources/​supabase-patterns.ts - Supabase query examples
  • resources/​layout-examples.tsx - 7 dashboard layout templates

Troubleshooting

Query not refetching: Use invalidateQueries in mutation onSuccess

RLS blocking queries: Check Supabase RLS policies allow the operation

TypeScript errors: Regenerate types with npx supabase gen types typescript

Not responsive: Use Tailwind responsive prefixes, test in dev tools

More skills from mattnigh

spring-framework-patterns logo
mattnigh/skills_collection

spring-framework-patterns

Comprehensive Spring Framework and Spring Boot best practices including dependency injection patterns, bean lifecycle and scopes, REST API development, Spring Data JPA, service layer design, Spring Security, testing strategies, caching, AOP, async processing, error handling, and common anti-patte...

24 0
View

TypeScript厳格モードによる型安全性設計を専門とするスキル。 📖 参照書籍: - 『Effective TypeScript』(Dan Vanderkam): 型設計 📚 リソース参照: - `resources/Level1_basics.md`: レベル1の基礎ガイド - `resources/Level2_intermediate.md`: レベル2の実務ガイド - `resources/Level3_advanced.md`: レベル3の応用ガイド - `resources/Level4_expert.md`: レベル4の専門ガイド - `resources/di...

24 0
View
deploying-cloud-k8s logo
mattnigh/skills_collection

deploying-cloud-k8s

Deploys applications to cloud Kubernetes (AKS/GKE/DOKS) with CI/CD pipelines. Use when deploying to production, setting up GitHub Actions, troubleshooting deployments. Covers build-time vs runtime vars, architecture matching, and battle-tested debugging.

24 0
View
moai-alfred-agent-guide logo
mattnigh/skills_collection

moai-alfred-agent-guide

19-agent team structure, decision trees for agent selection, Haiku vs Sonnet model selection, and agent collaboration principles. Use when deciding which sub-agent to invoke, understanding team responsibilities, or learning multi-agent orchestration.

24 0
View
mermaid-diagram-generator logo
mattnigh/skills_collection

mermaid-diagram-generator

Converts architecture descriptions, module specs, or workflow docs into Mermaid diagrams. Use when visualizing brick module relationships, workflows (DDD, investigation), or system architecture. Supports: flowcharts, sequence diagrams, class diagrams, state machines, entity relationship diagrams,...

24 0
View
pre-flight-check logo
mattnigh/skills_collection

pre-flight-check

INVOKE FIRST before any code work. Validates git workflow (branch, issue, worklog) and checks approach. Use at START of every task and END before completing. Prevents skipped steps.

24 0
View
browser-dev-tools logo
mattnigh/skills_collection

browser-dev-tools

This skill should be used when working with browser-rendered artifacts (i.e. Bun, React/React Native) to proactively validate that development work on localhost is being built appropriately and to support debugging browser-rendered content. Use this skill after making frontend changes to verify t...

24 0
View
lead-dev logo
mattnigh/skills_collection

lead-dev

Lead Développeur - Coordination technique opérationnelle, code review, mentoring et livraison. Pair de web-dev-process au niveau OPÉRATIONS.

24 0
View
worker-monitor logo
mattnigh/skills_collection

worker-monitor

Monitor Docker workers, RQ queue health, and auto-scale workers (max 4). Use when: checking job progress, monitoring queue depth, scaling workers up/down, diagnosing slow processing, or waiting for jobs to complete. Referenced by data-quality skill during reprocessing.

24 0
View
quality-advisor logo
mattnigh/skills_collection

quality-advisor

Proactive quality guidance system that monitors artifact creation and provides real-time feedback on documentation quality

24 0
View
bump-version logo
mattnigh/skills_collection

bump-version

This skill should be used when the user wants to bump the version number in the workspace. It updates versions across all pyproject.toml files (root, tde, and tda packages) and the CHANGELOG.md to keep them synchronized.

24 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View