Search
Code3,285
- **Backend**: Hono API framework- **Database**: SQLite for user data and engagement tracking- **AI**: OpenAI for mood-based affirmations- **Styling**: African-inspired earth tones with cultural patterns
import { Hono } from "https://esm.sh/hono@3.11.7";import { OpenAI } from "https://esm.town/v/std/openai";import { createMoodEntry, getUserMoodEntries, getMoodStats, trackEngagement } from "../database/queries.ts";import type { MoodEntry, APIResponse } from "../../shared/types.ts";export const moodRoutes = new Hono();// Initialize OpenAI for affirmationsconst openai = new OpenAI();// Submit mood check-in : `Generate a gentle, comforting affirmation in English for someone feeling ${mood}. The affirmation should be culturally sensitive, inspired by African wisdom, and encouraging. Maximum 2 sentences.`; const completion = await openai.chat.completions.create({ messages: [ { try { const completion = await openai.chat.completions.create({ messages: [ {
- Backend: Hono (TypeScript)- Frontend: React with TypeScript- AI: OpenAI GPT for quote generation- Storage: Val Town Blob for quote history- Styling: TailwindCSS
- **Frontend**: React with TypeScript - **Styling**: TailwindCSS with custom glass-morphism effects- **AI**: OpenAI GPT-4o-mini for personalized wellness advice- **Fonts**: Inter + Crimson Text for modern + sage-like typography- **Animations**: CSS keyframes for floating and fade-in effects
import { Hono } from "https://esm.sh/hono@3.11.7";import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";import { OpenAI } from "https://esm.town/v/std/openai";import type { SageResponse, UserPreferences, WellnessChallenge, WellnessTip, UrbanLocation } from "../shared/types.ts";});const openai = new OpenAI();// Serve static filesRespond with helpful, personalized advice in a warm, sage-like tone. Keep responses concise but meaningful.`; const completion = await openai.chat.completions.create({ messages: [ { role: "system", content: systemPrompt },- tags: relevant keywords array`; const completion = await openai.chat.completions.create({ messages: [{ role: "user", content: prompt }], model: "gpt-4o-mini",
## Twin Name Generator Features- 🤖 **AI-Powered Generation**: Uses OpenAI GPT-4 to create creative, meaningful name combinations- 👫 **Gender Options**: Choose from Boy/Boy, Girl/Girl, or Boy/Girl combinations - 🎵 **Rhyming Names**: Generates names that sound harmonious together- React 18.2.0 with TypeScript- OpenAI GPT-4 for AI name generation- TailwindCSS for styling- Hono backend for serving files and API handling
import { Hono } from "https://esm.sh/hono@3.11.7";import { OpenAI } from "https://esm.town/v/std/openai";import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";});// Generate twin names using OpenAIapp.post("/api/generate-names", async c => { try { const { genderCombination, style } = await c.req.json() as TwinNameRequest; const openai = new OpenAI(); // Create gender-specific prompt- Make names appropriate and beautiful for twins.`; const completion = await openai.chat.completions.create({ messages: [ {
## Features- 🤖 OpenAI-powered name generation- 👶 Gender preference selection (boy/boy, girl/girl, boy/girl)- 🎵 Rhyming and similar sounding name suggestions## Tech Stack- Backend: Hono + OpenAI API- Frontend: React + TypeScript + TailwindCSS- Styling: Modern gradient design with animations
import { Hono } from "https://esm.sh/hono@3.11.7";import { OpenAI } from "https://esm.town/v/std/openai";import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";import type { NameGenerationRequest, NameGenerationResponse, NamePair } from "../shared/types.ts";});const openai = new OpenAI();// Serve static files]`; const completion = await openai.chat.completions.create({ messages: [ { if (!responseText) { throw new Error("No response from OpenAI"); } namePairs = JSON.parse(responseText); } catch (parseError) { console.error("Failed to parse OpenAI response:", responseText); throw new Error("Invalid response format from AI"); }
import { OpenAI } from "https://esm.town/v/std/openai";import type { AIGenerationRequest, AIGenerationResponse } from "../../shared/types.ts";const openai = new OpenAI();export async function generateContent(request: AIGenerationRequest): Promise<AIGenerationResponse> {Generate an improved description:`; const completion = await openai.chat.completions.create({ messages: [{ role: "user", content: prompt }], model: "gpt-4o-mini", const suggestionsPrompt = `Generate 2 alternative short descriptions for the same product. Each should be 1-2 sentences and include emojis:`; const suggestionsCompletion = await openai.chat.completions.create({ messages: [ { role: "user", content: prompt },Generate a helpful auto-reply response:`; const completion = await openai.chat.completions.create({ messages: [{ role: "user", content: prompt }], model: "gpt-4o-mini",
reconsumeralization
import { OpenAI } from "https://esm.town/v/std/openai";
import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
/**
* Practical Implementation of Collective Content Intelligence
* Bridging advanced AI with collaborative content creation
*/
exp
kwhinnery_openai
lost1991
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
No docs found