Minimal full-stack chatbot platform for the Full Stack Developer assignment.
- Public repository: https://github.com/dixonfrederick/chatbot-yellowai-dixon
- Hosted demo: https://chatbot-yellowai-dixon.vercel.app
- JWT authentication with registration and login.
- Per-user agents/projects with isolated data.
- Prompt storage and active prompt association per agent.
- Chat UI backed by the OpenAI Responses API when
OPENAI_API_KEYis set. - OpenRouter support with a configured free model.
- Local demo provider when no OpenAI key is configured.
- Drag-and-drop chat attachments with project file history.
- Image and PDF attachment previews in chat.
- Per-agent workflow state with stop support for in-progress responses.
- Responsive desktop and mobile UI with light/dark mode.
- Optional OpenAI Files API sync for uploaded files when OpenAI is enabled.
- SQLite local persistence and Postgres production persistence with automatic schema creation.
- React, TypeScript, Vite
- Express
- SQLite via
better-sqlite3for local development - Postgres via
pgfor Vercel/Neon production deployments - JWT and bcrypt password hashing
- OpenAI Node SDK
npm install
cp .env.example .env
npm run devClient: http://127.0.0.1:5173
API: http://localhost:4000
The app runs without an API key by using the local demo provider. To enable OpenAI model calls, set:
LLM_PROVIDER=openai
OPENAI_API_KEY=sk-your-key
OPENAI_MODEL=gpt-5-miniTo use OpenRouter's free model router instead:
LLM_PROVIDER=openrouter
OPENROUTER_API_KEY=sk-or-your-key
OPENROUTER_MODEL=openai/gpt-oss-20b:freenpm run build
npm startAfter build, Express serves the Vite dist folder and the API from the same process.
| Variable | Required | Default | Purpose |
|---|---|---|---|
PORT |
No | 4000 |
Express server port |
JWT_SECRET |
Yes in production | local dev secret | Token signing secret |
DB_PATH |
No | ./data/app.db |
SQLite database path |
DATABASE_URL |
Yes on Vercel | empty | Postgres connection string |
LLM_PROVIDER |
No | auto-detects keys or demo |
demo, openai, or openrouter |
OPENAI_API_KEY |
No | empty | Enables OpenAI Responses and Files APIs |
OPENAI_MODEL |
No | gpt-5-mini |
Model used for chat responses |
OPENROUTER_API_KEY |
No | empty | Enables OpenRouter chat completions |
OPENROUTER_MODEL |
No | openai/gpt-oss-20b:free |
OpenRouter model |
OPENROUTER_VISION_MODEL |
No | openrouter/free |
OpenRouter model/router used when image attachments are sent |
CLIENT_ORIGIN |
No | http://localhost:5173 |
Dev CORS origin |
POST /api/auth/registerPOST /api/auth/loginGET /api/auth/meGET /api/projectsPOST /api/projectsGET /api/projects/:projectIdPATCH /api/projects/:projectIdDELETE /api/projects/:projectIdPOST /api/projects/:projectId/promptsGET /api/projects/:projectId/messagesPOST /api/projects/:projectId/chatPOST /api/projects/:projectId/chat/stopGET /api/projects/:projectId/filesPOST /api/projects/:projectId/filesGET /api/projects/:projectId/files/:fileId/content
The app is deployable as one Node service on Render, Railway, Fly.io, or Vercel.
Recommended settings:
- Build command:
npm install && npm run build - Start command:
npm start - Use Postgres/Neon on Vercel via
DATABASE_URL. - Set
JWT_SECRET. - Set either
OPENAI_API_KEYorOPENROUTER_API_KEYfor real LLM responses.
This repo includes vercel.json for Vercel, render.yaml for Render Blueprint deployment, and a Dockerfile for container hosts such as Fly.io.
- Register a user.
- Create an agent and enter a system prompt.
- Send a chat message.
- Drag a file into the chat composer and ask about it.
- Save an updated prompt and send a second chat message.