A React-based dashboard for the ResearchAI semantic search system with real-time log display.
- Express server with API endpoints
- Ingestion and query controllers
- CORS enabled
- All tests passed
- ✅ Initialize React app with Vite
- ✅ Create component structure
- ✅ Set up API client utilities
- ✅ Configure proxy for API calls
- ✅ WebSocket integration for real-time logs
- ✅ StatusBar - Connection status, log count, server info
- ✅ LogViewer - Real-time log display with filtering
- ✅ LogEntry - Individual log entry rendering
- ✅ IngestPanel - Ingestion controls with file stats
- ✅ QueryPanel - Semantic search interface
- ✅ ResultsDisplay - Query results and answers
- Install dependencies
- Connect frontend to backend API
- Test ingestion flow
- Test query flow with various inputs
- Test with curl requests
frontend/
├── index.html # Entry HTML file
├── package.json # Dependencies
├── vite.config.js # Vite configuration with proxy
├── README.md # This file
└── src/
├── main.jsx # React entry point
├── App.jsx # Main app with WebSocket & API handlers
├── App.css # All styles
└── components/
├── StatusBar.jsx # Header with connection status
├── LogViewer.jsx # Real-time log display
├── LogEntry.jsx # Single log entry
├── IngestPanel.jsx # Ingestion controls
├── QueryPanel.jsx # Search interface
└── ResultsDisplay.jsx # Results display
cd ../backend
npm installcd frontend
npm installcd ../backend
npm run devcd frontend
npm run devNavigate to: http://localhost:5173
The frontend connects to these backend endpoints:
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/health |
Health check |
| GET | /api/ingest/files |
List files |
| POST | /api/ingest |
Trigger ingestion |
| POST | /api/ingest/clear |
Clear database |
| POST | /api/query |
Semantic search |
| POST | /api/query/answer |
Get direct answer |
| GET | /api/logs |
Get log history |
| DELETE | /api/logs |
Clear logs |
curl -X POST http://localhost:5000/api/ingestcurl -X POST http://localhost:5000/api/query \
-H "Content-Type: application/json" \
-d '{"query": "skills"}'curl -X POST http://localhost:5000/api/query/answer \
-H "Content-Type: application/json" \
-d '{"question": "What programming languages?"}'curl http://localhost:5000/api/ingest/filescurl http://localhost:5000/api/health- WebSocket connection for instant log updates
- Filter by log level (info, success, error, warning, process, data, debug)
- Search logs by text
- Auto-scroll with manual override
- Clear logs button
- File count and statistics
- Clear database before ingestion option
- Start/Stop ingestion
- Success/error feedback
- Search mode (multiple results)
- Answer mode (best match)
- Adjustable result count
- Adjustable similarity threshold
- Similarity scores with percentage
- Content preview
- Metadata tags (name, location, role, skills)
- Source file information
- Chunk information
| Event | Direction | Description |
|---|---|---|
connect |
Client ← Server | Connection established |
disconnect |
Client ← Server | Connection lost |
log |
Client ← Server | New log entry |
log-history |
Client ← Server | Log history on connect |
logs-cleared |
Client ← Server | Logs cleared notification |
clear-logs |
Client → Server | Request to clear logs |
npm run buildnpm run preview- TypeScript errors in VSCode are expected until
npm installruns - The frontend uses Vite's proxy to forward
/api/*requests to backend - WebSocket connects directly to backend on port 5000
- All console logs from backend are captured and displayed in UI
- Only error logs remain in terminal for debugging