A web application with a React frontend and Python backend.
- Node.js and npm
- Python 3.10 and above
- Required Python dependencies
Navigate to the frontend directory:
cd src/solace_ai_connector_web/frontend
npm install
Run the frontend development server:
npm run dev
To build the frontend for production:
npm run build
# or
npx remix vite:build
Run this in the root of the project to build the wheel package:
python -m build -w
This will create a /dist folder containing the wheel file which needs to be installed as a dependency in the solace-agent-mesh project.
One suggested workflow for installing the wheel:
pip uninstall solace_ai_connector_web -y && pip install ../../web-solace/solace-ai-connector-web/dist/solace_ai_connector_web-0.1.0-py3-none-any.whl
Since static assets are served by default, development with hot reload requires some configuration:
Add the server configuration:
// vite.config.ts
import { vitePlugin as remix } from "@remix-run/dev";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [
remix({
ssr: false,
buildDirectory: "./static",
}),
],
server: {
proxy: {
"/api": {
target: "http://localhost:5001", // Go backend URL
changeOrigin: true,
secure: false, // Disable SSL verification if not using HTTPS
rewrite: (path) => path.replace(/^\/api/, "/api"),
},
},
},
});
For local development pointing to local REST API with auth disabled:
WEBUI_RESPONSE_API_URL=http://127.0.0.1:5050/api/v1/request
WEBUI_FRONTEND_SERVER_URL=http://localhost:5001
WEBUI_FRONTEND_USE_AUTHORIZATION=False
WEBUI_FRONTEND_URL=http://localhost:5173
This configuration allows you to use npm run dev
while still connecting to the REST API run by Solace Agent Mesh.
- The Python server is configured to serve static files automatically
- Frontend builds are placed in the static directory in frontend/static for the server to access