A Laravel application for tracking board game events, players, and games played during those events.
GameTracker is a web application built with Laravel and Livewire that helps organizers manage gaming events. The application allows tracking of:
- Events: Gaming sessions with start and end times
- Players: Users who participate in events (with optional custom nicknames)
- Games: Board games played during events, including duration tracking
- Game Ownership: Which players brought which games to events
- User management with role-based permissions (Admin and User roles)
- Event management (create, update, delete, start, end)
- Player participation tracking (join, leave)
- Game tracking with duration metrics
- Admin dashboard with settings, analytics, notifications, and logs
- User settings for profile, password, and appearance
- Responsive UI built with Livewire and Flux components
- Comprehensive test suite using Pest PHP
- Clone the repository
- Install dependencies:
composer install npm install
- Copy the environment file:
cp .env.example .env
- Generate application key:
php artisan key:generate
- Configure your database in the
.envfile (SQLite is the default)# For SQLite (default) DB_CONNECTION=sqlite # Touch the database file if it doesn't exist touch database/database.sqlite # For MySQL DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=gametracker DB_USERNAME=root DB_PASSWORD= - Run migrations:
php artisan migrate
- Seed the database with initial data:
php artisan db:seed
- Start the development server:
composer dev
To quickly set up demo data for testing and development purposes, run:
php artisan demo:setupThis command will:
- Create demo users (admin and regular users)
- Create demo events (past, current, and upcoming)
- Create demo games for each event
- Create demo players (users participating in events)
- Set up relationships between games and players
After running the command, you can log in with the following credentials:
- Admin: admin@example.com / password
- User: user@example.com / password
--force: Force the operation to run even in production environment
The command includes several safety features:
- Confirmation prompt before proceeding
- Production environment check with --force option requirement
- Database transaction to ensure data integrity
- Comprehensive error handling with troubleshooting tips
- PHP 8.4 or higher
- Composer
- Node.js and npm
- A database (SQLite, MySQL, PostgreSQL)
-
Models: Located in
app/Models/User.php: User accounts with role managementEvent.php: Gaming events with start/end timesPlayer.php: Users participating in eventsGame.php: Games played during events
-
Controllers: Located in
app/Http/Controllers/EventController.php: Handles event viewing- Admin controllers in
app/Http/Controllers/Admin/AdminController.php: Admin dashboard featuresUserController.php: User managementEventController.php: Event management
-
Livewire Components: Located in
app/Livewire/- Event management components
- Player management components
- Game management components
- Settings components
-
Routes: Defined in
routes/web.php- Public routes
- Authenticated user routes
- Admin-only routes
The project uses Pest PHP for testing:
# Run all tests
./vendor/bin/pest
# Run a specific test file
./vendor/bin/pest tests/Feature/PlayerTest.php
# Run tests with coverage report
./vendor/bin/pest --coverageThe project follows Laravel's coding standards. You can use Laravel Pint to format your code:
./vendor/bin/pintThis project is licensed under the MIT License.