last-login-demo-1
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.
Viewing readonly version of main branch: v22View latest version
A fullstack React + Hono app that lets you chat with ChatGPT, with user authentication and thread history.
- π Authentication via LastLogin (Google OAuth)
- π¬ Chat with ChatGPT (GPT-4o-mini)
- π Thread-based conversation history
- ποΈ SQLite storage for persistence
- π± Responsive design with TailwindCSS
βββ backend/
β βββ index.ts # Main Hono server with API routes
βββ frontend/
β βββ index.html # Main HTML template
β βββ index.tsx # React frontend app
βββ README.md
Backend Foundation:
- β Hono app with LastLogin authentication
- β SQLite schema for threads and messages
- β Basic API endpoints for threads CRUD
- β Static file serving for React frontend
Frontend Foundation:
- β React app with authentication UI
- β Basic layout with sidebar for threads
- β Login/logout flow with LoginWithGoogleButton
- β Thread listing and creation
- β Responsive design with TailwindCSS
Chat Interface:
- β Chat message display with user/assistant styling
- β Message input with textarea and send button
- β OpenAI API integration (GPT-4o-mini)
- β Real-time message updates
- β Loading states and typing indicators
- β Conversation history context
GET /- Main React appGET /api/threads- List user's threadsPOST /api/threads- Create new threadGET /api/threads/:id/messages- Get messages for threadPOST /api/threads/:id/messages- Send message and get AI response
Tables:
last-login-chat-threads- User chat threadslast-login-chat-messages- Individual messages in threads
- Phase 3: Chat interface with OpenAI integration
- Phase 4: Thread management and auto-titles
- Phase 5: Final polish and responsive design
/debug- Check authentication status/api/test-create-thread- Create a test thread (when logged in)
