Skip to main content

Overview

The Dashboard is the central hub for auction organizers after logging in and completing onboarding. It provides an overview of active auctions, analytics, quick actions, and access to management features. The dashboard uses a card-based grid layout for organizing information and actions.

Dashboard Route

The dashboard is accessible at /dashboard and requires authentication and completed onboarding:
src/routes/_with-sidebar/dashboard.tsx:4
import DashboardMainPannel from '@/features/dashboard/Components/DashboardMainPannel'
import { createFileRoute } from '@tanstack/react-router'

export const Route = createFileRoute('/_with-sidebar/dashboard')({
  component: RouteComponent,
})

function RouteComponent() {
  return (
    <div>
      <DashboardMainPannel />
    </div>
  )
}
The dashboard route is part of the _with-sidebar layout group, meaning it includes the main navigation sidebar for easy access to other platform features.

Dashboard Layout

The dashboard consists of two main components:

Main Panel

Primary content area displaying cards in a responsive grid layout for metrics, auctions, and status information.

Action Panel

Secondary panel for quick actions like creating auctions, managing settings, and accessing reports.

Main Panel Component

The main panel uses a grid-based card container system:
src/features/dashboard/Components/DashboardMainPannel.tsx:5
import CardContainer from '../../../shared/ui/CardContainer/CardContainer'

export default function DashboardMainPannel() {
  return (
    <section className={styles.container}>
      {/* Grid of dashboard cards */}
      <CardContainer>
        <h1>Grid test</h1>
      </CardContainer>
      
      <CardContainer>
        <h1>Grid test</h1>
      </CardContainer>
      
      <CardContainer>
        <h1>Grid test</h1>
      </CardContainer>
      
      {/* Additional cards... */}
    </section>
  )
}
The dashboard cards are currently placeholders. The full implementation will include specific widgets for auctions, analytics, and actions.

Dashboard Architecture

The dashboard follows a component-based architecture:
src/features/dashboard/
├── Components/
│   ├── DashboardMainPannel.tsx    # Main grid layout
│   └── DashboardActionPannel.tsx  # Action sidebar
└── styles/
    └── DashboardMainPannel.module.css

Planned Dashboard Features

Based on the structure and common auction platform patterns, the dashboard should include:
Display count and status of currently running auctions:
{
  total: number,
  live: number,
  scheduled: number,
  ending_soon: number
}
Financial metrics and performance:
{
  total_revenue: number,
  this_month: number,
  last_month: number,
  growth_percentage: number
}
User engagement metrics:
{
  total_bidders: number,
  active_bidders: number,
  new_this_week: number
}
Other key metrics:
{
  total_items: number,
  sold_items: number,
  pending_items: number,
  average_bid: number
}

Dashboard Card Components

Implementation pattern for dashboard cards:
import CardContainer from '@shared/ui/CardContainer/CardContainer'
import Typography from '@shared/ui/Typography/Typography'

interface StatsCardProps {
  title: string;
  value: number | string;
  subtitle?: string;
  trend?: {
    value: number;
    direction: 'up' | 'down';
  };
  icon?: React.ReactNode;
}

export function StatsCard({ title, value, subtitle, trend, icon }: StatsCardProps) {
  return (
    <CardContainer>
      <div className={styles.statsCard}>
        <div className={styles.header}>
          <Typography as="h3" size="text-sm" weight="medium">
            {title}
          </Typography>
          {icon && <div className={styles.icon}>{icon}</div>}
        </div>
        
        <Typography as="p" size="text-3xl" weight="bold">
          {value}
        </Typography>
        
        {subtitle && (
          <Typography as="p" size="text-xs" weight="light">
            {subtitle}
          </Typography>
        )}
        
        {trend && (
          <div className={styles.trend}>
            <span className={trend.direction === 'up' ? styles.up : styles.down}>
              {trend.direction === 'up' ? '↑' : '↓'} {trend.value}%
            </span>
          </div>
        )}
      </div>
    </CardContainer>
  )
}

Grid Layout System

The dashboard uses CSS Grid for responsive layout:
DashboardMainPannel.module.css
.container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
}

@media (min-width: 1200px) {
  .container {
    grid-template-columns: repeat(3, 1fr);
  }
}

Dashboard Data Flow

1

Component Mount

Dashboard component mounts and triggers data fetching
2

API Calls

Fetch dashboard data from multiple endpoints:
  • /dashboard/stats - Overall statistics
  • /auctions/active - Active auctions list
  • /dashboard/activity - Recent activity
3

State Management

Store dashboard data in component state or global store (Zustand)
4

Render Cards

Map data to card components in the grid layout
5

Real-time Updates

Optionally implement WebSocket or polling for live updates

