Turn your git commits into a slot machine game!
Git Slot Machine is a fun CLI tool that analyzes your commit hashes and rewards you based on patterns found in the first 7 characters. Every commit you make is a pull of the lever — will you hit the jackpot?
🎰 Live Site: gitslotmachine.com 📦 CLI Package: npm | GitHub
- Automated gameplay via post-commit hook
- Global leaderboards with daily and all-time rankings
- Win streak tracking with detailed history
- Pattern-based payouts (poker-style hands in hex)
- Real-time stats and analytics
- Repository badges showing last play results
- Winner sharing with Open Graph images
- Token-based authentication (GitHub username)
- Retro terminal aesthetic with theme picker
- Laravel 13 - Modern PHP framework
- Livewire 3 - Reactive components
- PostgreSQL - Database
- Tailwind CSS 4 - Styling
- Laravel Sanctum - API authentication
- Spatie Browsershot - OG image generation
- Pest 4 - Testing framework
- PHP 8.4+
- Composer
- Node.js 20.19+ or 22.12+ (Laravel Cloud runs Node 24)
- PostgreSQL
- Chrome/Chromium (for OG image generation)
# Clone the repository
git clone https://github.com/than/gitslotmachine.com.git
cd gitslotmachine.com
# Install PHP dependencies
composer install
# Install Node dependencies
pnpm install
# Copy environment file
cp .env.example .env
# Generate application key
php artisan key:generate
# Configure database in .env
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=gitslotmachine
DB_USERNAME=your_username
DB_PASSWORD=your_password
# Run migrations
php artisan migrate
# Build assets
pnpm run build
# Start development server
php artisan serve# Run both PHP server and Vite dev server
composer run dev
# Or run separately:
php artisan serve
pnpm run devCreate Token
POST /api/auth/token
Content-Type: application/json
{
"github_username": "your-username"
}Get User Info
GET /api/auth/user
Authorization: Bearer {token}Delete Token
DELETE /api/auth/token
Authorization: Bearer {token}Submit Play
POST /api/play
Authorization: Bearer {token}
Content-Type: application/json
{
"commit_hash": "a1b2c3d",
"commit_full_hash": "a1b2c3d4e5f6...",
"pattern_type": "TWO_PAIR",
"pattern_name": "TWO PAIR",
"payout": 50,
"wager": 10,
"balance_before": 100,
"balance_after": 140,
"repo_url": "https://github.com/user/repo",
"github_username": "your-username",
"repo_owner": "user",
"repo_name": "repo"
}Response:
{
"success": true,
"data": {
"balance": 140,
"payout": 50,
"pattern_name": "TWO PAIR",
"share_url": "https://gitslotmachine.com/winner/{uuid}"
}
}Get Balance
GET /api/balance
Authorization: Bearer {token}- id
- github_username (unique)
- balance
- total_commits
- total_winnings
- biggest_win
- biggest_win_pattern
- biggest_win_hash
- current_streak
- longest_streak
- longest_streak_ended_at
- timestamps- id
- uuid (unique, for sharing)
- user_id
- commit_hash
- commit_full_hash
- pattern_type
- pattern_name
- payout
- wager
- balance_before
- balance_after
- repo_url
- repo_owner
- repo_name
- timestampsGit Slot Machine supports private repositories with automatic privacy protection!
- Private repositories are automatically detected via the GitHub API
- Privacy protection ensures repo names are never displayed publicly
- Repository names display as
*******/*******on leaderboards and winner pages - Stats still count - your plays, balance, and wins are tracked normally
- Badges still work - your repo badge will show win/loss but mask the repo name
Privacy mode is automatic - no configuration needed! The CLI checks if your repository is private via the GitHub API when you make a commit.
If you want to make a private repo's name visible:
- Change the repository to public on GitHub
- Next commit will automatically display the repo name
If you want to hide a public repo's name:
- Change the repository to private on GitHub
- Next commit will automatically mask the repo name
Note: Changing privacy settings only affects future commits. Previous commits retain their original privacy state.
Show off your latest commit results with dynamic repository badges!
https://gitslotmachine.com/badge/{owner}/{repo}.svg
Markdown:
[](https://gitslotmachine.com)HTML:
<a href="https://gitslotmachine.com">
<img src="https://gitslotmachine.com/badge/your-username/your-repo.svg" alt="Git Slot Machine">
</a>- Green badge - Your last commit was a winner! Shows pattern name, payout, and commit hash
- Red badge - Last commit didn't win. Shows payout and commit hash
- Gray badge - Repository hasn't played yet. Time to install the CLI!
- Auto-updates - Badge refreshes every 5 minutes with latest play results
Perfect for README files, profile pages, or anywhere you want to show your Git Slot Machine stats!
Every winning commit gets a shareable URL with Open Graph images for social media!
When you win (any payout > 0), the CLI displays a share URL:
Share your win:
https://gitslotmachine.com/winner/{uuid}
- Beautiful OG Images - Auto-generated 1200x630 terminal-themed images
- Social Media Ready - Works on Twitter, Facebook, LinkedIn, Discord, Slack
- Permanent Links - Winner pages never expire
- Stats Display - Shows pattern, hash, payout, repository, and username
Visit any winner URL to see:
- Terminal-themed winner card with full stats
- Theme picker (hover over terminal header)
- Install instructions for new users
- Auto-generated Open Graph image for social sharing
Try sharing your next big win! 🎰
Patterns are detected in the first 7 characters of a git commit hash using poker-style logic:
| Pattern | Example | Payout | Probability |
|---|---|---|---|
| JACKPOT | aaaaaaa |
10,000 | 1 in 16.7M |
| HEXTET | aaaaaa1 |
5,000 | 1 in 160K |
| LUCKY SEVEN | 1234567 |
2,500 | 1 in 2.5M |
| FULLEST HOUSE | aaaabbb |
2,000 | 1 in 32K |
| FIVE OF A KIND | aaaaa12 |
1,000 | 1 in 8K |
| BIG STRAIGHT | 012345a |
500 | 1 in 280K |
| FOUR OF A KIND | aaaa123 |
400 | 1 in 800 |
| ALL LETTERS | abcdefa |
300 | 1 in 960 |
| STRAIGHT | 01234ab |
200 | 1 in 9K |
| DOUBLE TRIPLE | aaabbb1 |
150 | 1 in 2K |
| FULL HOUSE | aaaabb1 |
100 | 1 in 1K |
| THREE PAIR | aabbcc1 |
150 | 1 in 1.6K |
| THREE OF A KIND | aaa1234 |
50 | 1 in 15 |
| TWO PAIR | aabb1cd |
50 | 1 in 45 |
| ALL NUMBERS | 1230984 |
10 | 1 in 27 |
| NO WIN | abcd123 |
0 | ~35% |
Note: "Pairs" require consecutive identical characters (e.g., aa, bb).
See full pattern logic in app/Services/PatternDetector.php.
# Run all tests
php artisan test
# Run specific test file
php artisan test tests/Feature/ApiPlayTest.php
# Run with coverage
php artisan test --coverage# Backfill streak data for existing plays
php artisan streaks:backfillThis project is designed to deploy on Laravel Cloud.
Required production environment variables:
APP_NAME="Git Slot Machine"
APP_ENV=production
APP_KEY=base64:...
APP_DEBUG=false
APP_URL=https://gitslotmachine.com
DB_CONNECTION=pgsql
DB_HOST=...
DB_PORT=5432
DB_DATABASE=...
DB_USERNAME=...
DB_PASSWORD=...
SESSION_DRIVER=database
CACHE_STORE=database
QUEUE_CONNECTION=database- The Cloud runtime is pinned to Node 24 / PHP 8.5 / Octane off.
- The build command installs pnpm via
npm install -g [email protected]and must not usecorepack enable(corepack is no longer on the Cloud build image's PATH). - The build command lives in the Cloud environment settings (the source of truth, not the repo).
- Keep that pnpm version in sync with
package.json's"packageManager"field.
Pushes to main branch trigger automatic deployment on Laravel Cloud.
Contributions welcome! Please open an issue or PR.
Enjoying Git Slot Machine? Consider sponsoring development:
MIT License - see LICENSE file for details.
Built by Than Tibbetts