Frontend

React-based frontend for the Football Live Scores app.

Components

App.tsx

  • Main application component
  • Handles state management for matches
  • Auto-refresh functionality for live matches
  • Server-side data injection support

MatchCard.tsx

  • Individual match display component
  • Shows team names, scores, status, and venue
  • Different styling for live, scheduled, and finished matches

LoadingSpinner.tsx

  • Reusable loading component
  • Used during initial load and refresh operations

Features

  • Real-time Updates: Auto-refreshes every 30 seconds when live matches are present
  • Responsive Design: Works on desktop and mobile devices
  • Server-side Data: Initial data is injected server-side for faster loading
  • Live Indicators: Visual indicators for live matches with pulsing animations
  • Competition Grouping: Matches are grouped by league/competition
  • Manual Refresh: Users can manually refresh match data

Styling

  • TailwindCSS for utility-first styling
  • Custom CSS for animations and transitions
  • Responsive design with mobile-first approach
  • Live match indicators with pulse animations

State Management

  • React hooks (useState, useEffect)
  • Auto-refresh logic for live matches
  • Error handling and loading states
  • Server-side data injection for initial load