Public
Like
veo-feed
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: v106View latest version
A web application that converts URLs into TikTok-style videos using AI-generated summaries and screenshots.
- NEVER USE:
https://esm.sh/@google/generative-ai@0.1.3 - ALWAYS USE:
https://esm.sh/@google/genai - Correct Import:
import { GoogleGenAI } from "https://esm.sh/@google/genai"; - Correct Initialization:
const genAI = new GoogleGenAI({ apiKey: Deno.env.get('GEMINI_API_KEY') || '' });
- Correct API Call:
const result = await genAI.models.generateContent({ model: "gemini-2.0-flash-exp", contents: summaryPrompt }); const summary = result.text;
- Markdown Service:
https://markdownifyurl.val.run/?url=${encodeURIComponent(url)} - Screenshot Service:
https://screenshot.val.run/?url=${encodeURIComponent(url)}
- Convert any URL into a video using Veo AI
- Fetch markdown content and screenshots from URLs using
markdownifyurl.val.run - Generate AI summaries using Gemini API
- TikTok-style scrolling feed with scroll-snap
- Customizable video generation prompts
βββ backend/
β βββ index.ts # Main Hono server
β βββ routes/
β β βββ videos.ts # Video generation endpoints
β β βββ static.ts # Static file serving
β βββ database/
β βββ migrations.ts # SQLite schema
β βββ queries.ts # Database operations
βββ frontend/
β βββ index.html # Main HTML template
β βββ index.tsx # React app entry point
β βββ components/
β β βββ App.tsx # Main app component
β β βββ VideoFeed.tsx # TikTok-style feed
β β βββ VideoCard.tsx # Individual video component
β β βββ URLInput.tsx # URL input form
β βββ style.css # Custom styles
βββ shared/
βββ types.ts # Shared TypeScript types
βββ utils.ts # Shared utility functions
POST /api/videos/generate- Generate video from URLGET /api/videos- Get all generated videosGET /api/videos/:id- Get specific videoDELETE /api/videos/:id- Delete video
GEMINI_API_KEY- Google Gemini API key for summaries (using @google/genai package)- Required for: AI summary generation
- Used with:
gemini-2.0-flash-expmodel - API:
genAI.models.generateContent()
VEO_API_KEY- Veo API key for video generation (if required)
- Uses SQLite with table name changes for schema updates
- Video records include: id, url, title, summary, screenshotUrl, videoUrl, status, prompt, error, createdAt, updatedAt
- Markdown Extraction:
markdownifyurl.val.runservice - Screenshot Capture:
screenshot.val.runservice - AI Summary: Google Gemini via
@google/genaipackage - Video Generation: Veo API (placeholder implementation)
- Database Storage: SQLite with status tracking
- Failed markdown fetch: Check URL accessibility
- AI generation errors: Verify GEMINI_API_KEY and model availability
- Database errors: Check table schema and migrations
- Enter URLs in the input form
- Videos are generated automatically using:
- Markdown content from the URL via
markdownifyurl.val.run - Screenshot of the page via
screenshot.val.run - AI-generated summary using Gemini (
@google/genaipackage) - Custom video generation prompt
- Markdown content from the URL via
- Scroll through the TikTok-style feed
- Customize video prompts in the settings
- Cause: Using wrong import package
- Solution: Use
import { GoogleGenAI } from "https://esm.sh/@google/genai"; - Never use:
@google/generative-ai@0.1.3
- Cause: Wrong markdown service URL
- Solution: Use
https://markdownifyurl.val.run/?url=${encodeURIComponent(url)} - Not:
markdownify.val.run
- Cause: Using deprecated model name
- Solution: Use
gemini-2.0-flash-expmodel - Not:
gemini-pro
processing: Video is being generatedcompleted: Video generation successfulfailed: Check error field for details
To test video generation:
curl -X POST https://your-app.web.val.run/api/videos/generate \ -H "Content-Type: application/json" \ -d '{"url": "https://www.google.com", "prompt": "Create a test video"}'
Check status:
curl https://your-app.web.val.run/api/videos