A web application that converts URLs into TikTok-style videos using AI-generated summaries and screenshots.
├── 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 videoPOST /api/videos/poll - Poll for processing video updatesGET /api/admin/prompt - Get current default video promptPUT /api/admin/prompt - Update default video promptGET /api/admin/videos - Get all videos for admin managementPOST /api/admin/reprocess - Reprocess selected videos with new promptGEMINI_API_KEY - Google Gemini API key for summaries (required)ADMIN_PASSWORD - Password for admin interface access (required for admin features)VEO_API_KEY - Veo API key for video generation (optional - currently using placeholder)GEMINI_API_KEY environment variable in Val Townhttps://markdownify.val.run/ for converting web pages to markdownhttps://screenshot.val.run/ for taking page screenshots/admin in your browserADMIN_PASSWORD environment variable)https://esm.sh/@google/generative-ai@0.1.3https://esm.sh/@google/genaiimport { GoogleGenAI } from "https://esm.sh/@google/genai";const genAI = new GoogleGenAI({
apiKey: Deno.env.get("GEMINI_API_KEY") || "",
});
const result = await genAI.models.generateContent({
model: "gemini-flash-latest",
contents: summaryPrompt,
});
const summary = result.text;
https://markdownifyurl.val.run/?url=${encodeURIComponent(url)}https://screenshot.val.run/?url=${encodeURIComponent(url)}Create a funky, engaging video overview of this web page content.
Make it visually interesting with dynamic transitions, colorful graphics, and modern design elements.
The video should be vertical (9:16 aspect ratio) like a TikTok video.
Include text overlays highlighting key points from the summary.
Use the screenshot as a reference for the original page design but make it more dynamic and engaging.
Keep it under 30 seconds and make it scroll-friendly for social media.
This project includes an automated cron job that fetches top HackerNews stories and generates videos for them.
For detailed setup instructions, see HACKERNEWS_CRON_SETUP.md
Quick Start:
hackernews-cron.ts to Val.Town as a new ValBASE_URL environment variable to your deployed application URL0 * * * *)TOP_STORIES_LIMIT in the code to control how many stories to processThe cron job will automatically:
Videos generated by the cron job appear in your feed just like manually submitted URLs.