code
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.
index.ts
https://cobra0830--832323d039fd11f0a2929e149126039e.web.val.run
An advanced, full-stack web application that uses Gemini AI API to help developers write, fix, and understand code with ease.
- Code Generator - Generate complete code snippets in selected languages by describing the task in natural language
- Bug Fixing Assistant - Automatically detect and fix bugs in user-submitted code using Gemini's smart analysis
- Code Explainer - Understand unfamiliar code with AI-powered natural language explanations
- AI Chat Assistant - Chat with Gemini like a programming partner
- Prompt History - View all past queries and AI responses, stored locally
- Theme Switcher - Toggle between professional dark mode and clean light mode
- Smart Prompt System - Automatically structure and enhance user input for better accuracy
- Export Feature - Download generated code or explanations as files
- Frontend: React 18, TypeScript, TailwindCSS, Monaco Editor
- Backend: Hono, TypeScript
- AI: Gemini Pro API
- Storage: Local storage for history, SQLite for backend data
- Extras: File export, notifications, responsive design
- Set up your Gemini API key in environment variables as
GEMINI_API_KEY
- The app will be available at the HTTP endpoint
- Start coding with AI assistance!
βββ backend/
β βββ index.ts # Main Hono server
β βββ routes/
β β βββ gemini.ts # Gemini API integration
β β βββ static.ts # Static file serving
β βββ database/
β βββ queries.ts # Database operations
βββ frontend/
β βββ index.html # Main HTML template
β βββ index.tsx # React entry point
β βββ components/ # React components
β βββ styles/
βββ shared/
β βββ types.ts # Shared TypeScript types
βββ README.md
GEMINI_API_KEY
- Your Google Gemini API key (required)
Navigate to the app and start using the various AI-powered coding features:
- Generate code by describing what you need
- Fix bugs by pasting problematic code
- Get explanations for complex code snippets
- Chat with the AI for coding help
- Export your results and view your history