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

yuxiaoy

demo

Public
Like
demo
Home
Code
3
frontend
2
shared
1
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
/
README.md
Code
/
README.md
Search
5/19/2025
Viewing readonly version of main branch: v4
View latest version
README.md

AI Chat Application with HTMX and Gemini 2.0

A modern AI chat application built on Val Town using:

  • Hono (for backend routing, similar to Flask)
  • HTMX (for dynamic interactions without writing JavaScript)
  • TailwindCSS (for styling)
  • Google's Gemini 2.0 model (for AI responses)

Project Structure

├── backend/
│   └── index.ts       # Main entry point with Hono routes
├── frontend/
│   ├── index.html     # Main HTML template with HTMX
│   └── style.css      # Additional custom styles
└── shared/
    └── types.ts       # Shared types between frontend and backend

Setup

  1. Create a Google AI Studio API key at https://aistudio.google.com/
  2. Add your API key as an environment variable in Val Town named GEMINI_API_KEY

Features

  • Real-time chat interface
  • Message history persistence
  • Markdown rendering for code blocks and formatting
  • Responsive design

Usage

Access the application through the HTTP endpoint URL.

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
© 2025 Val Town, Inc.