Family GPT Chat

A ChatGPT-like chat application built for Val Town using React and Hono with OpenAI integration.

Features

  • šŸ’¬ Real-time chat interface with ChatGPT-like styling
  • šŸ¤– OpenAI GPT-3.5-turbo integration via Val Town's standard library
  • šŸ“± Responsive design with Tailwind CSS
  • ⚔ Fast TypeScript development with Deno
  • šŸ”„ Conversation history maintained during session
  • ā³ Loading states and error handling
  • āœ… Full type safety with TypeScript

Project Structure

family-gpt/
ā”œā”€ā”€ backend/
│   ā”œā”€ā”€ index.ts          # Hono server with chat API
│   └── index.test.ts     # Backend tests
ā”œā”€ā”€ frontend/
│   ā”œā”€ā”€ components/
│   │   ā”œā”€ā”€ App.tsx       # Main chat interface
│   │   ā”œā”€ā”€ ChatMessage.tsx # Individual message component
│   │   └── MessageInput.tsx # Message input form
│   ā”œā”€ā”€ index.html        # Bootstrap HTML file
│   └── index.tsx         # React entry point
ā”œā”€ā”€ shared/
│   └── types.ts          # Shared TypeScript types
└── deno.json             # Deno configuration

API Endpoints

  • GET / - Serves the React frontend
  • POST /api/chat - Chat with OpenAI (requires message and optional conversation history)
  • GET /api/health - Health check endpoint
  • GET /frontend/* - Static file serving

Development

Prerequisites

  • Deno runtime
  • Val Town account (for deployment)

Local Development

# Type check deno task check # Format code deno task fmt # Lint code deno task lint # Run tests deno task test # Run all quality checks deno task quality

Deployment to Val Town

# Deploy (runs quality checks first) deno task deploy

Technology Stack

  • Backend: Hono framework
  • Frontend: React with TypeScript
  • Styling: Tailwind CSS (via CDN)
  • AI: OpenAI GPT-3.5-turbo via Val Town's standard library
  • Runtime: Deno
  • Platform: Val Town

Usage

  1. Open the application in your browser
  2. Type a message in the input field
  3. Press Enter or click Send
  4. The AI will respond with helpful information
  5. Continue the conversation - history is maintained during the session

Features to Add

  • Streaming responses for real-time chat feel
  • Conversation persistence across sessions
  • Message editing and deletion
  • Export conversation history
  • Custom system prompts
  • Multiple conversation threads

Contributing

This project follows Val Town development best practices:

  • TypeScript everywhere
  • Testable code with dependency injection
  • SOLID principles
  • Quality checks before deployment

šŸ¤– Generated with opencode