Small full-stack notebook chat app.
web/: React + Vite frontendserver/: Express APIserver/rag/: Python RAG serviceserver/storage/rag/: RAG runtime state (qdrant/, temporary uploads)
Requirements:
- Node.js
- Python 3
- MongoDB running locally
Install frontend deps:
cd web
npm installInstall server deps:
cd server
npm installInstall Python deps:
cd server
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txtConfigure environment:
- Copy or edit
server/.env - Set
MONGO_URI - Set
UPLOAD_STORAGE=localfor a fully offline setup. In that mode, uploaded files are stored underserver/storage/rag/uploads/assetsand served fromLOCAL_UPLOADS_BASE_PATH. - If you keep
UPLOAD_STORAGE=cloudinary, set the Cloudinary values - Set the AI provider values
- Optional: override
QDRANT_PATHandUPLOADS_PATHif you want different RAG storage locations
Start the Python RAG service:
cd server
source .venv/bin/activate
python rag/app.pyStart the Express API:
cd server
npm run devStart the frontend:
cd web
npm run devFrontend default URL: http://localhost:5173
Server tests:
cd server
npm testReset only the local RAG storage:
cd server
npm run rag:wipeThe Python RAG service now uses the official OpenAI Python SDK with a configurable base_url, so it can target OpenAI-compatible providers like OpenRouter.
Preferred variables:
AI_API_KEY=...
AI_BASE_URL=https://openrouter.ai/api/v1
AI_LLM_MODEL=openai/gpt-4.1-mini
AI_EMBEDDING_MODEL=text-embedding-3-small
AI_RERANK_MODEL=...
UPLOAD_STORAGE=local
LOCAL_UPLOADS_BASE_PATH=/uploads
AI_APP_NAME=Notebook 2
AI_SITE_URL=http://localhost:5173
QDRANT_PATH=storage/rag/qdrant
UPLOADS_PATH=storage/rag/uploadsNotes:
AI_RERANK_MODELis optional. If your provider does not support/rerank, the app falls back to the vector search ordering.- For local Ollama, use
AI_BASE_URL=http://localhost:11434/v1and any non-emptyAI_API_KEYsuch asollama. - Existing
OPENROUTER_*variables still work as backward-compatible aliases. OPENAI_API_KEYandOPENAI_BASE_URLare also accepted as aliases.