adi-o3-multipass/frontend/README.md

1.7 KiB

Brief Extractor Frontend

React-based frontend for the Enhanced Brief Processing System.

Environment Configuration

The frontend uses environment variables to configure the backend API and WebSocket URLs.

Setup

  1. Copy .env.example to .env:

    cp .env.example .env
    
  2. Edit .env to configure for your target environment:

    For Production Deployment:

    VITE_API_URL=https://ai-sandbox.oliver.solutions/brief-extractor-back/api
    VITE_WS_URL=wss://ai-sandbox.oliver.solutions/brief-extractor-back
    

    For Local Development:

    VITE_API_URL=http://localhost:8000/api
    VITE_WS_URL=ws://localhost:8000
    

Building for Different Environments

The environment variables are embedded at build time, so you need to configure .env before running the build:

Build for Production:

# Ensure .env has production URLs
npm run build

Build for Local Development:

# Ensure .env has local URLs
npm run build

Run Development Server:

npm run dev

The dev server will use the URLs from .env or fall back to the proxy configuration in vite.config.ts.

Scripts

  • npm run dev - Start development server on port 3000
  • npm run build - Build for production (uses URLs from .env)
  • npm run preview - Preview production build locally
  • npm run lint - Run ESLint
  • npm run type-check - Run TypeScript type checking

Deployment

When deploying to production:

  1. Ensure .env has the correct production URLs
  2. Run npm run build
  3. Deploy the dist/ directory to your web server

The built files in dist/ will have the backend URLs baked in based on the .env configuration at build time.