This guide explains how to run the Logistics AI Bot with the React frontend.
React Frontend (fe-react/)
↓ HTTP POST /ask
FastAPI Backend (backend/api.py)
↓
Gateway (classifies & produces to Kafka)
↓
Kafka Topic: events.workflow.commands
↓
Responder (consumes, invokes tools, produces response)
↓
Kafka Topic: events.output.message
↓
Gateway (consumes response)
↓
FastAPI returns response to Frontend
- Kafka must be running
- Python 3.12+ with dependencies installed
- Node.js / npm for the React frontend
- Navigate to the backend directory:
cd backend- Install dependencies (if using uv):
uv syncOr with pip:
pip install -r requirements.txt # if you have one, or install from pyproject.toml- Make sure Kafka topics exist:
events.workflow.commandsevents.output.messageevents.insights.message
- Navigate to the frontend directory:
cd fe-react- Install dependencies:
npm installIn the backend/ directory:
python api.pyOr using uvicorn directly:
uvicorn api:app --host 0.0.0.0 --port 8000 --reloadYou should see:
✅ All services started! API server ready.
INFO: Uvicorn running on http://0.0.0.0:8000
In a new terminal, navigate to fe-react/ directory:
cd fe-react
npm run devThe frontend will start on http://localhost:5173 (Vite default port).
Open your browser and navigate to:
http://localhost:5173
Send a chat message to the AI assistant.
Request:
{
"question": "What are the details of order with id 12?"
}Response:
{
"answer": "Order ID: 12\nStatus: Processing\n..."
}Check if the API and services are running.
Response:
{
"status": "healthy",
"gateway": true,
"responder": true
}If you see CORS errors, make sure:
- The frontend URL is in the
allow_originslist inapi.py - Both services are running on the expected ports
- Check if Kafka is running
- Check if the Responder consumer is connected (check backend logs)
- Verify Kafka topics exist
- Check the
/healthendpoint
- Verify the backend is running on
http://localhost:8000 - Check browser console for errors
- Verify the API endpoint URL in
App.tsxmatches your backend URL
- The API server auto-reloads with
--reloadflag - Check logs for Kafka consumer/producer status
- Use
/healthendpoint to verify services
- Vite hot-reloads on file changes
- Check browser console for errors
- Network tab shows API requests/responses
- The Gateway and Responder services start automatically when the API server starts
- Both consumers run in background threads
- Default tool messages (greetings, etc.) are handled directly without Kafka
