This app uses Val Town Blob Storage to manage data. Every Val Town account comes with free blob storage for simple key-value data persistence. This folder contains:
queries.ts - functions to read and write grid data to blob storage, which are imported and used in the main Hono server in /backend/index.tsInstead of using SQLite, this app uses blob storage because:
The app stores a single blob with the key savedGrids containing an array of Grid objects. Each grid has:
id: unique identifiercells: array of 16 booleans representing the 4x4 grid statetimestamp: when the grid was createdsaved: whether the grid has been saved (prevents duplicate saves)The queries file exports functions to:
getSavedGrids(): Retrieve all saved grids from blob storagesaveGrid(grid): Add a new grid to the saved collection (with duplicate prevention)The functions handle cases where the blob doesn't exist yet and provide proper error handling for duplicate saves.