REST API server and Admin UI for doredore, built with Axum and Alpine.js.
- ✅ REST API: Complete HTTP API for all RAG operations
- ✅ Admin UI: Beautiful web interface built with Alpine.js and Tailwind CSS
- ✅ CORS Support: Easy integration with any frontend
- ✅ Docker Ready: Dockerfile and docker-compose included
- ✅ Fast & Lightweight: Built with Axum for maximum performance
- ✅ Thread-Safe: Uses Mutex for safe concurrent access
# Build the server
cargo build --package doredore-server --release
# Run the server
./target/release/rag-server
# Server will start on http://localhost:3000cd doredore-server
docker-compose up -d# Copy example environment
cp .env.example .env
# Edit .env with your settings
# Then run:
./target/release/rag-serverGET /healthGET /api/collections # List all collections
POST /api/collections # Create new collection
DELETE /api/collections/:name # Delete collectionGET /api/documents # List documents
POST /api/documents # Add new document
DELETE /api/documents/:id # Delete documentGET /api/search?q=query&collection=faq&top_k=5&threshold=0.5
GET /api/enrich?q=query&collection=faq&top_k=3POST /api/import-csvAccess the admin interface at http://localhost:3000/
Features:
- ✨ Modern, responsive design
- 📝 Manage collections and documents
- 🔍 Test search and RAG functionality
- 📊 View search results with scores
- 💡 Generate LLM context
curl -X POST http://localhost:3000/api/collections \
-H "Content-Type: application/json" \
-d '{"name": "faq", "description": "FAQs"}'curl -X POST http://localhost:3000/api/documents \
-H "Content-Type: application/json" \
-d '{
"content": "永代供養とは...",
"collection": "faq",
"metadata": {"category": "永代供養", "priority": "high"}
}'curl "http://localhost:3000/api/search?q=永代供養について&collection=faq&top_k=3"curl "http://localhost:3000/api/enrich?q=永代供養について&collection=faq&top_k=3"Environment variables:
# Database
DATABASE_PATH=./knowledge.db
# Embedding Model
EMBEDDING_MODEL=bge-small-en-v1.5
# Server
HOST=0.0.0.0
PORT=3000
# Logging
RUST_LOG=info# Build
docker-compose build
# Run
docker-compose up -d
# View logs
docker-compose logs -f
# Stop
docker-compose down┌─────────────┐
│ Browser │
│ (Admin UI) │
└──────┬──────┘
│
↓
┌─────────────────┐
│ Axum Server │
│ (REST API) │
└────────┬────────┘
│
↓
┌─────────────────┐
│ doredore │
│ (Core) │
└────────┬────────┘
│
↓
┌─────────────────┐
│ SQLite │
│ (Database) │
└─────────────────┘
- Request latency: <10ms (typical)
- Thread-safe: Yes (Mutex protected)
- Concurrent requests: Supported
- Binary size: ~20MB (release build)
# Run in debug mode
cargo run --package doredore-server
# Run with logs
RUST_LOG=debug cargo run --package doredore-server
# Format code
cargo fmt
# Lint
cargo clippy --package doredore-serverMIT License - see LICENSE file for details.