• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
stevekrouse

stevekrouse

blackjack-test

Public
Like
blackjack-test
Home
Code
5
backend
3
frontend
4
shared
1
README.md
H
index.ts
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
index.ts
https://stevekrouse--18b7c2a655f211f0b92ff69ea79377d9.web.val.run
README.md

Multiplayer Blackjack App

A multiplayer blackjack game where players can join rooms and play together against the dealer.

Features

  • Multiplayer gameplay - Multiple players in the same room
  • Room-based system - Join or create game rooms
  • Real-time updates via polling (no websockets needed)
  • Turn-based play - Players take turns in order
  • Automatic dealer play when all players are done
  • SQLite backend for game state persistence
  • Clean, responsive interface

How to Play

  1. Enter a room name to join or create a game
  2. Wait for other players to join
  3. When it's your turn, choose Hit or Stand
  4. Try to get as close to 21 as possible without going over
  5. After all players finish, dealer plays automatically
  6. Winners are determined and a new round can begin

Technical Architecture

  • Backend: Hono API with SQLite database
  • Frontend: Vanilla JavaScript with polling for updates
  • State Management: All game state stored in SQLite
  • Real-time: 2-second polling for game updates

File Structure

├── backend/
│   ├── database/
│   │   ├── migrations.ts    # Database schema
│   │   └── queries.ts       # Database operations
│   ├── routes/
│   │   ├── game.ts         # Game API endpoints
│   │   └── static.ts       # Static file serving
│   └── index.ts            # Main Hono app
├── frontend/
│   ├── components/
│   │   └── Game.js         # Game component logic
│   ├── index.html          # Main interface
│   ├── script.js           # Frontend entry point
│   └── style.css           # Styling
├── shared/
│   └── types.ts            # Shared type definitions
└── README.md
HTTP
  • index.ts
    stevekrouse--18…d9.web.val.run
Code
backendfrontendsharedREADME.md
H
index.ts
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.