Skip to content

An4Dev/simple_chat_bot

Repository files navigation

Chatbot Starter (Next.js + TypeScript + Tailwind)

A simple chat playground that keeps messages in memory and responds via a demo API endpoint. Swap the API route with your LLM provider to go live.

Getting started

cd chat-bot
npm install
npm run dev
# visit http://localhost:3000

Where to edit

  • UI: src/app/page.tsx
  • Styles: src/app/globals.css
  • API stub: src/app/api/chat/route.ts (replace with your model call)

Hooking up OpenAI (already wired)

  1. Create .env.local and set OPENAI_API_KEY=your-real-key.
  2. Start the app with npm run dev (the API route now calls OpenAI).
  3. Optional: change the model in src/app/api/chat/route.ts (default is gpt-4o-mini).
  4. For streaming, return a ReadableStream and update the UI to read it.

Deploying

This project is ready for Vercel:

npm run lint   # optional, before deploying

Push to GitHub and import into Vercel, or run vercel if you have the CLI installed.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published