Skip to content

sarvalabs/MOI-Website

Repository files navigation

MOI Website

Landing page and chatbot experience for MOI.

Repo Structure

  • 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.

How The App Is Split

This repo is intentionally split into two runtime pieces:

  1. The frontend is a static Vite app.
  2. 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

Environment Variables

Copy .env.example to .env for local development and fill in your real values.

Required variables:

  • ANTHROPIC_API_KEY
  • OPENAI_API_KEY
  • SUPABASE_URL
  • SUPABASE_KEY
  • PORT
  • VITE_CHATBOT_API

For local development, VITE_CHATBOT_API should usually be http://localhost:3001.

Local Development

Install dependencies:

npm install
npm install --prefix server

Run the frontend:

npm run dev

Run the backend in a second terminal:

npm run dev:server

The local app will then run as:

  • frontend: http://localhost:5173
  • backend: http://localhost:3001

Ingestion Workflow

The chatbot relies on documents stored in docs/.

To ingest documents into Supabase:

npm run ingest

To clear existing stored chunks first:

npm run ingest:clear

Notes:

  • docs/ is the ingestion source of truth.
  • public/MOILitePaper.pdf is kept separately because it is linked from the site UI.

Build

Build the frontend:

npm run build

Preview the frontend build locally:

npm run preview

Run the backend in production mode:

npm start --prefix server

Deployment

Recommended deployment model:

  • frontend on Vercel
  • backend on Render or Railway
  • retrieval store on Supabase

Frontend

Deploy the root app as a static Vite site and set:

VITE_CHATBOT_API=https://your-backend-url

Backend

Deploy server/ as a Node service with these env vars:

  • ANTHROPIC_API_KEY
  • OPENAI_API_KEY
  • SUPABASE_URL
  • SUPABASE_KEY
  • PORT

The backend exposes:

  • GET /api/health
  • POST /api/chat

Notes

  • Do not commit .env.
  • CHATBOT_PROCESS.md is 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.

About

New MOI Website

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages