1/**
2* This val creates a website called TownGen that generates optimized prompts for Hono and Deno based on user input.
3* It uses a simulated API for Hono and Deno features and incorporates a loading animation.
4* The prompt is tested and debugged using a simulated API before presenting to the user.
5* It includes a pill box multi-select for enhanced features from npm packages, organized into categories.
6* A large submit button and a 10-second animation are added when generating the prompt.
16import { createRoot } from "https://esm.sh/react-dom/client";
1718// Simulated API for Hono and Deno features
19const features = {
20hono: [
34"Built-in testing",
35"Permissions system",
36"Web standard APIs",
37],
38};
45backend: {
46icon: "🖧",
47items: ["GraphQL", "RESTful API", "WebSockets", "gRPC", "Microservices", "Serverless", "Event-driven"],
48},
49database: {
201content: [
202"contentful",
203"strapi",
204"ghost",
205"markdown-it",
262"Add splash page",
263"Add excessive emojis",
264"Use Web Storage API for local data",
265"Add a cookie consent banner",
266"Implement a progress bar for long forms",
3043. Leverage Deno capabilities:
305${features.deno.map(feature => `- ${feature}`).join("\n ")}
3064. Implement RESTful API endpoints
3075. Add error handling and logging
3086. Include unit tests using Deno's built-in testing framework
318Please generate TypeScript code for a Hono application running on Deno that implements these features.`;
319320// Simulated API call for testing and debugging
321const debuggedPrompt = await simulateDebugAPI(generatedPrompt);
322323setPrompt(debuggedPrompt);
333"Add database integration",
334"Implement authentication system",
335"Set up API endpoints",
336"Add error handling and logging",
337"Implement unit tests",
347"User authentication and authorization",
348"Data persistence and retrieval",
349"API integration",
350"Error handling and logging",
351"Performance optimization",
359};
360361const simulateDebugAPI = async (prompt: string) => {
362// Simulated API call for testing and debugging
363await new Promise(resolve => setTimeout(resolve, 2000));
364return prompt + "\n\nNote: This prompt has been tested and debugged for Hono and Deno compatibility.";
533<meta name="viewport" content="width=device-width, initial-scale=1.0">
534<title>TownGen - Val Generator</title>
535<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap" rel="stylesheet">
536<style>${css}</style>
537</head>
1/**
2* This val creates a website called TownGen that generates optimized prompts for Hono and Deno based on user input.
3* It uses a simulated API for Hono and Deno features and incorporates a loading animation.
4* The prompt is tested and debugged using a simulated API before presenting to the user.
5* It includes a pill box multi-select for enhanced features from npm packages, organized into categories.
6* A large submit button and a 10-second animation are added when generating the prompt.
16import { createRoot } from "https://esm.sh/react-dom/client";
1718// Simulated API for Hono and Deno features
19const features = {
20hono: [
34"Built-in testing",
35"Permissions system",
36"Web standard APIs",
37],
38};
45backend: {
46icon: "🖧",
47items: ["GraphQL", "RESTful API", "WebSockets", "gRPC", "Microservices", "Serverless", "Event-driven"],
48},
49database: {
201content: [
202"contentful",
203"strapi",
204"ghost",
205"markdown-it",
262"Add splash page",
263"Add excessive emojis",
264"Use Web Storage API for local data",
265"Add a cookie consent banner",
266"Implement a progress bar for long forms",
3043. Leverage Deno capabilities:
305${features.deno.map(feature => `- ${feature}`).join("\n ")}
3064. Implement RESTful API endpoints
3075. Add error handling and logging
3086. Include unit tests using Deno's built-in testing framework
318Please generate TypeScript code for a Hono application running on Deno that implements these features.`;
319320// Simulated API call for testing and debugging
321const debuggedPrompt = await simulateDebugAPI(generatedPrompt);
322323setPrompt(debuggedPrompt);
333"Add database integration",
334"Implement authentication system",
335"Set up API endpoints",
336"Add error handling and logging",
337"Implement unit tests",
347"User authentication and authorization",
348"Data persistence and retrieval",
349"API integration",
350"Error handling and logging",
351"Performance optimization",
359};
360361const simulateDebugAPI = async (prompt: string) => {
362// Simulated API call for testing and debugging
363await new Promise(resolve => setTimeout(resolve, 2000));
364return prompt + "\n\nNote: This prompt has been tested and debugged for Hono and Deno compatibility.";
533<meta name="viewport" content="width=device-width, initial-scale=1.0">
534<title>TownGen - Val Generator</title>
535<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap" rel="stylesheet">
536<style>${css}</style>
537</head>
1/**
2* This val creates a website that generates optimized prompts for Val Town based on user input.
3* It uses the OpenAI API to generate prompts and incorporates a loading animation.
4* The generated prompt is tailored to Val Town's specific features and best practices.
5*/
18"TypeScript support",
19"Deno runtime",
20"Web APIs",
21];
22
valleBlogV0README.md1 match
1* Fork this val to your own profile.
2* Create a [Val Town API token](https://www.val.town/settings/api), open the browser preview of this val, and use the API token as the password to log in.
3
valleBlogV0main.tsx1 match
38model: openai("gpt-4o", {
39baseURL: "https://std-openaiproxy.web.val.run/v1",
40apiKey: Deno.env.get("valtown"),
41} as any),
42messages: [
postmanClonemain.tsx2 matches
1/**
2* This val creates a Postman-like interface for testing HTTP requests directly in the browser.
3* It uses React for the UI and the Fetch API to make requests.
4* The server function serves the HTML and handles the API requests.
5*/
6
niceTodoListmain.tsx2 matches
1/**
2* This is a minimalist to-do list app using server-side rendering without any client-side JavaScript.
3* It uses Val Town's SQLite for data persistence, Deno's standard library for HTML escaping,
4* and custom SVG icons for a cohesive design.
5*/
84<meta name="viewport" content="width=device-width, initial-scale=1.0">
85<title>To Do List</title>
86<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
87<style>
88body {
blob_adminREADME.md1 match
9[](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
1011It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
1213# TODO
getContentFromUrlmain.tsx5 matches
6768export const getFirecrawlContent = async (url, opts = {}) => {
69const apiKey = Deno.env.get("FIRECRAWL_API_KEY");
70if (!apiKey) {
71throw new Error("API key not found. Please set FIRECRAWL_API_KEY in your environment.");
72}
739798try {
99const response = await fetch("https://api.firecrawl.dev/v0/scrape", {
100method: 'POST',
101headers: {
102"Authorization": `Bearer ${apiKey}`,
103"Content-Type": "application/json"
104},
czarkowyEdytorDatmain.tsx2 matches
2* This app allows users to drop an image onto the canvas, add text to it, move the text around,
3* edit the text directly on the canvas, and save the result to their local disk.
4* We'll use the HTML5 Canvas API for image manipulation and the File System Access API for saving files.
5* The app is styled with a playful and colorful design, using the Caveat font for a handwritten feel.
6*/
191<head>
192<title>CZARKOWY EDYTOR DAT NA OBRAZKACH</title>
193<link href="https://fonts.googleapis.com/css2?family=Caveat&display=swap" rel="stylesheet">
194<style>${css}</style>
195</head>