A modern football analytics and match tracking platform built with Next.js 15
- Real-time Match Tracking - Track live football matches with automatic updates
- Live Data Integration - Scrape live match data including scores, penalties, and match events
- Player Management - Comprehensive player database with statistics
- CSV Data Import - Bulk import player and match data via CSV files
- Analytics Dashboard - Visual insights and statistics overview
- Authentication - Secure user authentication with NextAuth.js
- Real-time Updates - Background data refresh using React Query
- Responsive Design - Mobile-first approach with Tailwind CSS
- Type Safety - Full TypeScript implementation with Zod validation
- Modern UI - Beautiful interface built with Shadcn UI components
- Next.js 15 - React framework with App Router
- React 19 - Latest React with concurrent features
- TypeScript - Type-safe JavaScript
- Tailwind CSS - Utility-first CSS framework
- Shadcn UI - Beautiful, accessible components
- Radix UI - Unstyled, accessible UI primitives
- TanStack React Query - Server state management
- Zod - Schema validation and type inference
- Prisma - Next-generation ORM
- NextAuth.js - Authentication for Next.js
- Prisma Adapter - Database adapter for auth
- bcryptjs - Password hashing
- ESLint - Code linting
- Puppeteer - Web scraping capabilities
- Papa Parse - CSV parsing
- Docker - Containerization support
- Node.js 20+ and pnpm
- PostgreSQL database
- Git
-
Clone the repository
git clone https://github.com/stevo-a/track-90.git cd track-90
-
Install dependencies
pnpm install
-
Set up environment variables
cp .env.example .env.local
Configure your
.env.local
:# Database DATABASE_URL="postgresql://username:password@localhost:5432/track90" # NextAuth NEXTAUTH_URL="http://localhost:3000" NEXTAUTH_SECRET="your-secret-key" # Authentication Providers (configure as needed) GOOGLE_CLIENT_ID="your-google-client-id" GOOGLE_CLIENT_SECRET="your-google-client-secret"
-
Set up the database
# Start the database with Docker (optional) pnpm docker:up # Generate Prisma client pnpm db:generate # Run database migrations pnpm db:migrate # Or if not using migrations, push schema directly # pnpm db:push
-
Start the development server
pnpm dev
-
Open your browser Navigate to http://localhost:3000
The project includes Docker Compose configuration for local development with PostgreSQL and Redis:
# Start PostgreSQL and Redis services
pnpm docker:up
# Stop services
pnpm docker:down
# View service logs
docker-compose logs -f
Docker services:
- PostgreSQL 16 - Main database (port 5432)
- Redis 7 - Caching and session storage (port 6379)
After starting Docker services, update your .env.local
:
DATABASE_URL="postgresql://track90_user:track90_password@localhost:5432/track90"
The application uses Prisma with the following main entities:
- Users - Authentication and user management
- TrackedMatches - Real-time match tracking
- Players - Player database and statistics
- Matches - Historical match data
GET /api/matches
- List tracked matchesPOST /api/matches
- Add new match to trackPUT /api/matches/[id]
- Update match statusDELETE /api/matches/[id]
- Remove tracked match
POST /api/import/csv
- Import data via CSV upload
- Navigate to Match Tracker
- Enter match details:
- Match URL (from supported data sources)
- Match ID
- Team information
- Team IDs (for external database sync)
- Ange Match ID (temporary external connector)
- Click Add Match to start tracking
- Matches automatically refresh every 30 seconds
- Live scores update every 60 seconds
- Background sync maintains data consistency
- Go to Players section
- Click Import CSV
- Upload your CSV file with player data
- Review and confirm import
# Development
pnpm dev # Start development server with Turbopack
pnpm build # Build for production
pnpm start # Start production server
pnpm lint # Run ESLint
# Database
pnpm db:generate # Generate Prisma client
pnpm db:migrate # Run migrations (recommended)
pnpm db:push # Push schema changes (dev only)
pnpm db:studio # Open Prisma Studio
pnpm db:reset # Reset database (force reset)
pnpm db:migrate:deploy # Deploy migrations (production)
# Docker
pnpm docker:up # Start Docker containers
pnpm docker:down # Stop Docker containers
src/
โโโ app/ # Next.js App Router
โ โโโ actions/ # Server Actions
โ โโโ api/ # API Routes
โ โโโ (pages)/ # Page components
โโโ components/ # React components
โ โโโ ui/ # Base UI components
โ โโโ providers/ # Context providers
โโโ hooks/ # Custom React hooks
โโโ lib/ # Utility functions
โโโ schemas/ # Zod validation schemas
- Input Validation - Zod schemas for all user inputs
- Authentication - Secure session management
- CSRF Protection - Built-in Next.js protection
- Type Safety - Full TypeScript coverage
- Rate Limiting - API endpoint protection
Track-90 uses a modern design system built on:
- Consistent spacing using Tailwind's spacing scale
- Accessible colors with proper contrast ratios
- Responsive typography with fluid scaling
- Interactive components with proper focus states
- Dark/light mode support (configurable)
- Fork the repository
- Create a feature branch:
git checkout -b feature-name
- Make your changes
- Add tests if applicable
- Commit your changes:
git commit -m 'Add feature'
- Push to the branch:
git push origin feature-name
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Football data providers for comprehensive match information
- Shadcn for the beautiful component library
- Vercel for the amazing Next.js framework
- Prisma for the excellent database toolkit
For support, please open an issue on GitHub or contact the development team.
Built with โค๏ธ for football analytics