Chess Rating Analytics Dashboard is a comprehensive web application designed to provide enhanced analytics and visualizations for English Chess Federation (ECF) rating data. This project allows chess players, coaches, and enthusiasts to gain deeper insights into rating performance and trends.
- Player Search: Easily search for any ECF-rated player using their name or ECF code.
- Rating Charts: Visualize rating changes over time for Standard, Rapid, and Blitz game types.
- Performance Analysis: Calculate performance ratings based on recent games, with customizable game count.
- Common Opponents: View statistics for most frequently played opponents, including win/loss/draw ratios.
- Event-based Analysis: Group games by events and view performance in each event, with expandable details.
- Time Range Filtering: Filter rating data and statistics based on different time ranges (3 months, 6 months, 1 year, 2 years, all-time).
- Responsive Design: Optimized for both desktop and mobile viewing.
- Frontend: React with Next.js 13 (App Router)
- Styling: Tailwind CSS
- UI Components: shadcn/ui
- Data Fetching: SWR
- Charts: Recharts
- Node.js (v14 or later)
- npm (v6 or later) or yarn (v1.22 or later)
- Git
-
Clone the repository: ``` git clone https://github.com/your-username/chess-rating-analytics.git ```
-
Navigate to the project directory: ``` cd chess-rating-analytics ```
-
Install dependencies: ``` npm install ``` or if you're using yarn: ``` yarn install ```
-
Set up environment variables:
- Create a
.env.localfile in the root directory - Add the following variables: ``` NEXT_PUBLIC_API_URL=https://rating.englishchess.org.uk/v2/new/api.php NEXT_PUBLIC_WEBSITE_URL=http://localhost:3000 ```
- Adjust the values as needed for your development environment
- Create a
-
(Optional) Install Husky hooks: ``` npm run prepare ``` or ``` yarn prepare ``` This sets up Git hooks to run linting and formatting before commits.
-
Build the project: ``` npm run build ``` or ``` yarn build ```
-
Start the development server: ``` npm run dev ``` or ``` yarn dev ```
-
Open http://localhost:3000 in your browser to view the application.
After completing the installation steps, you should:
- See the application running without errors in your browser
- Be able to search for chess players
- View rating charts and performance analytics
If you encounter any issues during installation or running the application, try the following:
-
Node.js version mismatch: Ensure you're using a compatible Node.js version (v14 or later). You can check your version with
node --version. -
Dependency issues: If you encounter errors related to missing dependencies, try deleting the
node_modulesfolder andpackage-lock.json(oryarn.lock), then runnpm install(oryarn install) again. -
Environment variables not loading: Double-check that your
.env.localfile is in the root directory and contains the correct variables. Restart the development server after making changes. -
Build errors: If you encounter build errors, check the console output for specific error messages. Common issues include syntax errors or missing imports in your code.
-
API connection issues: Ensure that the
NEXT_PUBLIC_API_URLin your.env.localfile is correct and that you have an active internet connection.
If you continue to experience issues, please check the project's GitHub Issues page or create a new issue with details about the problem you're encountering.
To update the project to the latest version:
-
Pull the latest changes from the repository: ``` git pull origin main ```
-
Install any new dependencies: ``` npm install ``` or ``` yarn install ```
-
Rebuild the project: ``` npm run build ``` or ``` yarn build ```
-
Restart the development server.
Remember to check the project's changelog or release notes for any breaking changes or new features that might require additional setup or code modifications.