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: v23View 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 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)