• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
abrinz

abrinz

agent-chat

Remix of std/reactHonoStarter
Unlisted
Like
1
agent-chat
Home
Code
3
backend
1
frontend
5
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
2
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
/
README.md
Code
/
README.md
Search
6/10/2025
Viewing readonly version of main branch: v16
View latest version
README.md

React Hono Starter with AI Chat

This app is a starter template for client-side React and server-side Hono, now featuring an AI chat interface using Vercel's AI SDK.

Features

  • ✅ React frontend with TypeScript
  • ✅ Hono backend API
  • ✅ AI Chat powered by OpenAI GPT-4o-mini
  • ✅ Real-time streaming responses
  • ✅ Tailwind CSS styling

Getting started

Get a copy of this starter template by clicking the Remix button in the top-right.

How it works

  • The entrypoint is /backend/index.ts. That's the backend HTTP server, which also serves the all the frontend assets.

  • The client-side entrypoint is /frontend/index.html

    • which in turn imports /frontend/index.tsx
    • which in turn imports the React app from /frontend/components/App.tsx.
  • The chat feature uses:

    • /frontend/components/Chat.tsx - React component with useChat hook
    • /api/chat endpoint in /backend/index.ts - Streaming AI responses

So if you wanted to get a sense of how this app comes together, we suggest reading the files in this order:

/backend/index.ts -> /frontend/index.html -> /frontend/index.tsx -> /frontend/components/App.tsx -> /frontend/components/Chat.tsx

Chat Implementation

The chat feature uses Vercel's AI SDK:

  • useChat hook handles message state and streaming
  • OpenAI integration via Val Town's standard library
  • Streaming responses for real-time chat experience
  • Tailwind CSS for responsive design

Further resources

  • React Hono Example is a bigger example project, with a SQLite database table, queries, client-side CSS, a favicon, and shared code that runs on both client and server.
  • Vercel AI SDK Documentation for more chat features and customization options.
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.