Public
Likewow_
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.
Viewing readonly version of main branch: v51View latest version
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Val Town project — a React component library starter template that runs on the Val Town platform (serverless Deno environment, not Node.js). It uses no build step: Twind shim for CSS-in-JS and esm.sh for imports, served statically.
- Runtime: Deno (Val Town serverless), configured via
deno.json - Imports: All dependencies come from
https://esm.sh(works in both browser and server) - React: Pinned to 18.2.0 — all React dependencies and sub-dependencies must use
?deps=react@18.2.0,react-dom@18.2.0 - JSX: Every TSX file must start with
/** @jsxImportSource https://esm.sh/react@18.2.0 */ - Styling: TailwindCSS via Twind shim (
<script type="module" src="https://cdn.skypack.dev/twind/shim">) - No
Denokeyword in code shared between frontend and backend
index.html— Entry point, loads Twind shim and fonts, mounts React appindex.tsx— React app root, renders into#rootstyle.css— Custom CSS animations (notification slide-in/out)types.ts— Shared type definitionscomponents/— Top-level components (Button, Card, Link, Notification, Icons)components/ui/— Primitive UI components (Badge, Container, Input, Label, Table, Tabs) with barrel export viaindex.tsAGENTS.md— Val Town coding agent instructions (trigger types, stdlib, platform specifics)
- Trigger types: HTTP (
.http.tsx), Cron (.cron.tsx), Email (.email.tsx) - Storage: Use
blob(key-value) orsqlitefrom Val Town stdlib — never Deno KV - Secrets: Use
Deno.env.get('keyname'), never hardcode - Redirects: Use
new Response(null, { status: 302, headers: { Location: "..." } })—Response.redirectis broken on Val Town - Backend framework: Hono is recommended; entry point via
export default app.fetch - SQLite schema changes: Create new tables with suffix (
_2,_3) instead of ALTER TABLE - Images: Prefer emojis/unicode/icon fonts over external or base64 images
- No
alert()/prompt()/confirm()browser APIs