- Overview
- Key Features
- Tech Stack
- Installation
- Configuration
- API Documentation
- Database Schema
- Development
- Testing
- Contributing
- License
ScoutMe Backend is a powerful football analytics API built with Laravel, designed to provide comprehensive data and insights for football scouts, analysts, and enthusiasts. The platform offers detailed player statistics, match analytics, competition tracking, and subscription management capabilities.
- π Detailed Player Analytics - Access comprehensive player statistics, performance metrics, and historical data
- β½ Match Statistics - Real-time match data with detailed team and player performance analysis
- π Competition Tracking - Monitor multiple competitions, seasons, and tournaments
- π Advanced Search - Powerful search functionality with filters for players, teams, and matches
- π₯ Scout Management - Dedicated tools for football scouts to track and manage players
- π³ Subscription System - Flexible subscription plans using Laravel Cashier
- π Secure Authentication - Token-based authentication with Laravel Sanctum
- π± RESTful API - Clean, versioned API architecture
- Comprehensive player profiles with personal and performance data
- Junior player tracking and development monitoring
- Player position management with primary and secondary positions
- Advanced filtering by position, nationality, team, and name
- Full-text search capabilities using Laravel Scout
- Detailed match statistics and team performance metrics
- Player-specific match statistics (attackers, goalkeepers, field players)
- Match lineup and formation tracking
- Historical match data and seasonal comparisons
- Multi-competition support with season tracking
- Club and national team management
- League standings and competition structures
- Country and nationality tracking
- Scout profiles with customizable notes
- Player watchlists and tracking
- Subscription-based access control
- Dashboard with personalized insights
- Multiple subscription tiers
- Payment processing with Laravel Cashier
- Subscription status tracking
- Access level management
- Laravel 12.x - Modern PHP framework with elegant syntax
- PHP 8.2+ - Latest PHP features and performance improvements
- Laravel Sanctum - API token authentication
- Laravel Scout - Full-text search
- Laravel Cashier - Subscription billing
- Spatie Laravel Permission - Role and permission management
- Spatie Query Builder - Elegant API filtering and sorting
- Laravel Telescope - Debug assistant
- Laravel Pint - Code style fixer
- Laravel Sail - Docker development environment
- PHPUnit - Testing framework
- MySQL - Primary database
- Redis - Caching and queue management (optional)
Before you begin, ensure you have the following installed:
- PHP >= 8.2
- Composer
- MySQL >= 5.7 or MariaDB >= 10.3
- Node.js & NPM (for asset compilation)
-
Clone the repository
git clone https://github.com/MohanedM7md/ScoutMe-BE.git cd ScoutMe-BE -
Install PHP dependencies
composer install
-
Install Node dependencies
npm install
-
Configure environment
cp .env.example .env php artisan key:generate
-
Configure database
Edit your
.envfile with your database credentials:DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=scoutme DB_USERNAME=your_username DB_PASSWORD=your_password
-
Run migrations
php artisan migrate
-
Seed the database (optional)
php artisan db:seed
-
Create storage symlink
php artisan storage:link
-
Start the development server
php artisan serve
The API will be available at http://localhost:8000
For a containerized development environment:
# Install dependencies
composer install
# Start Sail
./vendor/bin/sail up -d
# Run migrations
./vendor/bin/sail artisan migrate
# Access the application at http://localhostKey environment variables to configure:
# Application
APP_NAME=ScoutMe
APP_ENV=local
APP_DEBUG=true
APP_URL=http://localhost
# Database
DB_CONNECTION=mysql
DB_DATABASE=scoutme
DB_USERNAME=root
DB_PASSWORD=
# Session & Cache
SESSION_DRIVER=database
CACHE_STORE=database
QUEUE_CONNECTION=database
# Mail Configuration
MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
# Payment (Laravel Cashier)
STRIPE_KEY=your_stripe_key
STRIPE_SECRET=your_stripe_secretRun the following to set up proper permissions:
chmod -R 775 storage bootstrap/cachehttp://localhost:8000/api/v1
The API uses Laravel Sanctum for authentication. Include the bearer token in the Authorization header:
Authorization: Bearer your-token-hereThe full, interactive API documentation is available via Postman and includes:
- All endpoints with request/response examples
- Authentication setup
- Query parameters and filters
- Error responses
π Postman Documentation:
https://documenter.getpostman.com/view/41344496/2sB3BKFofM
POST /api/v1/auth/register # Register new user
POST /api/v1/auth/login # Login
POST /api/v1/auth/logout # Logout
GET /api/v1/auth/user # Get authenticated userGET /api/v1/players # List all players
GET /api/v1/players/{id} # Get player details
GET /api/v1/players/search # Search players
GET /api/v1/players/stats/{id} # Get player seasonal statsGET /api/v1/matches # List all matches
GET /api/v1/matches/{id} # Get match details
GET /api/v1/matches/{id}/stats # Get match statistics
GET /api/v1/matches/{id}/players # Get match players by team
GET /api/v1/matches/{id}/player-stats # Get player stats by IDGET /api/v1/competitions # List competitions
GET /api/v1/competitions/{id} # Get competition detailsGET /api/v1/teams # List teams
GET /api/v1/teams/{id} # Get team detailsGET /api/v1/subscriptions # List subscription plans
POST /api/v1/subscriptions/subscribe # Subscribe to a planGET /api/v1/scout/profile # Get scout profile
PUT /api/v1/scout/profile # Update scout profileGET /api/v1/search # Global search endpointGET /api/v1/dashboard # Get dashboard dataGET /api/v1/admin/* # Admin endpoints (role-based access)Most list endpoints support the following query parameters:
filter[column]- Filter by column valuesort- Sort by column (prefix with-for descending)include- Include relationshipspage[number]- Page number for paginationpage[size]- Items per page
Example:
GET /api/v1/players?filter[position]=Forward&sort=-name&include=team,nationality&page[number]=1&page[size]=20- Personal information (name, nationality, birth date, height, weight)
- Position and team associations
- Player images
- Match details (date, time, competition)
- Team matchups
- Final scores and match status
- Team-level statistics
- Player-level statistics
- Position-specific statistics (attackers, goalkeepers)
- Club information
- Team rosters
- Competition participation
- Competition details
- Seasons
- Competition structure
- Subscription plans
- User subscriptions
- Payment tracking
- Scout profiles
- Notes and observations
- User associations
# Standard development server
php artisan serve
# Or use the combined development command
composer devThe composer dev command runs:
- Laravel development server
- Queue listener
- Vite development server
Format code using Laravel Pint:
./vendor/bin/pint# Create a new migration
php artisan make:migration create_table_name
# Run migrations
php artisan migrate
# Rollback migrations
php artisan migrate:rollback
# Fresh migration (drops all tables)
php artisan migrate:fresh
# Fresh migration with seeding
php artisan migrate:fresh --seed# Clear application cache
php artisan cache:clear
# Clear configuration cache
php artisan config:clear
# Clear route cache
php artisan route:clear
# List all routes
php artisan route:list
# Run the queue worker
php artisan queue:work
# Monitor logs in real-time
php artisan pailThe project uses PHPUnit for testing.
# Run all tests
php artisan test
# Or use composer script
composer test
# Run specific test file
php artisan test tests/Feature/PlayerTest.php
# Run with coverage
php artisan test --coverageTests are located in the tests/ directory:
tests/Feature/- Feature tests (API endpoints, integration)tests/Unit/- Unit tests (models, services, helpers)
We welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Make your changes
- Run tests
composer test - Format your code
./vendor/bin/pint
- Commit your changes
git commit -m 'Add some amazing feature' - Push to the branch
git push origin feature/amazing-feature
- Open a Pull Request