Create a .env file in the root directory (or set environment variables in Vercel):
OPENAI_API_KEY=your_openai_api_key_here
VERCEL_API_URL=https://your-app.vercel.app# Root dependencies
npm install
# Website dependencies
cd website
npm install
cd ..
# Electron dependencies
cd electron
npm install
cd ..cd website
npm run dev
# Opens at http://localhost:3000cd electron
npm run build
npm start- Install Vercel CLI:
npm i -g vercel- Deploy:
vercel-
Set environment variables in Vercel dashboard:
- Go to your project settings
- Add
OPENAI_API_KEYwith your OpenAI API key
-
Update
VERCEL_API_URLin your local.envto point to your deployed URL
Once deployed, the following endpoints will be available:
POST /api/chat- Chat completionsPOST /api/speech- Speech-to-text transcriptionGET /api/usage- Get usage statisticsPOST /api/usage- Increment usage counter
# Install Bazel (if not already installed)
# See: https://bazel.build/install
# Build Electron
bazel build //electron:electron-app
# Build Website
bazel build //website:website-package- Ensure
OPENAI_API_KEYis set in Vercel environment variables - Check that API routes are in the
api/directory - Verify
vercel.jsonconfiguration
- Run
npm run buildin theelectron/directory first - Check that all dependencies are installed
- Ensure TypeScript compilation succeeds
- Clear
.nextdirectory:rm -rf website/.next - Reinstall dependencies:
cd website && rm -rf node_modules && npm install