• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
stevekrouse

stevekrouse

last-login-demo-1

Public
Like
1
last-login-demo-1
Home
Code
3
backend
1
frontend
2
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
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.
Sign up now
Code
/
Code
/
Search
index.ts
https://stevekrouse--e8ad097a93d811f089f80224a6c84d84.web.val.run
README.md

ChatGPT Clone with LastLogin Authentication

A fullstack React + Hono app that lets you chat with ChatGPT, with user authentication and thread history.

Features

  • 🔐 Authentication via LastLogin (Google OAuth)
  • 💬 Chat with ChatGPT (GPT-4o-mini)
  • 📝 Thread-based conversation history
  • 🗄️ SQLite storage for persistence
  • 📱 Responsive design with TailwindCSS

Project Structure

├── backend/
│   └── index.ts             # Main Hono server with API routes
├── frontend/
│   ├── index.html           # Main HTML template
│   └── index.tsx            # React frontend app
└── README.md

Current Status: Phase 3 Complete ✅

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

API Endpoints

  • GET / - Main React app
  • GET /api/threads - List user's threads
  • POST /api/threads - Create new thread
  • GET /api/threads/:id/messages - Get messages for thread
  • POST /api/threads/:id/messages - Send message and get AI response

Database Schema

Tables:

  • last-login-chat-threads - User chat threads
  • last-login-chat-messages - Individual messages in threads

Next Steps

  • Phase 4: Thread management and auto-titles
  • Phase 5: Final polish and responsive design

Debug Routes

  • /debug - Check authentication status
  • /api/test-create-thread - Create a test thread (when logged in)
HTTP
  • index.ts
    stevekrouse--e8…84.web.val.run
Code
backendfrontendREADME.md
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.