A Laravel-powered web application for hosting and participating in predictions for results and actions across a football season.
This is a web app which allows users to participate in football based prediction contests. Users can answer questions about various footballing entities (teams, players, managers, events etc), be awarded points, track their performance, and compete with others throughout a season.
- Laravel 12 - PHP framework
- PHP 8.4
- Inertia.js - Server-side routing with client-side rendering
- React 19 - UI framework
- TypeScript - Type-safe JavaScript
- Tailwind CSS 4 - Utility-first CSS framework
- Vite - Build tool and dev server
- Pest 4 - PHP testing framework with browser testing support
- PHPUnit - Unit testing
Run the projecct with Laravel Herd:
- PHP 8.4+
- Composer
- Node.js & npm
- Use MySQL 8.4
-
Clone the repository:
git clone <repository-url> predictions-webapp cd predictions-webapp
-
Install PHP dependencies:
composer install
-
Install node modules:
npm install
-
Set up your environment file:
cp .env.example .env php artisan key:generate
-
Configure your database connection in
.env -
Run migrations and seeders:
php artisan migrate --seed
-
Start the development server:
php artisan serve
-
In a separate terminal, start the frontend dev server:
npm run dev
Alternatively, you can run the application using Docker:
Prerequisites: Install Docker Desktop for Mac, Windows, or Linux.
-
Clone the repository:
git clone <repository-url> predictions-webapp cd predictions-webapp
-
Copy the Docker environment file:
cp .env.docker .env
-
Build and start the containers:
docker compose up -d --build
-
Generate application key:
docker compose exec app php artisan key:generate
The application will be available at http://localhost:8000 with pres-seeded data
Note: The containers automatically run migrations on startup. Seeders run if SEED_DATABASE=true in your .env file.
Docker Services:
- App: Laravel application (PHP 8.4-FPM)
- Nginx: Web server (port 8000)
- MySQL: Database (port 3306)
- Redis: Cache and queue (port 6379)
- Node: Frontend dev server with Vite (port 5173)
Useful Docker Commands:
# View logs
docker compose logs -f
# Run Artisan commands
docker compose exec app php artisan <command>
# Run tests
docker compose exec app php artisan test
# Access MySQL
docker compose exec mysql mysql -u predictions -psecret predictions
# Stop containers
docker compose down
# Stop and remove volumes
docker compose down -vThe node container is already running Vite dev server with hot module replacement. Frontend changes will automatically reflect in the browser. If you need to restart the dev server:
docker compose restart nodeRun the test suite:
php artisan testRun specific tests:
php artisan test --filter=testName