FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
stevekrouse
stevekrousereactHonoExample
Example with client-side React & Hono server
Public
Like
5
reactHonoExample
Home
Code
4
backend
3
frontend
5
shared
1
README.md
Branches
3
Pull requests
Remixes
21
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
2/25/2025
Viewing readonly version of main branch: v162
View latest version
README.md

Database

This app uses Val Town SQLite to manage data. Every Val Town account comes with a free SQLite database, hosted on Turso. This folder is broken up into two files:

  • migrations.ts - code to set up the database tables the app needs
  • queries.ts - functions to run queries against those tables, which are imported and used in the main Hono server in /backend/index.ts

Migrations

In backend/database/migrations.ts, this app creates a new SQLite table reactHonoStarter_messages to store messages.

This "migration" runs once on every app startup because it's imported in index.ts. You can comment this line out for a slight (30ms) performance improvement on cold starts. It's left in so that users who fork this project will have the migration run correctly.

Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesCLIAI agentsCode intelligenceSlack integrationsGTMPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.