24);
25
26function Hero({
27 prompt,
28 setPrompt,
44
45 <p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
46 Turn your ideas into fully functional apps in{" "}
47 <span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
48 less than a second
115}
116
117function App() {
118 const previewRef = React.useRef<HTMLDivElement>(null);
119 const [prompt, setPrompt] = useState("");
168 });
169
170 function handleStarterPromptClick(promptItem: typeof prompts[number]) {
171 setLoading(true);
172 setTimeout(() => handleSubmit(promptItem.prompt), 0);
173 }
174
175 async function handleSubmit(e: React.FormEvent | string) {
176 if (typeof e !== "string") {
177 e.preventDefault();
224 }
225
226 function handleVersionChange(direction: "back" | "forward") {
227 const { currentVersionIndex, versions } = versionHistory;
228 if (direction === "back" && currentVersionIndex > 0) {
972);
973
974function client() {
975 const path = window.location.pathname;
976 const root = createRoot(document.getElementById("root")!);
1008}
1009
1010function extractCodeFromFence(text: string): string {
1011 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1012 return htmlMatch ? htmlMatch[1].trim() : text;
1013}
1014
1015async function generateCode(prompt: string, currentCode: string) {
1016 const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1017 if (starterPrompt) {
1057}
1058
1059export default async function server(req: Request): Promise<Response> {
1060 // Dynamic import for SQLite to avoid client-side import
1061 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
19});
20
21async function relevant(t: Tweet): Promise<z.infer<typeof RelevanceSchema>> {
22 const systemPrompt = `Determine if this tweet JSON is relevant to Shorebird on the following criteria:
23
51const isProd = true;
52
53export async function twitterAlert({ lastRunAt }: Interval) {
54 // search
55 const since = isProd
24);
25
26function Hero({
27 prompt,
28 setPrompt,
52
53 <p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
54 Turn your ideas into fully functional apps in{" "}
55 <span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
56 less than a second
124}
125
126function App() {
127 const previewRef = React.useRef<HTMLDivElement>(null);
128 const [prompt, setPrompt] = useState("");
178 });
179
180 function handleStarterPromptClick(promptItem: typeof prompts[number]) {
181 setLoading(true);
182 setTimeout(() => handleSubmit(promptItem.prompt), 0);
183 }
184
185 async function handleSubmit(e: React.FormEvent | string) {
186 if (typeof e !== "string") {
187 e.preventDefault();
234 }
235
236 function handleVersionChange(direction: "back" | "forward") {
237 const { currentVersionIndex, versions } = versionHistory;
238 if (direction === "back" && currentVersionIndex > 0) {
982);
983
984async function client() {
985 const path = window.location.pathname;
986 const root = createRoot(document.getElementById("root")!);
1020}
1021
1022function extractCodeFromFence(text: string): string {
1023 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1024 return htmlMatch ? htmlMatch[1].trim() : text;
1025}
1026
1027async function generateCode(prompt: string, currentCode: string) {
1028 const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1029 if (starterPrompt) {
1069}
1070
1071export default async function server(req: Request): Promise<Response> {
1072 // Dynamic import for SQLite to avoid client-side import
1073 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
24);
25
26function Hero({
27 prompt,
28 setPrompt,
44
45 <p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
46 Turn your ideas into fully functional apps in{" "}
47 <span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
48 less than a second
115}
116
117function App() {
118 const previewRef = React.useRef<HTMLDivElement>(null);
119 const [prompt, setPrompt] = useState("");
168 });
169
170 function handleStarterPromptClick(promptItem: typeof prompts[number]) {
171 setLoading(true);
172 setTimeout(() => handleSubmit(promptItem.prompt), 0);
173 }
174
175 async function handleSubmit(e: React.FormEvent | string) {
176 if (typeof e !== "string") {
177 e.preventDefault();
224 }
225
226 function handleVersionChange(direction: "back" | "forward") {
227 const { currentVersionIndex, versions } = versionHistory;
228 if (direction === "back" && currentVersionIndex > 0) {
972);
973
974function client() {
975 const path = window.location.pathname;
976 const root = createRoot(document.getElementById("root")!);
1008}
1009
1010function extractCodeFromFence(text: string): string {
1011 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1012 return htmlMatch ? htmlMatch[1].trim() : text;
1013}
1014
1015async function generateCode(prompt: string, currentCode: string) {
1016 const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1017 if (starterPrompt) {
1057}
1058
1059export default async function server(req: Request): Promise<Response> {
1060 // Dynamic import for SQLite to avoid client-side import
1061 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
24);
25
26function Hero({
27 prompt,
28 setPrompt,
44
45 <p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
46 Turn your ideas into fully functional apps in{" "}
47 <span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
48 less than a second
115}
116
117function App() {
118 const previewRef = React.useRef<HTMLDivElement>(null);
119 const [prompt, setPrompt] = useState("");
168 });
169
170 function handleStarterPromptClick(promptItem: typeof prompts[number]) {
171 setLoading(true);
172 setTimeout(() => handleSubmit(promptItem.prompt), 0);
173 }
174
175 async function handleSubmit(e: React.FormEvent | string) {
176 if (typeof e !== "string") {
177 e.preventDefault();
224 }
225
226 function handleVersionChange(direction: "back" | "forward") {
227 const { currentVersionIndex, versions } = versionHistory;
228 if (direction === "back" && currentVersionIndex > 0) {
972);
973
974function client() {
975 const path = window.location.pathname;
976 const root = createRoot(document.getElementById("root")!);
1008}
1009
1010function extractCodeFromFence(text: string): string {
1011 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1012 return htmlMatch ? htmlMatch[1].trim() : text;
1013}
1014
1015async function generateCode(prompt: string, currentCode: string) {
1016 const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1017 if (starterPrompt) {
1057}
1058
1059export default async function server(req: Request): Promise<Response> {
1060 // Dynamic import for SQLite to avoid client-side import
1061 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
24);
25
26function Hero({
27 prompt,
28 setPrompt,
45
46 <p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
47 Turn your ideas into fully functional apps in{" "}
48 <span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
49 less than a second
116}
117
118function App() {
119 const previewRef = React.useRef<HTMLDivElement>(null);
120 const [prompt, setPrompt] = useState("");
171 });
172
173 function handleStarterPromptClick(promptItem: typeof prompts[number]) {
174 setLoading(true);
175 setTimeout(() => handleSubmit(promptItem.prompt), 0);
176 }
177
178 async function handleSubmit(e: React.FormEvent | string) {
179 if (typeof e !== "string") {
180 e.preventDefault();
227 }
228
229 function handleVersionChange(direction: "back" | "forward") {
230 const { currentVersionIndex, versions } = versionHistory;
231 if (direction === "back" && currentVersionIndex > 0) {
975);
976
977function client() {
978 const path = window.location.pathname;
979 const root = createRoot(document.getElementById("root")!);
1011}
1012
1013function extractCodeFromFence(text: string): string {
1014 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1015 return htmlMatch ? htmlMatch[1].trim() : text;
1016}
1017
1018async function generateCode(prompt: string, currentCode: string) {
1019 const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1020 if (starterPrompt) {
1081}
1082
1083export default async function server(req: Request): Promise<Response> {
1084 // Dynamic import for SQLite to avoid client-side import
1085 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
12type PromptItem = typeof prompts[number];
13
14function Hero({
15 prompt,
16 setPrompt,
50
51 <p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
52 Turn your ideas into fully functional apps in{" "}
53 <span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
54 less than a second
121}
122
123function App() {
124 const previewRef = React.useRef<HTMLDivElement>(null);
125 const [prompt, setPrompt] = useState("");
174 });
175
176 function handleStarterPromptClick(promptItem: typeof prompts[number]) {
177 setLoading(true);
178 setTimeout(() => handleSubmit(promptItem.prompt), 0);
179 }
180
181 async function handleSubmit(e: React.FormEvent | string) {
182 if (typeof e !== "string") {
183 e.preventDefault();
230 }
231
232 function handleVersionChange(direction: "back" | "forward") {
233 const { currentVersionIndex, versions } = versionHistory;
234 if (direction === "back" && currentVersionIndex > 0) {
993);
994
995function client() {
996 const path = window.location.pathname;
997 const root = createRoot(document.getElementById("root")!);
1029}
1030
1031function extractCodeFromFence(text: string): string {
1032 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1033 return htmlMatch ? htmlMatch[1].trim() : text;
1034}
1035
1036async function generateCode(prompt: string, currentCode: string) {
1037 const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1038 if (starterPrompt) {
1075}
1076
1077export default async function server(req: Request): Promise<Response> {
1078 // Dynamic import for SQLite to avoid client-side import
1079 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
15 "recipe ingredient converter and scaler",
16 "morse code translator with audio output",
17 "random quote generator with tweet functionality",
18 "personal finance tracker with basic charts",
19 "multiplayer rock-paper-scissors game",
20];
21
22function Dashboard() {
23 const [stats, setStats] = useState<{
24 totalGenerations: number;
36
37 useEffect(() => {
38 async function fetchStats() {
39 const response = await fetch("/dashboard-stats");
40 const data = await response.json();
115}
116
117function App() {
118 const [prompt, setPrompt] = useState(
119 STARTER_PROMPTS[Math.floor(Math.random() * STARTER_PROMPTS.length)],
141 });
142
143 async function handleSubmit(e: React.FormEvent) {
144 e.preventDefault();
145 setLoading(true);
174 }
175
176 function handleVersionChange(direction: "back" | "forward") {
177 const { currentVersionIndex, versions } = versionHistory;
178
305}
306
307function client() {
308 const path = window.location.pathname;
309 const root = createRoot(document.getElementById("root")!);
320}
321
322function extractCodeFromFence(text: string): string {
323 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
324 return htmlMatch ? htmlMatch[1].trim() : text;
325}
326
327export default async function server(req: Request): Promise<Response> {
328 // Dynamic import for SQLite to avoid client-side import
329 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
49});
50
51async function getDescriptions(val) {
52 const completion = await openai.beta.chat.completions.parse({
53 model: "gpt-4o-mini",
75}, { concurrency: 3 });
76
77async function getScreenshot(url: string) {
78 const resp = await fetch(
79 "https://api.apiflash.com/v1/urltoimage?" + new URLSearchParams({
22];
23
24function VideoUploadModal({ isOpen, onClose, onUpload }) {
25 const [description, setDescription] = useState('');
26 const [file, setFile] = useState(null);
61}
62
63function VideoCard({ video }) {
64 const [likes, setLikes] = useState(video.likes);
65 const [isLiked, setIsLiked] = useState(false);
95}
96
97function App() {
98 const [videos, setVideos] = useState(mockVideos);
99 const [isUploadModalOpen, setIsUploadModalOpen] = useState(false);
136}
137
138function client() {
139 createRoot(document.getElementById("root")).render(<App />);
140}
141if (typeof document !== "undefined") { client(); }
142
143export default async function server(request: Request): Promise<Response> {
144 return new Response(`
145 <html>