| .. | ||
| dist | ||
| node_modules | ||
| src | ||
| .env.example | ||
| DEPLOYMENT.md | ||
| Dockerfile | ||
| index.html | ||
| nginx.conf | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.js | ||
| README.md | ||
| tailwind.config.js | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| vite.config.ts | ||
| WEBSOCKET_SETUP.md | ||
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
-
Copy
.env.exampleto.env:cp .env.example .env -
Edit
.envto 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-backFor 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 3000npm run build- Build for production (uses URLs from.env)npm run preview- Preview production build locallynpm run lint- Run ESLintnpm run type-check- Run TypeScript type checking
Deployment
When deploying to production:
- Ensure
.envhas the correct production URLs - Run
npm run build - 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.