A RAG (Retrieval Augmented Generation) chatbot application that allows users to create notebooks, upload documents (PDF, text, websites), and chat with their documents using AI-powered semantic search.
- User Authentication - Sign up and login with JWT-based authentication
- Notebook Management - Create and organize multiple notebooks
- Document Upload - Support for PDF files, pasted text, and website URLs
- AI Chat - Chat with your documents using semantic search and GPT-4o-mini
- Streaming Responses - Real-time AI responses via server-sent events
- Frontend: Next.js 16, React 19, TailwindCSS 4, Zustand, TanStack Query, Shadcn
- Backend: Hono (Bun runtime), Prisma, PostgreSQL
- AI/Vector: OpenAI (GPT-4o-mini, text-embedding-3-small), Qdrant
- Node.js or Bun runtime
- PostgreSQL database
- Qdrant vector database (local or cloud)
- OpenAI API key
# Frontend
cd notebookchat-frontend
bun install
# Backend
cd ../notebookchatbot
bun installCreate a .env file in notebookchatbot/:
DATABASE_URL="postgresql://user:password@localhost:5432/notebookchat"
QDRANT_URL="http://localhost:6333"
ACCESS_TOKEN_SECRET="your-access-token-secret"
REFRESH_TOKEN_SECRET="your-refresh-token-secret"
CORS="http://localhost:3000"
OPENAI_API_KEY="sk-..."Create a .env.local file in notebookchat-frontend/:
NEXT_PUBLIC_API_URL="http://localhost:3000/api/v1"cd notebookchatbot
npx prisma generate
npx prisma db push# Backend (terminal 1)
cd notebookchatbot
bun run src/index.ts
# Frontend (terminal 2)
cd notebookchat-frontend
bun run devThe frontend runs on http://localhost:3000 and the API runs on http://localhost:3000/api/v1.
notebookchat-frontend/ # Next.js frontend
app/ # App router pages
components/ # React components
hooks/ # TanStack Query hooks
stores/ # Zustand stores
api/ # API client functions
notebookchatbot/ # Hono backend
src/
controllers/ # Route handlers
routes/ # API route definitions
middleware/ # Auth middleware
utils/ # Utilities (PDF, vector, etc.)
lib/ # Prisma, encryption
schema/ # Zod validation schemas
prisma/ # Database schema
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| POST | /api/v1/auth/signup |
Register new user | No |
| POST | /api/v1/auth/login |
User login | No |
| POST | /api/v1/auth/refresh |
Refresh access token | No |
| GET | /api/v1/notebooks |
List user notebooks | Yes |
| POST | /api/v1/notebooks |
Create notebook | Yes |
| POST | /api/v1/upload/:notebookId/pdf |
Upload PDF | Yes |
| POST | /api/v1/upload/:notebookId/text |
Upload text | Yes |
| POST | /api/v1/upload/:notebookId/website |
Upload website | Yes |
| POST | /api/v1/chat/:notebookId |
Chat with notebook | Yes |
MIT