
This folder contains all backend-only code in this project. It's broken up into:
index.ts
- this is the entrypoint for this whole projectdatabase/
- this contains the code for interfacing with the app's SQLite database table
This app uses Hono has the a server application framework. You can think of Hono as a replacement for ExpressJS that works in serverless environments like Val Town or Cloudflare Workers. If you come from Python or Ruby, Hono is also a lot like Flask or Sinatra, respectively.
This app uses Val Town SQLite to manage data. Every Val Town account comes with a free SQLite database, hosted on Turso. 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 performance improvement on cold starts. It's left in so that users who fork this project will have the migration run correctly.