Initial commit: EGBE chatbot template

Stripped from vercel/chatbot (Apache 2.0):
- Dropped @vercel/* packages and AI Gateway
- Removed artifacts feature (code/text/sheet/image side panel)
- Switched AI provider to @ai-sdk/openai-compatible -> EGBE LiteLLM
- Replaced Vercel Blob upload with data URLs
- Dropped Redis resumable streams and rate limiter (in-memory now)
- Added Dockerfile (Next.js standalone) + entrypoint that runs migrations
- Wired DATABASE_URL, EGBE_AI_API_URL/KEY, NEXT_PUBLIC_BASE_URL for app-deploy.sh
This commit is contained in:
dmitry.galkin 2026-05-25 14:54:04 +04:00
commit 3e21c2334c
129 changed files with 21913 additions and 0 deletions

57
README.md Normal file
View file

@ -0,0 +1,57 @@
# EGBE Chatbot Template
Next.js chatbot wired to the EGBE LiteLLM proxy. Based on [vercel/chatbot](https://github.com/vercel/chatbot) (Apache 2.0), stripped of Vercel-specific bits and rewired for our infra.
## Stack
- **Next.js 16** (App Router, standalone output)
- **AI SDK** + `@ai-sdk/openai-compatible` → routes to `EGBE_AI_API_URL` (our LiteLLM)
- **NextAuth** (credentials + guest)
- **Drizzle ORM** + Postgres (DB gateway)
- **shadcn/ui** + Tailwind
## Available models (via LiteLLM)
`claude-sonnet`, `claude-haiku`, `gpt-5.4`, `gpt-5.4-mini`, `kimi-k2.6`, `minimax-m2.7`, `qwen3-coder`.
Edit `lib/ai/models.ts` to add or remove.
## Deploy (from inside an OpenClaw instance)
```bash
${SKILLS_DIR}/scripts/app-deploy.sh <slug> chatbot-template
```
`app-deploy.sh` auto-injects:
- `DATABASE_URL` (per-app Postgres)
- `EGBE_AI_API_URL`, `EGBE_AI_API_KEY` (instance LiteLLM key)
- `NEXT_PUBLIC_BASE_URL` (the deployed `*.p.egbe.app` host)
You also need `AUTH_SECRET` — set it via `APP_ENV_JSON`:
```bash
APP_ENV_JSON='{"AUTH_SECRET":"'$(openssl rand -base64 32)'"}' \
${SKILLS_DIR}/scripts/app-deploy.sh mychat chatbot-template
```
## Local dev
```bash
cp .env.example .env.local
# fill in DATABASE_URL, EGBE_AI_API_KEY, AUTH_SECRET
pnpm install
pnpm db:migrate
pnpm dev
```
## Tracking upstream
Pull new vercel/chatbot features manually — `origin/upstream` is not configured by default here. Add it back with:
```bash
git remote add upstream https://github.com/vercel/chatbot.git
```
## License
Apache 2.0 — see `LICENSE`. Derivative work of Vercel, Inc.'s [chatbot](https://github.com/vercel/chatbot).