extremely claude-assisted go game based on atproto! working on cleaning up and giving a more unique design, still has a bit of a slop vibe to it.
Something went wrong. Try again.
TypeScript
123456789101112131415161718192021222324252627282930313233343536373839import { Kysely } from 'kysely';import { D1Dialect } from 'kysely-d1';import type { App } from '@sveltejs/kit';
export interface GameRecord { id: string; // AT URI (game_at_uri) rkey: string; // Record key (TID) creator_did: string; // DID of whoever created the game (owns the ATProto record) player_one: string | null; player_two: string | null; board_size: number; status: 'waiting' | 'active' | 'completed'; action_count: number; last_action_type: string | null; winner: string | null; handicap: number; created_at: string; updated_at: string;}
export interface Database { games: GameRecord;}
export function getDb(platform: App.Platform | undefined): Kysely<Database> { // Production: Use Cloudflare D1 if (platform?.env?.DB) { return new Kysely<Database>({ dialect: new D1Dialect({ database: platform.env.DB }), }); }
// No D1 configured throw new Error( 'Database not configured. In Cloudflare, set up D1 and bind it as "DB". ' + 'For local development, use `wrangler pages dev` with D1 bindings.' );}