Skip to content

stevo-a/track-90

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

15 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Track-90 โšฝ

A modern football analytics and match tracking platform built with Next.js 15

Next.js TypeScript React Prisma Tailwind CSS

โœจ Features

๐ŸŽฏ Core Functionality

  • 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

๐Ÿ”ง Technical Features

  • 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

๐Ÿš€ Tech Stack

Frontend

State Management & Data

Authentication & Backend

Development Tools

๐Ÿ“ฆ Installation

Prerequisites

  • Node.js 20+ and pnpm
  • PostgreSQL database
  • Git

Quick Start

  1. Clone the repository

    git clone https://github.com/stevo-a/track-90.git
    cd track-90
  2. Install dependencies

    pnpm install
  3. 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"
  4. 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
  5. Start the development server

    pnpm dev
  6. Open your browser Navigate to http://localhost:3000

๐Ÿณ Docker Support

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"

๐Ÿ—„๏ธ Database Schema

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

๐Ÿ“Š API Endpoints

Match Tracking

  • GET /api/matches - List tracked matches
  • POST /api/matches - Add new match to track
  • PUT /api/matches/[id] - Update match status
  • DELETE /api/matches/[id] - Remove tracked match

Data Import

  • POST /api/import/csv - Import data via CSV upload

๐ŸŽฎ Usage

Adding Matches to Track

  1. Navigate to Match Tracker
  2. 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)
  3. Click Add Match to start tracking

Real-time Updates

  • Matches automatically refresh every 30 seconds
  • Live scores update every 60 seconds
  • Background sync maintains data consistency

Data Import

  1. Go to Players section
  2. Click Import CSV
  3. Upload your CSV file with player data
  4. Review and confirm import

๐Ÿ› ๏ธ Development

Available Scripts

# 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

Project Structure

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

๐Ÿ”’ Security Features

  • 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

๐ŸŽจ Design System

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)

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes
  4. Add tests if applicable
  5. Commit your changes: git commit -m 'Add feature'
  6. Push to the branch: git push origin feature-name
  7. Submit a pull request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • 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

๐Ÿ“ž Support

For support, please open an issue on GitHub or contact the development team.


Built with โค๏ธ for football analytics

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published