Landing page and chatbot experience for MOI.
src/: React frontend built with Vite.server/: Express chatbot API.scripts/ingest.js: document ingestion script for the retrieval pipeline.docs/: source documents used for ingestion into Supabase.public/: static frontend assets served to users.supabase-setup.sql: database setup for the retrieval store.
This repo is intentionally split into two runtime pieces:
- The frontend is a static Vite app.
- The chatbot runs on a separate Node/Express backend.
The frontend sends chat requests to VITE_CHATBOT_API, and the backend handles:
- embeddings via OpenAI
- retrieval via Supabase
- response generation and streaming via Anthropic
Copy .env.example to .env for local development and fill in your real values.
Required variables:
ANTHROPIC_API_KEYOPENAI_API_KEYSUPABASE_URLSUPABASE_KEYPORTVITE_CHATBOT_API
For local development, VITE_CHATBOT_API should usually be http://localhost:3001.
Install dependencies:
npm install
npm install --prefix serverRun the frontend:
npm run devRun the backend in a second terminal:
npm run dev:serverThe local app will then run as:
- frontend:
http://localhost:5173 - backend:
http://localhost:3001
The chatbot relies on documents stored in docs/.
To ingest documents into Supabase:
npm run ingestTo clear existing stored chunks first:
npm run ingest:clearNotes:
docs/is the ingestion source of truth.public/MOILitePaper.pdfis kept separately because it is linked from the site UI.
Build the frontend:
npm run buildPreview the frontend build locally:
npm run previewRun the backend in production mode:
npm start --prefix serverRecommended deployment model:
- frontend on Vercel
- backend on Render or Railway
- retrieval store on Supabase
Deploy the root app as a static Vite site and set:
VITE_CHATBOT_API=https://your-backend-urlDeploy server/ as a Node service with these env vars:
ANTHROPIC_API_KEYOPENAI_API_KEYSUPABASE_URLSUPABASE_KEYPORT
The backend exposes:
GET /api/healthPOST /api/chat
- Do not commit
.env. CHATBOT_PROCESS.mdis internal process documentation and is not required for runtime.- The app currently uses a split frontend/backend architecture by design; this repo is not set up as a single full-stack deployment target.