A simple web-based game built with Laravel 11, PostgreSQL, and Redis.
- PHP 8.2
- Laravel 11
- PostgreSQL 15
- Redis
- Docker & Docker Compose
- Tailwind CSS
- Docker
- Docker Compose
- Git
- Clone the repository:
git clone https://github.com/animan01/lucky-game-laravel.git
cd lucky-game-laravel- Copy the environment file:
cp .env.example .env- Start Docker containers:
docker-compose up -d- Install PHP dependencies:
docker-compose exec app composer install- Generate application key:
docker-compose exec app php artisan key:generate- Run database migrations:
docker-compose exec app php artisan migrate- Visit the application:
http://localhost:8000
- Register with username and phone number
- Get a unique link valid for 7 days
- Play the game by clicking "I'm Feeling Lucky"
- Win or lose based on random number:
- Even number = Win
- Odd number = Lose
- Win amount calculation:
- Number > 900: 70% of the number
- Number > 600: 50% of the number
- Number > 300: 30% of the number
- Number ≤ 300: 10% of the number
docker-compose psdocker-compose logs -f [service_name]docker-compose downdocker-compose up -d --builddocker-compose exec app php artisan migrate:freshdocker-compose exec app php artisan cache:cleardocker-compose exec app php artisan config:clear-
If the site is not accessible:
- Check if all containers are running:
docker-compose ps - Check nginx logs:
docker-compose logs nginx - Ensure port 8000 is not in use
- Check if all containers are running:
-
Database connection issues:
- Verify database credentials in .env
- Check if PostgreSQL container is running
- Check database logs:
docker-compose logs database
-
Permission issues:
- Run:
docker-compose exec app chown -R www-data:www-data storage - Run:
docker-compose exec app chmod -R 775 storage
- Run:
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
The GPL-3.0 license. Please see License File for more information.
