Features
The web UI includes:- Real-time metrics dashboard with auto-refresh every 5 seconds
- Collection browser with full CRUD operations
- Document viewer with inline editing
- Search and pagination for large datasets
- REST API endpoints for programmatic access
- Mobile-responsive design with dark theme
Starting the web server
Enable theweb-ui feature in your Cargo.toml:
Cargo.toml
start_web_ui() method:
Dashboard features
Metrics view
The dashboard displays real-time metrics organized into four categories: Transactions- Active transactions count
- Committed and aborted totals
- Commit rate percentage
- Transaction conflicts
- Cache hit rate
- Cache hits and misses
- Dirty pages count
- Pages allocated and freed
- WAL writes and bytes written
- Checkpoint count
- Documents inserted, updated, deleted
- Documents read
- Total operations
Metrics automatically refresh every 5 seconds. The refresh indicator shows progress with a visual countdown.
Collection management
The collections panel allows you to:- View all collections in alphabetical order
- Click a collection to browse its documents
- Create new collections with the ”+ new collection” button
- Rename collections using the rename button
- Delete collections and all their documents
Document browser
Click any collection to open the document browser:- Search documents - Type to filter by any field
- Paginate results - Choose 10, 50, 100, 500, or 1000 docs per page
- View documents - JSON formatted with syntax highlighting
- Edit documents - Inline editor with validation
- Delete documents - With confirmation prompt
- Create documents - Add new documents with JSON editor
Press
ESC to close the document viewer and return to the dashboard.Web server architecture
The web server is implemented using thetiny_http library and runs in a separate thread:
src/core/web_server.rs
The web server automatically shuts down when the
WebServer instance is dropped.Example: Complete demo
Here’s a complete example that creates sample data and starts the web UI:examples/web_ui_demo.rs
Security considerations
The web UI is designed for local development and monitoring. Consider these security practices:
- Bind to localhost (
127.0.0.1) for local-only access - Use a reverse proxy (nginx, Caddy) with authentication for production
- Enable HTTPS when exposing to networks
- Restrict network access using firewall rules
- Monitor access logs for suspicious activity
Browser compatibility
The web UI works in all modern browsers:- Chrome/Edge 90+
- Firefox 88+
- Safari 14+
- Mobile browsers (iOS Safari, Chrome Android)
The UI is fully responsive and works on mobile devices with touch-optimized controls.
Next steps
- REST API reference - Detailed API endpoint documentation
- Metrics - Understanding database metrics
- Observability - Advanced monitoring setup