AI Tool App

A comprehensive AI assistant that can answer questions and generate images.

Features

  • Chat Interface: Ask questions and get AI-powered responses using GPT-4
  • Image Generation: Generate images from text descriptions using AI
  • Real-time Interface: Clean, responsive UI with real-time interactions

Project Structure

├── backend/
│   └── index.ts             # Main Hono server with API routes
├── frontend/
│   ├── components/
│   │   ├── App.tsx          # Main application component
│   │   ├── ChatInterface.tsx # Chat component for Q&A
│   │   └── ImageGenerator.tsx # Image generation component
│   ├── index.html           # Main HTML template
│   ├── index.tsx            # Frontend entry point
│   └── style.css            # Custom styles
└── shared/
    └── types.ts             # Shared TypeScript types

API Endpoints

  • GET / - Serves the main application
  • POST /api/chat - Handles chat/question requests
  • POST /api/generate-image - Handles image generation requests

Environment Variables

  • OPENAI_API_KEY - Required for OpenAI API access (automatically configured in Val Town)

Usage

  1. Navigate to the app URL
  2. Use the chat interface to ask questions
  3. Use the image generator to create images from descriptions
  4. Switch between modes using the tab interface