Skip to content

reiddwilson/TechStack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tech Stack 🃏

Solo blackjack, played with programming packages instead of cards.

Tech Stack is a casino-style card game built for a conference, where every card is a development tool — Laravel, Vue, Docker, Redis, and friends. Get as close to 21 points as you can without going over, beat the AI dealer, and climb the leaderboard.

Built with Laravel 12, Inertia.js, Vue 3 + TypeScript, Tailwind CSS 4, and Vite 7, backed by SQLite.


🎮 How to play

  • Goal (per round): get closer to 21 than the AI without busting (going over 21).
  • Turn flow: you act first — Hit to draw a card or Stand to end your turn — then the AI plays automatically. Higher score ≤ 21 wins the round.
  • The run: your first loss ends the run. The number of rounds you survive is your score.
  • Scoring: winning adds your hand's points to your total, then multiplies by 1.5. Losing halves your total. Submit your name to the leaderboard at the end of a round.

Special mechanics

Mechanic Effect
Full-Stack Jackpot Hold at least one Front-end, Back-end, Database, and DevOps card → auto-win the round, even below 21.
Laravel Cloud Wild Card Instantly sets your hand to 21 (auto-stand). Only one exists in the deck.
Synergy Bonuses (+2) Certain pairs (e.g. Vue + Vite, Laravel + MySQL) add +2 without raising your bust threshold.

The AI dealer

  1. Draws until its total reaches 16.
  2. Stands immediately if it completes a Full-Stack Jackpot.
  3. Busts on anything over 21, same as you.

See DOCUMENTATION.md for the full card list, point values, API endpoints, and architecture notes.


🚀 Quick start with Docker (recommended)

The app ships as a single self-contained image — SQLite plus database-backed sessions/cache/queue mean no external services to wire up. Great for spinning the game up on any machine for a demo or test.

Requirements: Docker.

# Build and run with Docker Compose (persists leaderboard scores in a volume)
docker compose up --build

# …or with plain Docker
docker build -t techstack .
docker run --rm -p 8080:8080 techstack

Then open http://localhost:8080.

On first boot the container automatically generates an app key, creates the SQLite database, runs migrations, and seeds the card deck — so it's ready to play immediately.

What's in the image

  • Multi-stage build: a Node stage compiles the Vue/Vite front-end assets; a PHP 8.4 stage installs Composer dependencies (--no-dev) and serves the app.
  • Production-flavored defaults: APP_ENV=production, APP_DEBUG=false, and cached config/routes/views for a faster boot.
  • Self-seeding: the card deck is seeded on first boot only, so a persisted database isn't duplicated on restart.

Notes for basic production / sharing

  • Persisting data: the Compose file mounts a volume at /var/www/html/database so leaderboard scores survive restarts. Remove that volume for a clean deck every run.
  • Multi-architecture: to build an image that runs on both Intel and Apple-silicon/ARM machines:
    docker buildx build --platform linux/amd64,linux/arm64 -t techstack .
  • Serving model: the container uses php artisan serve, which is single-process — perfect for a demo or conference kiosk, but not high-concurrency load. For heavier production traffic, put the app behind php-fpm + nginx.

🛠️ Normal (non-Docker) setup

For local development with hot-reloading front-end assets.

Requirements: PHP 8.2+, Composer, Node.js 18+ (22 recommended), and npm.

# 1. Install dependencies
composer install
npm install

# 2. Set up the environment
cp .env.example .env
php artisan key:generate

# 3. Create and seed the database (SQLite)
touch database/database.sqlite
php artisan migrate --seed

# 4a. Run everything at once (server + queue + logs + Vite) — recommended
composer dev

# 4b. …or run the pieces separately in two terminals
php artisan serve     # backend at http://localhost:8000
npm run dev           # Vite dev server with hot reload

Open http://localhost:8000.

Heads up: php artisan migrate --seed runs the default DatabaseSeeder, which also creates a Faker-based test user. That's fine in local dev (Faker is installed). The Docker image seeds only the card deck, since it omits dev dependencies.

Common commands

# Front-end
npm run dev       # Vite dev server (hot reload)
npm run build     # Production asset build
npm run lint      # ESLint

# Back-end
php artisan serve     # Laravel dev server
php artisan migrate   # Run migrations
php artisan db:seed   # Seed the database
php artisan test      # Run the test suite

🗺️ Routes

Method Path Description
GET / Title screen
GET /game/leaderboard Top scores
POST /game/start Start a new game/round
PATCH /game/{game}/hit Draw a card
PATCH /game/{game}/stand End your turn
POST /game/submit-score Submit a leaderboard entry

Built with ❤️ using Laravel and Vue.js.

About

Laracon game

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors