A React-based web application for viewing MLB game data, schedules, and detailed boxscores using the official MLB Stats API.
- Game Schedules: View MLB games for any date
- Live Scores: Real-time game scores and line scores
- Team Information: Detailed team data and statistics
- Boxscores: Complete game boxscores with player statistics
- Date Validation: Smart date handling with future date prevention
- Responsive Design: Mobile-friendly interface
- React - Frontend framework
- React Router - Client-side routing
- Axios - HTTP client for API requests
- MLB Stats API - Official MLB data source
- Custom Hooks - Reusable data fetching logic
- Node.js (version 14 or higher)
- npm or yarn package manager
- Clone the repository
- Install dependencies:
npm install
- Start the development server:
npm start
- Open http://localhost:3000 to view the application
Runs the app in development mode with hot reloading.
Launches the test runner in interactive watch mode.
Builds the app for production deployment.
The application uses the official MLB Stats API (https://statsapi.mlb.com/api/v1
) to fetch:
- Game schedules
- Live scores and line scores
- Team information
- Detailed boxscores
- Custom Hooks: Reusable API data fetching logic
- Date Validation: Robust date handling and validation
- Route Configuration: Centralized routing setup
- Performance Monitoring: Web vitals tracking
The application is configured for deployment with the basename /boxscores
and can be easily deployed to any static hosting service.
This project follows modern React best practices including:
- Custom hooks for data management
- Configuration-driven architecture
- Error handling and loading states
- Clean, maintainable code structure