Public
Like
family-gpt-chat
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data β all from the browser, and deployed in milliseconds.
index.ts
https://tijs--781ccf526e3e11f084e90224a6c84d84.web.val.run
A ChatGPT-like chat application built for Val Town using React and Hono with OpenAI integration.
- π¬ 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
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
GET /- Serves the React frontendPOST /api/chat- Chat with OpenAI (requires message and optional conversation history)GET /api/health- Health check endpointGET /frontend/*- Static file serving
- Deno runtime
- Val Town account (for deployment)
# 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
# Deploy (runs quality checks first) deno task deploy
- 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
- Open the application in your browser
- Type a message in the input field
- Press Enter or click Send
- The AI will respond with helpful information
- Continue the conversation - history is maintained during the session
- Streaming responses for real-time chat feel
- Conversation persistence across sessions
- Message editing and deletion
- Export conversation history
- Custom system prompts
- Multiple conversation threads
This project follows Val Town development best practices:
- TypeScript everywhere
- Testable code with dependency injection
- SOLID principles
- Quality checks before deployment
π€ Generated with opencode