cogs-v-clippies-2
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.
main.ts
https://malcolmocean--2e3e88628e9611f0bdee0224a6c84d84.web.val.run
A game-agnostic server for physical board games where LLM-controlled pieces make moves based on photos of the game board.
- index.ts: Main Hono server with all routes
- database/: SQLite database management
- migrations.ts: Database schema setup
- queries.ts: Database query functions
- llm/: LLM integration
- openai.ts: OpenAI API calls for piece moves
- index.html: Main HTML template
- components/: React components
- App.tsx: Main app component
- HomePage.tsx: Game creation/joining
- ManagePage.tsx: Game management interface
- PlayPage.tsx: Player interface with SSE updates
- style.css: Styling
- types.ts: TypeScript interfaces
- utils.ts: Shared utility functions
- Game Management: Create games with unique 5-letter IDs
- Piece Configuration: Define piece types with descriptions
- Player Instructions: Persistent instructions for each piece
- Parallel LLM Processing: All pieces move simultaneously
- Real-time Updates: Server-sent events for live move updates
- Photo-based Turns: Multimodal LLM analysis of board state
- Game manager creates game → gets management URL
- Players join with usernames → get play URLs
- Players configure pieces and instructions
- Any player takes photo → triggers parallel LLM moves
- Results stream back in real-time via SSE
- games: Game metadata and rules
- pieces: Piece types and descriptions
- players: Player usernames per game
- player_pieces: Player-owned pieces with instructions
- moves: Historical move data (optional context)