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

kvey

oatmeal

Public
Like
oatmeal
Home
Code
12
.env.example
.vtignore
AGENTS.md
README.md
api-routes.ts
database.ts
middleware.ts
routes.ts
services.ts
ui-routes.ts
utils.ts
H
val.ts
Branches
1
Pull requests
Remixes
History
Environment variables
3
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
/
AGENTS.md
Code
/
AGENTS.md
Search
…
AGENTS.md

Agent Instructions

Instructions for AI coding agents working on this Val Town project.

Project Overview

Meeting recording automation platform for Val Town:

  • Send bots to meetings via Recall.ai
  • Manage recordings with transcripts
  • Val Town SQLite database
  • Single-file deployment in val.ts

Code Style

  1. All code goes in val.ts - Single file deployment
  2. Use esm.sh imports: import { Hono } from "https://esm.sh/hono@4"
  3. Val Town SQLite: import { sqlite } from "https://esm.town/v/std/sqlite"
  4. Parameterized queries: Always use ? placeholders
  5. TypeScript: Explicit types for all functions

Common Patterns

Database Query

const result = await db.execute({ sql: `SELECT * FROM table WHERE id = ?`, args: [id], }); const row = firstRow<TypeName>(result);

Create Record

const id = crypto.randomUUID(); const now = Date.now(); await db.execute({ sql: `INSERT INTO table (id, field, created_at) VALUES (?, ?, ?)`, args: [id, value, now], });

API Endpoints

API endpoints are split between two patterns matching Django structure:

API Pattern (under /api/ prefix):

app.get("/api/recordings", authMiddleware, async (c) => { const user = c.get("user"); const db = getDb(); const result = await db.execute({ sql: `SELECT * FROM recordings WHERE user_id = ?`, args: [user.id], }); return c.json({ recordings: parseRows(result) }); });

Action Pattern (root level):

app.post("/recordings/upload", authMiddleware, async (c) => { const user = c.get("user"); const body = await c.req.json(); // Handle upload logic return c.json({ success: true }); });

Endpoint Structure

  • API endpoints (/api/*): Read operations, list views
  • Action endpoints (root level): Create, update, action operations
  • Webhooks (/webhooks/*): External webhook handlers (no auth)

Database Schema

Tables:

  • users - User accounts (id, email, api_token, etc.)
  • recordings - Meeting recordings (id, user_id, recallai_bot_id, title, etc.)
  • clips - Video clips (id, recording_id, title, video)
  • calendar_events - Calendar events (id, user_id, raw, start_time, end_time)
  • calendar_preferences - User automation rules (id, user_id, enabled, ruleset)
  • calendar_series_preferences - Recurring meeting preferences

Field types:

  • IDs: TEXT (UUIDs)
  • Timestamps: INTEGER (milliseconds)
  • Booleans: INTEGER (0/1)
  • JSON: TEXT (stringify/parse)

Environment Variables

Access via Deno.env.get("VAR_NAME"):

  • RECALLAI_API_KEY - Required
  • AWS_ACCESS_KEY_ID - Required
  • AWS_SECRET_ACCESS_KEY - Required
  • AWS_STORAGE_BUCKET_NAME - Required
  • JWT_SECRET - Required

DO NOT

  • ❌ Split code into multiple files
  • ❌ Use JSR imports (jsr:@hono/hono)
  • ❌ Use local file system
  • ❌ Add voice print/ML features
  • ❌ Hardcode secrets
  • ❌ Use SQL string concatenation

DO

  • βœ… Keep everything in val.ts
  • βœ… Use esm.sh for imports
  • βœ… Use Val Town SQLite
  • βœ… Use parameterized queries
  • βœ… Handle errors gracefully
  • βœ… Log important operations
  • βœ… Return proper HTTP status codes

Deployment

  1. Copy val.ts to Val Town
  2. Set environment variables in Val Town UI
  3. Create first user via script Val
  4. Test endpoints

Testing

# Health check curl https://yourval.web.val.run/health # List recordings curl -H "Authorization: Token YOUR_TOKEN" \ https://yourval.web.val.run/api/recordings # Send bot curl -X POST https://yourval.web.val.run/recordings/send_bot \ -H "Authorization: Token YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{"meeting_url": "https://zoom.us/j/123", "title": "Test"}'

Resources

  • Val Town: https://val.town
  • Val Town Docs: https://docs.val.town
  • Hono.js: https://hono.dev
  • Recall.ai: https://docs.recall.ai
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.