AI Hackathon Chatbot

A production-ready AI chat application with multi-provider LLM support, artifact workspace, streaming responses, and persistent chat history.

2023-03-01

full-stackOpen GitHub
AI Hackathon Chatbot

AI Hackathon Chatbot

Built during a hackathon, this goes well beyond a basic chat interface. It supports multiple AI providers, a persistent artifact workspace (think Claude Artifacts or ChatGPT Canvas), real-time streaming, and a full conversation history backed by a database.

What it does

  • Switch between OpenAI, Azure OpenAI, and Fireworks AI per session
  • Responses stream token by token in real time via the Vercel AI SDK
  • Side-by-side chat with an editable artifact pane for text, code, images, and spreadsheets
  • Write and run Python directly inside the chat
  • Conversations saved to NeonDB through Drizzle ORM
  • File attachments via Vercel Blob
  • Custom session auth with bcrypt

Stack

LayerTech
FrameworkNext.js (App Router)
LanguageTypeScript
AI SDKVercel AI SDK
LLM ProvidersOpenAI, Azure OpenAI, Fireworks
DatabaseNeonDB (serverless Postgres)
ORMDrizzle ORM
File StorageVercel Blob
Code EditorCodeMirror 6
StylingTailwind CSS, Radix UI, Framer Motion

How streaming works

Browser --(stream)--> Next.js API Route
                              |
                        Vercel AI SDK
                              |
                  +-----------+-----------+
                  |           |           |
               OpenAI       Azure     Fireworks
                              |
                        Drizzle ORM
                              |
                           NeonDB

Tokens go straight from the provider to the client with no buffering in between.

Adding a new artifact type

Each artifact type lives in its own folder under artifacts/ with two files: a client.tsx for the React UI and a server.ts for handling the AI stream. That's the whole interface.

SCREENSHOTS // 02 FRAMES

Screenshot 1
Screenshot 2
01 / 02