FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
bmitchinson
bmitchinsonkebede-and-ben-test
Public
Like
kebede-and-ben-test
Home
Code
4
backend
3
frontend
3
shared
1
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
Settings
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
…
README.md

Tic Tac Toe Game

A multiplayer tic-tac-toe game where two players can play against each other in real-time.

Features

  • Two-player gameplay
  • Real-time game state updates
  • Game history tracking
  • Clean, responsive UI
  • Automatic win detection

Project Structure

├── backend/
│   ├── index.ts           # Main Hono server
│   ├── database/
│   │   ├── migrations.ts  # Database schema
│   │   └── queries.ts     # Game queries
│   └── routes/
│       └── game.ts        # Game API routes
├── frontend/
│   ├── index.html         # Main page
│   ├── components/
│   │   ├── App.tsx        # Main React app
│   │   ├── GameBoard.tsx  # Game board component
│   │   └── GameStatus.tsx # Game status display
│   └── style.css          # Custom styles
└── shared/
    └── types.ts           # Shared TypeScript types

How to Play

  1. Visit the website
  2. Player X starts first
  3. Click on any empty cell to make your move
  4. Players alternate turns
  5. First to get 3 in a row (horizontal, vertical, or diagonal) wins!
  6. Click "New Game" to start over

API Endpoints

  • GET /api/game/:gameId - Get game state
  • POST /api/game - Create new game
  • PUT /api/game/:gameId/move - Make a move
  • GET /api/games - List recent games
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.