Wenlan
Wenlan is a source-backed AI knowledge base and LLM wiki for AI work: organize documents and decisions into pages you can find, inspect, and review.
翻訳待ち
No updates detected yet. GitHub releases will appear here.
A chatbot web app with streaming Gemini replies created with NextJS 16
翻訳待ち
Loading the full README. The saved excerpt is shown below.
A chatbot web app with streaming Gemini replies, saved chats organised into notebooks, and a try-without-signing-up demo mode.Read the full README ↗A chatbot web app with streaming Gemini replies, saved chats organised into notebooks, and a try-without-signing-up demo mode.
/api/chat, rendered as markdown, with auto-generated chat titles and a mock mode that skips model calls./prompts, with search and categories. Use fills the chat input of a new chat.Install dependencies (this also runs prisma generate):
npm install
Copy .env.example to .env and fill in the values (see below).
Apply the database migrations:
npx prisma migrate dev
Optionally seed the development database with sample notebooks, chats and messages:
npm run db:seed
Start the dev server and open http://localhost:3000:
npm run dev
| Variable | Purpose |
|---|---|
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY, CLERK_SECRET_KEY | Clerk authentication |
GEMINI_API_KEY | Gemini API access |
USE_AI_MODEL | Set to false to return mock replies and skip model calls |
DATABASE_URL, DATABASE_URL_UNPOOLED | Pooled and direct Postgres connection strings |
SEED_ALLOWED_HOST | Host of the development database; db:seed refuses any other host |
UPSTASH_REDIS_REST_URL, UPSTASH_REDIS_REST_TOKEN | Redis for rate limits |
GLOBAL_DAILY_MODEL_LIMIT | Total model calls per day across all users (default 500) |
CHAT_DAILY_LIMIT | Optional. Model replies per person per day (default 10) |
CRON_SECRET | Protects /api/demo/cleanup; Vercel Cron sends it as a bearer token |
DEMO_LIMIT_PER_IP, DEMO_LIMIT_GLOBAL, DEMO_USER_TTL_HOURS | Optional. Demo limits per address and overall, and hours before a demo user is deleted |
| Command | What it does |
|---|---|
npm run dev | Start the development server |
npm run build | Build for production |
npm start | Run the production build |
npm run lint | Run ESLint |
npm test | Run the Vitest unit tests once |
npm run test:watch | Run Vitest in watch mode |
npm run db:seed | Seed the development database |
app/: routes (/, /chats/[chatId], /notebooks/[notebookId], /prompts, auth pages) and API routes (/api/chat, /api/demo)components/: UI by feature (chat, sidebar, notebook, prompts, layout) and shadcn components in ui/actions/: Server Actions for chats, messages, prompts and settingslib/: AI setup, rate limits, validation, database and helper codeprisma/: schema, migrations and seed datacontext/: project specs, coding standards and feature historyDeploy on Vercel. Run prisma migrate deploy before the app starts in production, and set the environment variables above. vercel.json schedules a daily cron job (04:00) that calls /api/demo/cleanup to delete expired demo users.