• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
alexwein

alexwein

gridEdit5x5

Remix of stevekrouse/reactHonoExample
Public
Like
1
gridEdit5x5
Home
Code
4
backend
3
frontend
6
shared
2
README.md
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
/
backend
/
database
/
README.md
Code
/
backend
/
database
/
README.md
Search
7/7/2025
Viewing readonly version of main branch: v14
View latest version
README.md

Database

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.ts

Storage Strategy

Instead of using SQLite, this app uses blob storage because:

  • Simpler for this use case (no complex relationships)
  • No need for database migrations
  • Easy JSON serialization/deserialization
  • Perfect for storing arrays of grid objects

Data Structure

The app stores a single blob with the key savedGrids containing an array of Grid objects. Each grid has:

  • id: unique identifier
  • cells: array of 16 booleans representing the 4x4 grid state
  • timestamp: when the grid was created
  • saved: whether the grid has been saved (prevents duplicate saves)

Queries

The queries file exports functions to:

  • getSavedGrids(): Retrieve all saved grids from blob storage
  • saveGrid(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.

FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.