A Laravel + Vue.js project that simulates a mini football league with:
- Standings table (team points, goals, goal difference)
- Match results by week
- Championship prediction table (after Week 4)
- Interactive controls: Play Next Week, Play All, Reset
- Fully OOP structured backend with clean separation of models, controllers, and services
- Frontend styled with vanilla CSS + Vue (no Tailwind dependency)
- Step-by-step simulation: Play one week at a time or run the full season automatically.
- Sequential Play All: "Play All" runs weeks sequentially with visual delays (500ms between weeks).
- Dynamic league standings: Updates live as matches are played with P/W/D/L tracking.
- Realistic championship prediction: Probabilities are recalculated after Week 4.
- Reset button: Restart the entire league instantly.
- Backend: Laravel 11
- Frontend: Vue.js 3 with Vite
- Database: SQLite (lightweight, auto-configured)
- Styling: Vanilla CSS
shin-test/
├── app/
│ ├── Http/Controllers/LeagueController.php # Controller delegates to LeagueService
│ ├── Models/Team.php # Team model
│ ├── Models/MatchModel.php # Match model
│ └── Services/
│ ├── LeagueService.php # Orchestrates simulation & predictions (sequential playAll)
│ ├── MatchSimulator.php # Strength-based match simulation
│ ├── StandingsCalculator.php # Computes standings with P/W/D/L tracking
│ └── PredictionEngine.php # Probability engine
├── config/
│ └── league.php # League config (prediction threshold, score variation)
├── resources/
│ ├── js/components/LeagueApp.vue # Vue.js component with async Play All
│ ├── views/league/index.blade.php # Blade entry point
│ └── css/league.css # Styling
├── routes/web.php # Routes definition
└── tests/ # Unit & feature tests
git clone https://github.com/ShinTruong205/insider-test.git
cd insider-testcomposer installnpm installcp .env.example .env
php artisan key:generateSet database to SQLite in .env:
DB_CONNECTION=sqlite
DB_DATABASE=database/database.sqlite
Create the SQLite file:
mkdir -p database
touch database/database.sqlitephp artisan migratenpm run buildphp artisan serve
npm run devNow visit: http://127.0.0.1:8000/league 🎉
php artisan testSet a seed to make simulated results reproducible:
LEAGUE_RNG_SEED=42
Then clear config cache and run tests:
php artisan config:clear
php artisan testRun the stack:
docker-compose up --build -dRun tests inside container:
docker-compose run --rm testApp will be available at http://localhost:8080/league.
To enable deterministic runs in containers:
docker-compose exec app sh -lc 'echo "LEAGUE_RNG_SEED=42" >> .env && php artisan config:clear'
Developed by Shin — PHP/Laravel Developer