State Management Pattern

Recommended approach using Zustand:
dashboard.store.ts
import { create } from 'zustand'

interface DashboardState {
  stats: {
    active_auctions: number;
    total_bids: number;
    revenue: number;
  };
  auctions: Auction[];
  activity: ActivityItem[];
  loading: boolean;
  error: string | null;
  
  fetchDashboardData: () => Promise<void>;
  refreshAuctions: () => Promise<void>;
}

export const useDashboardStore = create<DashboardState>((set) => ({
  stats: { active_auctions: 0, total_bids: 0, revenue: 0 },
  auctions: [],
  activity: [],
  loading: false,
  error: null,
  
  fetchDashboardData: async () => {
    set({ loading: true });
    try {
      const [stats, auctions, activity] = await Promise.all([
        apiGET('/dashboard/stats'),
        apiGET('/auctions/active'),
        apiGET('/dashboard/activity')
      ]);
      
      set({ stats, auctions, activity, loading: false });
    } catch (error) {
      set({ error: error.message, loading: false });
    }
  },
  
  refreshAuctions: async () => {
    const auctions = await apiGET('/auctions/active');
    set({ auctions });
  }
}));

Action Panel

The action panel (currently a placeholder) should provide quick access to common tasks:
DashboardActionPannel (Proposed)
import { Button } from '@shared/ui/Button/Button'
import CreateAuctionButton from '@/widgets/Create-auction/CreateAuctionButton'

export default function DashboardActionPannel() {
  return (
    <aside className={styles.actionPanel}>
      <h2>Quick Actions</h2>
      
      <CreateAuctionButton />
      
      <Button variant="secondary" fullWidth>
        View All Auctions
      </Button>
      
      <Button variant="secondary" fullWidth>
        Manage Bidders
      </Button>
      
      <Button variant="secondary" fullWidth>
        View Reports
      </Button>
      
      <hr />
      
      <h3>Recent Alerts</h3>
      <ul className={styles.alerts}>
        {/* Alert items */}
      </ul>
    </aside>
  )
}

Loading States

Implement skeleton loaders for better UX:
import CardContainer from '@shared/ui/CardContainer/CardContainer'

export function DashboardSkeleton() {
  return (
    <section className={styles.container}>
      {Array.from({ length: 6 }).map((_, i) => (
        <CardContainer key={i}>
          <div className={styles.skeleton}>
            <div className={styles.skeletonHeader} />
            <div className={styles.skeletonBody} />
            <div className={styles.skeletonFooter} />
          </div>
        </CardContainer>
      ))}
    </section>
  )
}

Best Practices

  • Lazy load dashboard cards as user scrolls
  • Implement pagination for auction lists
  • Cache dashboard data with appropriate TTL
  • Use React.memo for expensive card components
  • Use WebSocket for live auction updates
  • Implement optimistic UI updates for better UX
  • Debounce rapid state changes
  • Show visual indicators for data refresh
  • Use semantic HTML for card structure
  • Ensure proper heading hierarchy (h1 → h2 → h3)
  • Add ARIA labels for icon-only buttons
  • Support keyboard navigation between cards
  • Test grid layout on various screen sizes
  • Use CSS Grid with auto-fill for flexibility
  • Provide mobile-optimized card layouts
  • Consider drawer navigation for action panel on mobile

API Endpoints

/dashboard/stats
GET
Fetch overall dashboard statisticsResponse:
{
  "active_auctions": 12,
  "total_bids": 348,
  "total_revenue": 125000,
  "active_bidders": 89,
  "new_users_this_week": 15
}
/auctions/active
GET
Get list of active auctions for the current organizerQuery Parameters:
  • limit: number (default: 10)
  • offset: number (default: 0)
  • status: ‘live’ | ‘scheduled’ | ‘ended’
Response:
{
  "auctions": [
    {
      "id": 1,
      "title": "Vintage Watch Auction",
      "status": "live",
      "start_time": "2026-03-07T10:00:00Z",
      "end_time": "2026-03-14T10:00:00Z",
      "current_bids": 23,
      "highest_bid": 5000
    }
  ],
  "total": 12
}
/dashboard/activity
GET
Get recent activity feed for the dashboardResponse:
{
  "activities": [
    {
      "id": 1,
      "type": "bid",
      "message": "New bid placed on Vintage Watch Auction",
      "timestamp": "2026-03-07T14:30:00Z",
      "auction_id": 1
    },
    {
      "id": 2,
      "type": "auction_started",
      "message": "Art Collection Auction is now live",
      "timestamp": "2026-03-07T14:00:00Z",
      "auction_id": 5
    }
  ]
}

Build docs developers (and LLMs) love