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

yuxiaoy

demo

Public
Like
demo
Home
Code
9
app
3
backend
1
components
3
frontend
2
lib
3
public
1
shared
1
README.md
H
index.ts
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
README.md

AI Chat Application with Next.js 15 and Gemini 2.0

A modern AI chat application built on Val Town using:

  • Next.js 15-inspired structure
  • TailwindCSS for styling
  • Google's Gemini 2.0 model for AI responses

Project Structure

├── app/
│   ├── api/
│   │   └── chat/
│   │       └── route.ts     # API endpoint for chat
│   ├── layout.tsx           # Root layout component
│   └── page.tsx             # Main page component
├── components/
│   ├── chat-input.tsx       # Chat input component
│   ├── chat-message.tsx     # Message component
│   ├── chat.tsx             # Main chat component
│   └── providers.tsx        # Context providers
├── lib/
│   ├── gemini.ts            # Gemini API utilities
│   ├── storage.ts           # Storage utilities
│   └── types.ts             # TypeScript types
└── public/
    └── favicon.svg          # Favicon

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 with TailwindCSS
  • Next.js 15 App Router-inspired structure

Usage

Access the application through the HTTP endpoint URL.

FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI 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.